Cabbage Logo
Back to Cabbage Site

Are Single Sample Z-1 Custom Filters Possible?

I just re-discovered Cabbage last week and in general have been very impressed with both Cabbage and the sound quality of Csound.

I have been doing R&D toward the end of deciding on a platform to implement my DSP / app / plugin ideas in a way that will facilitate portability to Unity as well as cross platform VSTs and apps for iOS and ideally allow even the potential of hardware-embedded linux/ARM as my main synthesizer product releases thus far have been hardware modules based on ARM cortex m3 and SpinFX FV-1 DSP chip which uses its own Assembly language/opcodes .

In my explorations thus far my current group of potential candidates I have been evaluating are MAX’s Gen~, FAUST, PureData>Heavy/LibPD, and now the last one I want to evaluate that I am finding particularly enticing at the moment is Cabbage/Csound.

I already know that FAUST allows single sample feedback with the ~ operator, and in general is a really interesting and portable language that offers the ability to generate assets for many different platforms, including Csound. Apparently there is even a csound opcode for faust that uses the llvm jit compiler I think, which I am just finding at this moment in my web search : http://www.csounds.com/manual/html/faustgen.html

What I wanted to ensure is that I have the capability to do single sample processing in detail for custom zero delay feedback / nonlinearities and more analogue style filters and distortion.

Is this faust Csound opcode available in Cabbage? or does Csound have the ability to work down to that level by itself? maybe with the framebuffer opcode?

I am also seeing these opcodes in the Whats New in Csound 6.11.0 doc at https://csound.com/docs/manual/PrefaceWhatsNew.html :
zero delay filters – zdf_1pole_mode, zdf_2pole_mode, zdf_ladder, zdf_1pole and zdf_2pole, diode_ladder, K35_hpf and K35_lpf.

Also, is it possible to generate C/C++ code from a Csound file as I can with Heavy/PD, Gen~, and FAUST?
Is the reverse possible as well, adding custom opcodes?

In my initial impressions of the structure of the Csound language, it reminds me a bit of the FV-1 DSP chip that I did a ton of work on for a couple years, I love the minimalism and bare-metal single sample approach in their assembly language, you have opcodes in there for example RDAX - read data at address x, WRAX - write data address, and built in sin/cosine LFOs and ramp generators, as well as circulating delay memory pointers and allpass filters/lowpass/ highpass etc. And with just this handfull of direct opcodes that use the chips hardware I was able to create everything from reverbs to physical models and even granulation/scrubbing : https://www.instagram.com/p/BNf9BNIAS4j/

One thing I really liked about the FV-1 language was the linear nature, you can jump forward to a block and skip over parts, but never jump back, and within its limit of 128 ops per sample, each operation is acting on the result of the previous value left in the accumulator. This makes it very easy to act low level as possible.

basically, I know DSP and several ways to implement, I want to see if Csound is capable of some of the things I want to do low level, and if Cabbage is likewise able to access these currently.

There is a faust interface for Csound, but Csound can of course operate at that level. There is the delay1 opcode, but for even more control you can set ksmps to 1, or better still, create a UDO and set a local ksmps value there so the rest of the orchestra still runs at a higher ksmps rate.

Some of those are really nice filters. I’ve only played with them a little but they’re a great addition.

There is an API for adding and writing new opcodes. You don’t need to build Csound yourself in order to build opcodes for it. Csound is written entirely in C, but there is a nice C++ interface for building plugins.

Not really. But the source is open so you can go and learn from there. There is also Paul Batchelor’s SoundPipe library that borrows heavily from Csound. He presents a lot of the algorithms in what I consider to be a far more accessible manner.

I don’t see any limitations with Csound in this regard. It’s the toolkit of choice for those wanting total control over their sounds :wink:

1 Like

Awesome :smiley:
I had found the delay1 opcode just after posting, and that looks potentially useful

SoundPipe is awesome, I had heard of it once before from my friend/collaborator Taylor, He created Audulus which I worked on a bit. thank you for reminding me about it. I like C alot, possibly more than C++ in some ways. I feel like newer C++ updates are starting to make it even more complicated in some respects.

Watching some of your tutorials on your site now. I like them so far. I also am liking your documentation, What did you use for all these awesome little animated GIF screen captures?

Side question, I remember when I checked out Cabbage a few years ago there was a Cabbage Studio that was a bit like a daw, does that still exist? http://cabbageaudio.com/docs/cabbage_studio/

I think most of the functionality that made Cabbage Studio unique is now built-in to Cabbage2. Under the “View” menu, look for “Cabbage Patcher”.

http://cabbageaudio.com/docs/audio_graph/

I use bynanz for all my gif needs :wink: