Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Huge modular potential with release of Chat GPT
Staff
#1
0
0
Huge modular potential with release of Chat GPT

So was messing around with this new AI people have been talking about chat.openai.com and I'm absolutely blown away by the possibilities!

I prompted the AI to write me a daisy dsp program that was a switchable oscillator core between triangle and square with control over PWM, a low pass filter, and wave folder. It freaking did it and spit out real C++. I can only imagine how far people can take this!

Prompt:

"Can you write a daisy dsp program that has a switchable oscillator core between triangle and square with control over PWM, a resonant low pass filter, and wave folder on the output"

Response:


Sure, I can write a program that uses a switchable oscillator core between triangle and square with control over PWM, a resonant low pass filter, and a wave folder on the output. Here is an example of such a program:

```

include "daisysp.h"

include "daisy_patch.h"

using namespace daisysp; using namespace daisy;

DaisyPatch patch; Oscillator osc;

// Set the oscillator waveform type enum WaveForm { TRIANGLE, SQUARE }; WaveForm waveform;

void AudioCallback(float *in, float *out, size_t size) { // switch between triangle and square waveform if(waveform == TRIANGLE) { osc.SetWaveform(Oscillator::WAVE_TRI); } else if(waveform == SQUARE) { osc.SetWaveform(Oscillator::WAVE_SQUARE); }

// Set the oscillator pulse width osc.SetPulseWidth(0.5f); // Set the oscillator frequency osc.SetFreq(440.0f); // Set the oscillator amplitude osc.SetAmp(0.5f); // Set the oscillator phase osc.SetPhase(0.0f); // Process the audio for(size_t i = 0; i < size; i += 2) { // Generate the next sample float s = osc.Process(); // Apply the low pass filter s = patch.lp_filter.Process(s); // Fold the waveform s = patch.fold.Process(s); // Apply the gain s *= 0.5f; // Write the audio to the output buffer out[i] = out[i + 1] = s; } 

}

int main(void) { // Initialize the daisy patch patch.Init();

// Initialize the oscillator osc.Init(patch.GetSampleRate()); // Set the waveform to triangle waveform = TRIANGLE; // Set the filter cutoff frequency patch.lp_filter.SetCutoff(1000.0f); // Set the filter resonance patch.lp_filter.SetRes(0.8f); // Set the wavefolder shape patch.fold.SetFold(1.0f); // Start the audio processing patch.StartAudio(AudioCallback); while(1) {} 

} ```

In this program, the oscillator core can be switched between a triangle and a square waveform by setting the waveform variable to either TRIANGLE or SQUARE. The pulse width of the oscillator can be controlled by calling the SetPulseWidth method of the osc object, and the oscillator frequency, amplitude, and phase can be set by calling the SetFreq, SetAmp, and SetPhase methods, respectively.

The output of the oscillator is passed through a low pass filter and a wavefolder before being sent to the audio output. The cutoff frequency and resonance of the low pass filter can be controlled


Suffice to say I think any layman can get involved in the dsp scene now with minimal experience required to at least get some interesting results!

Go check it out!!

submitted by /u/Andres11407
[link] [comments]
Reply


Forum Jump:

[-]
Private Messages
Please login or register to use this functionality.

[-]
Who's Online
There are currently no members online.

[-]
Latest Threads
Watch “Synth God” Mike Dean play Moog’s ...
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5
Tracktion’s “huge” Waveform Pro 13 updat...
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5
Band invent bionic robot arm that lets p...
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5
Steinberg VST Live Pro 2: A MainStage Al...
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5
Raspberry Pi Synthesizers – How the Pi i...
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5
Harrison Audio Mixbus 10: Immersive Mixi...
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5
Zoom MS-60B+ – Plus-sized Bass Multi-Eff...
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5
Nothing Ear Headphones and Ear (a): An A...
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5
Best USB Turntables For Ripping Vinyl
Last Post: SynthWizard
Today 03:13 AM
» Replies: 0
» Views: 5