Cabbage Logo
Back to Cabbage Site

Spectral Delay

Hey all,

Just wanted to invite those in the Csound/Cabbage community to check out this spectral delay instrument I created - inspired by the Native Instruments classic. It’s in pretty rough UI form right now - but perfectly functional. Thoughts and suggestions welcome!

Quick video walkthrough:

3 Likes

This sounds beautiful Micah! Thanks for sharing.

1 Like

Really great - exactly the sort of sound processing that I got into Csound for.

This is great. All of your Csound-based, Cabbage-built, plugins are AWESOME. This one is even more special. Thanks so much for all the inspiration.

Thanks Dr B!

Very cool plug-in. Is it basically X bandpass filters, each with a delay assigned to it?

(I know it is an old thread!)

It sounds awesome, congrats @chronopolis !

I’d be curious to know as well, but I suspect it uses the pvs opcodes, not bp filters.
[https://csound.com/docs/manual/SpectralRealTime.html]
[https://flossmanual.csound.com/sound-modification/fourier-analysis-spectral-processing]
Here’s a really simple example. I imagine if this type of idea was set up with arrays/tables & loops it could work:

<CsoundSynthesizer>
<CsOptions>
-odac
; -o 0_spectral_delay.wav
</CsOptions>
<CsInstruments>

sr = 48000
ksmps = 32
nchnls = 2
0dbfs  = 1

iSaw  = ftgen(0, 0, 1024, -7, 1, 1024, -1)
giSaw = ftgen(0, 0, 1024, 30, iSaw, 1, 30)

instr trig
  iArr[]  fillarray 45, 47, 49, 52, 56, 57, 59
  kTrig = metro(1)
  kNote = iArr[int(trandom:k(kTrig, 0, 6.999))]
  schedkwhen(kTrig, 0, 0, 1, 0, 5, kNote)
endin

instr 1
  aEnv  = expon:a(.7, .4, .001)
  aSaw  = poscil(aEnv, mtof:i(p4), giSaw)
  fSig  = pvsanal(aSaw, 128, 128/4, 128, 1)
  kBin1 = 7
  kBin2 = 4
  kAmp1, kFrq1 pvsbin fSig, kBin1
  kAmp2, kFrq2 pvsbin fSig, kBin2
  aL    = poscil3(kAmp1 * 4, kFrq1)
  aR    = poscil3(kAmp2 * 4, kFrq2)
  aDelL   init 0
  aDelR   init 0
  iFdbk = .7
  aDelL = delay(aL + aDelL * iFdbk, .360)
  aDelR = delay(aR + aDelR * iFdbk, .490)
  outs aSaw + aDelL, aSaw + aDelR
endin 

</CsInstruments>
<CsScore>
i"trig"  0  16
</CsScore>
</CsoundSynthesizer>

The one issue here is reading the bins directly creates alot of noise from adjoining bins. If you instead use pvsarp you can independently amplify a bin while attenuating the surrounding ones.

instr 1
  aEnv  = expon:a(.7, .4, .001)
  aSig  = poscil(aEnv, mtof:i(p4), giSaw)
; pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape
  fSig  = pvsanal(aSig, 128, 128/4, 128, 1)
  kBin1 = 1/64 * 7
  kBin2 = 1/64 * 4
  fSig1   pvsarp fSig, kBin1, 1, 5
  fSig2   pvsarp fSig, kBin2, 1, 5
  aL      pvsynth fSig1
  aR      pvsynth fSig2
  aDelL   init 0
  aDelR   init 0
  iFdbk = .7
  aDelL = delay(aL + aDelL * iFdbk, .360)
  aDelR = delay(aR + aDelR * iFdbk, .490)
  outs aSig + aDelL, aSig + aDelR
endin 

You can hear & see a pretty audible difference.

Likely there are a few different ways one might implement this idea, probably more efficient than this.

I think this the GitHub for the project: https://github.com/micah-frank-studio/Lore/blob/main/GenerativeDevices/SpectralDelay/spectralDelay.csd

1 Like

Here’s the GitHub for it

Not sure if it works with the lastest cabbage though so it might need some modification.

1 Like

I’m curious, what are you using to visualize the audio? Thanks :slight_smile:

It’s just Cabbage’s built-in Spectrogram
https://cabbageaudio.com/docs/signaldisplay/

I ended support and development for it just because it was too bloated. In a was kind of an experiment for me to test the limits of Csound and Cabbage but the customer support for it became too much. The product page still lives here: https://puremagnetik.com/products/lore-experimental-sound-console

I do plan to break the spectral part out into its own device though as it works quite well

1 Like

Hi Nymano, it’s an Android app:

@chronopolis thanks for sharing!

We’re going a little off-topic here, but I can’t believe how much mileage @ST_Music gets from Csound on Android. Are you still using only Android for all your Csound needs?

Actually I just got an older Macbook so really looking forward to diving into using Cabbage on that. Never had a Mac before, only PC, so still figuring out how to navigate the OS. But Cabbage installed and seems to be running ok
:crossed_fingers::joy:

1 Like

If you got this far on your Csound journey with a phone, I’m really excited to see what you can up with a Macbook! :slight_smile: