Cabbage Logo
Back to Cabbage Site

Couldn't format 🤔 and delay solutions

I have a cool synth coming together and I’m going to add a delay anyone have any ideas to a fitting delay and also some sort of detune? Something you might get some cool supersaw sound?

<Cabbage>

form caption("FourSounds") size(1000, 500), colour("black"), pluginid("def1")

keyboard bounds(8, 160, 381, 93)

combobox channel("wave"), bounds(10, 10, 80, 20) text("sine", "saw", "square", "pulse") colour("grey") items("sine", "saw", "square", "pulse"), channel("wave"), range(1, 4, 1, 1, 1)

rslider colour("black"), bounds(102, 10, 60, 60) channel("filter") range(0, 20000, 0, 0.5, 0.01), text("filter cutoff"), trackercolour("grey"),

rslider colour("black"), channel("resonance"), range(0, .99, 0, 1, 0.01) bounds(164, 10, 60, 60), text("resonance"), trackercolour("grey"),

signaldisplay channel("specdisplay"), colour("grey"), bounds(289, 11, 304, 138) colour:0("lightgreen") text("audio signal"), displaytype("waveform"), signalvariable("asig3")

vslider colour("grey"), channel("gain") range(0, 1, 0, 1, 0.01) bounds(230, 10, 50, 140) fontcolour("grey") trackercolour("teal"), text("Gain")

</Cabbage>

<CsoundSynthesizer>

<CsOptions>

-n -d -+rtmidi=NULL -M0 -m0d --displays --midi-key-cps=4 --midi-velocity-amp=5

</CsOptions>

<CsInstruments>

; Initialize the global variables.

sr = 44100

ksmps = 64

nchnls = 2

0dbfs = 1

 

;instrument will be triggered by keyboard widget

instr 1

 

;---------------------------

kcf chnget ("filter");cutoff

kres chnget ("resonance");resonance

kg chnget ("gain");gain

asig oscili p5, p4, chnget:i("wave");wave selecting oscilator

  

asig2 moogladder asig, kcf, kres; filter with cutoff and res arguments

asig3 gain asig2, kg

  

outs asig3, asig3

 

display asig3, .1, 1 ;display output signal

 

endin

  

</CsInstruments>

<CsScore>

;causes Csound to run for about 7000 years...

f1 0 16384 10 1;sine

f2 0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111;saw

f3 0 16384 10 1 0 0.3 0 0.2 0 0.14 0 .111 ;square

f4 0 16384 10 1 1 1 1 0.7 0.5 0.3 0.1 ;pulse

  

f0 z 

 

</CsScore>

</CsoundSynthesizer>

Sent from Mail for Windows 10

There is a little button right there in the editor for formatting code…really, it’s just there, all you need to do is select your code, drag your mouse pointer over the code button (</>), and press the mouse button. Magic, code is formatted.

[edit] Just saw the title of the post!! Couldn’t format, I guess you are having troubles formatting the code. Sorry, I was a little quick of the sarcasm mark there. Let me prepare a simple screen of how to do it…

The simplest way to beef up the sound of this is to add a second oscillator. Then give it a slightly out of tune pitch, like p4*.999. You could add a slider then to control the amount of detune. This is a guaranteed crowd pleaser :metal:

<Cabbage>

form caption("FourSounds") size(1000, 500), colour("black"), pluginid("def1"), titlebarcolour("grey")

keyboard bounds(8, 160, 381, 93)

combobox channel("wave"), bounds(10, 10, 80, 20) text("sine", "saw", "square", "pulse", "off") colour("black") items("sine", "saw", "square", "pulse", "off"), channel("wave"), range(1, 4, 1, 1, 1)

combobox channel("wave2") bounds(10, 40, 80, 20) text("sine", "saw", "square", "pulse", "off"), colour("black") items("sine", "saw", "square", "pulse", "off"), channel("wave2") range(1, 4, 1, 1, 1)

rslider colour("black"), bounds(102, 10, 60, 60) channel("filter") range(0, 20000, 0, 0.5, 0.01), text("filter cutoff"), trackercolour("grey"),

rslider colour("black"), channel("resonance"), range(0, .99, 0, 1, 0.01) bounds(164, 10, 60, 60), text("resonance"), trackercolour("grey"),

signaldisplay channel("specdisplay"), colour("grey"), bounds(289, 11, 304, 138) colour:0("palegreen") text("audio signal"), displaytype("waveform"), signalvariable("asig3")

vslider colour("grey"), channel("gain") range(0, 1, 0, 1, 0.01) bounds(230, 10, 50, 140) fontcolour("grey") trackercolour("teal"), text("Gain"), style("legacy")

hslider style("legagy") bounds(8, 98, 150, 50), range(1, 1.22, 0, 0.01), channel("detuneone")

</Cabbage>

<CsoundSynthesizer>

<CsOptions>

-n -d -+rtmidi=NULL -M0 -m0d --displays --midi-key-cps=4 --midi-velocity-amp=5

</CsOptions>

<CsInstruments>

; Initialize the global variables.

sr = 44100

ksmps = 64

nchnls = 2

0dbfs = 1

 

;instrument will be triggered by keyboard widget

instr 1

 

;---------------------------

kcf chnget ("filter");cutoff

kres chnget ("resonance");resonance

kg chnget ("gain");gain

kdetune1 chnget ("detuneone")

asig oscili p5, p4, chnget:i("wave");wave selecting oscilator

asigd oscili p5, p4*kdetune1, chnget:i("wave2")

 

asig2 moogladder asig + asigd, kcf, kres; filter with cutoff and res arguments

asig3 gain asig2, kg

  

outs asig3, asig3

 

display asig3, .1, 1 ;display output signal

 

endin

  

</CsInstruments>

<CsScore>

;causes Csound to run for about 7000 years...

f1 0 16384 10 1;sine

f2 0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111;saw

f3 0 16384 10 1 0 0.3 0 0.2 0 0.14 0 .111 ;square

f4 0 16384 10 1 1 1 1 0.7 0.5 0.3 0.1 ;pulse

;-----------------------------------------------------------

f0 z 

 

</CsScore>

</CsoundSynthesizer>

 

Sent from [Mail](https://go.microsoft.com/fwlink/?LinkId=550986) for Windows 10

Trying to find the solution to the multiple oscillator and detune problem my slider widget does not move smoothly it keeps jumping :thinking: thanks

You have four sliders… you need to give me a little more detail here…

Have a look also at oscbank for creating a supersaw oscillator :wink: