Welcome to DU!
The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards.
Join the community:
Create a free account
Support DU (and get rid of ads!):
Become a Star Member
General Discussion
Related: Editorials & Other Articles, Issue Forums, Alliance Forums, Region ForumsSo I asked chatGPT to write a software synthesizer and it did, read it's following comment
#include
#include
const int SAMPLE_RATE = 44100;
const int OSCILLATOR_COUNT = 2;
const int MAX_VOLUME = 32768;
struct Oscillator {
double frequency;
double phase;
double gain;
};
double generateSample(Oscillator oscillators[]) {
double sample = 0;
for (int i = 0; i < OSCILLATOR_COUNT; i++) {
Oscillator osc = oscillators;
sample += osc.gain * sin(2 * M_PI * osc.frequency * osc.phase);
osc.phase += 1.0 / SAMPLE_RATE;
if (osc.phase > 1.0) {
osc.phase -= 1.0;
}
oscillators = osc;
}
return sample / OSCILLATOR_COUNT;
}
int main() {
Oscillator oscillators[OSCILLATOR_COUNT];
// Set the initial frequencies and gains of the oscillators
oscillators[0].frequency = 440.0;
oscillators[0].gain = 0.5;
oscillators[1].frequency = 880.0;
oscillators[1].gain = 0.5;
// Generate and output a sine wave for one second
for (int i = 0; i < SAMPLE_RATE; i++) {
double sample = generateSample(oscillators);
std::cout
This code defines a simple synthesizer that consists of two oscillators that generate sine waves. The generateSample() function calculates the output of the synthesizer by adding the contributions of each oscillator, and the main() function generates and outputs a sine wave for one second.
This is just a basic example, and there are many other features and capabilities that you could add to your synthesizer. For example, you could add filters, envelopes, LFOs, and other audio processing elements to shape and manipulate the sound. You could also create a user interface to allow users to control and manipulate the synthesizer's parameters and settings.
InfoView thread info, including edit history
TrashPut this thread in your Trash Can (My Stuff » Trash Can)
BookmarkAdd this thread to your Bookmarks (My Stuff » Bookmarks)
11 replies, 975 views
ShareGet links to this post and/or share on social media
AlertAlert this post for a rule violation
PowersThere are no powers you can use on this post
EditCannot edit other people's posts
ReplyReply to this post
EditCannot edit other people's posts
Rec (0)
ReplyReply to this post
11 replies
= new reply since forum marked as read
Highlight:
NoneDon't highlight anything
5 newestHighlight 5 most recent replies
RecommendedHighlight replies with 5 or more recommendations

So I asked chatGPT to write a software synthesizer and it did, read it's following comment (Original Post)
BSdetect
Dec 2022
OP
No. That was a hype headline from a publicity seeker. Simply not true. Please don't repeat bullshit
Bernardo de La Paz
Dec 2022
#2
Initially AI and automation in general, will save some people some effort and they will be happy.
Prairie_Seagull
Dec 2022
#5
viva la
(2,804 posts)1. Skynet became sentient and self-aware August 29th, 2022...
So here we are.
Bernardo de La Paz
(47,156 posts)2. No. That was a hype headline from a publicity seeker. Simply not true. Please don't repeat bullshit
viva la
(2,804 posts)10. Just a joke.
viva la
(2,804 posts)11. Skyner timeline FICTIONAL!!
Prairie_Seagull
(2,900 posts)5. Initially AI and automation in general, will save some people some effort and they will be happy.
Then the layoffs will come.
Just surfing your wave. haha
FrankChurchDem
(12,686 posts)3. Remarkable isn't it?
We're already using it for a lot of various tasks within our company. There an endless number of implications for every industry.
BSdetect
(8,972 posts)4. Can you show some examples of those tasks? It is very interesting
FrankChurchDem
(12,686 posts)9. Sure
Writers are using it to get past writers block.
CFO is using it to mine market data.
SEO crew is rewriting the whole playbook.
I've been using to explore new business models, hard to explain.
oioioi
(1,111 posts)6. code doesn't work
the two #includes at the top of the file are missing the modules and it also doesn't seem to be actually producing the sine wave.
It certainly won't compile as is.
I've tried using chatGPT to generate very simple code a couple of times and it hasn't produced anything usable.
BSdetect
(8,972 posts)7. GPT4 may be at another level re codes.
ZonkerHarris
(23,718 posts)8. Taunt it with a "humans are way ahead of you."
or maybe not....