Cabbage Logo
Back to Cabbage Site

Comparing Blue and Cabbage

Hi,
i have been (and still am) a Blue user. And i still think that the idea behind Blue suits Csound well.

But i would like to compare Blue and Cabbage/VST to get a good view on what are the advantages of both Blue and Cabbage/VST.
As a DAW i am using Reaper.

I have a quite few questions i would like to have answered before and if i will ‘hop over’.

First one:
how does one deal with not having the option of p6 and above?
Are all these changes as possible with >p6 now taken over by Midi parameters?
For example, how can one change ADSR settings of each individual note?

Silly question: what is Blue?

Hi Menno, I can’t believe this is your first time posted here :rofl: For those not in the know, Menno is a very well-respected member of the Csound community, and one of the chief contributors/maintainers of the Csound reference manual :slight_smile: Thank you for your work over the years, the entire community has benifitted greatly from it :pray:

It’s probably best to answer all of these at once. First off, there is no limit to the number of p-fields. You can pass as many as you like to an instrument. I believe however you’re referring to info coming from the DAW. Basic MIDI note is best sent via p-fields, but all other data is sent over channels. When you create a slide widget in Cabbage, it is accessible in the DAW. Changing the slider in the DAW via MIDI, or host automation will cause the Csound channel to be updated. To update ADSR settings just create 4 sliders, and access their values using chnget. Feel free to pose more questions. I’d be happy for you to try Cabbage out :+1:

Blue is a DAW like Reaper, designed to work with the freedom of all of the Csound options: https://blue.kunstmusik.com/
It allows algorithmic composition and alternative scaling and more.

Development is slow however. The program is far from finished…

So i am looking to synchronize Blue with Reaper/CabbageVSTs to get the best of the 2 worlds. Synchronization works nicely using OSC.

Thanks, Rory, for your kind words! And i won´t argue with them :relaxed:

I have been working with DAWs like Reaper and Cubase for years, before i felt chocked by the limitations of Midi and Midi resolution.
Also, i want total control over the notes. This led me to invest time in Csound and the limitless possibilities where it is easy to drown in.

Regarding the ADSR (as an example): i am used to have the option of different ADSR settings per note, even when more notes are sounding simultaneously. In a Csound Instrument this is a basic thing, but i think Midi changes are Global and works on all notes at that given time.
How to get this flexibility with a VST? Perhaps with more than one copies of the same instrument on different tracks?

This would be tricky to implement in a VST but not impossible. If you want real time control over these parameters from the DAW you’ll need to add parameters for every A D S and R you need. This could get messy. Another approach would be to create just 4 slider, one for each parameter. Then create a 5th slider that will let you select the note to which the current ADSR values will apply to. If you set slider 5 to 60, the current ADSR values will apply to middle C. If you select another note number they will apply to it instead. I’d suggest writing the ADSR values to an array or table so that you can access them on each note’s init pass.

p.s. btw, this only applies to situations where you want to update / change the ADSR values in real time. If you know the unique ADSR values for each note in advance, then you don’t need any sliders at all…

Could you elaborate on the information in your p.s. some more?

If, for example, i have this score:
p1,p2,p3 are clear
p4 = midi pitch
p5 = midi amp
These are the basics for the midi note.

Now the Csound score, with additional
p6 = attack
p7 = release

i1 0 2 80 127 .01 1
i1 1 2 82 127 .1 .5
i1 1.1 2 85 127 .001 1.3

How could this be hardcoded in a VST?
If i create a VST where i could enter a list with p6 and p7 somehow, or perhaps in a script, would that be an option?
Just thinking aloud here…trying to get a grip on things…

It looks like you’re assigning attack and releases based on the MIDI note number. In which case could you not do:

instr 1
iNote = cpsmidinn(p4)
if iNote == 80 then
 iAttack = 0.01
 iRelease = 1
elseif .....
endin 

It would be simpler though to create a table with all the attacks and decays you need, or an array where the note number would be the index.

i am not really thinking about giving specific notes a certain attack and decay.
I think i will do some testing with multiple of the same instrument with the same settings in Reaper- but giving each instrument a different ADSR.
And then some kind of sequencer to address these nearly-identical instruments. Just to see if this works for me. And how this affects the CPU.

Next thing, if you don’t mind, i miss in most of the Midi based instruments, is the limited scaling options in pitch. How to do microtuning?

I do think there is a way to have a Csound instrument load a scala file, and then, lets say, have it play back in a higher resolution like 48 notes in an octave.
I do think this is feasible?

tuning shouldn’t be an issue. you can place the tunings rations into a table, or an array, and then work from there. For example, just intonation,

  • Tonic © : 1/1=1.0001/1 = 1.0001/1=1.000
  • Minor Second (C# / Db) : 16/15=1.06716/15 = 1.06716/15=1.067
  • Major Second (D) : 9/8=1.1259/8 = 1.1259/8=1.125
  • Minor Third (D# / Eb) : 6/5=1.2006/5 = 1.2006/5=1.200
  • Major Third (E) : 5/4=1.2505/4 = 1.2505/4=1.250
  • Perfect Fourth (F) : 4/3=1.3334/3 = 1.3334/3=1.333
  • Tritone (F# / Gb) : 45/32=1.40645/32 = 1.40645/32=1.406
  • Perfect Fifth (G) : 3/2=1.5003/2 = 1.5003/2=1.500
  • Minor Sixth (G# / Ab) : 8/5=1.6008/5 = 1.6008/5=1.600
  • Major Sixth (A) : 5/3=1.6675/3 = 1.6675/3=1.667
  • Minor Seventh (A# / Bb) : 9/5=1.8009/5 = 1.8009/5=1.800
  • Major Seventh (B) : 15/8=1.87515/8 = 1.87515/8=1.875
  • Octave © : 2/1=2.0002/1 = 2.0002/1=2.000

Here’s some untested Csound code that would convert standard MIDI from the DAW to just intonation.

    instr 1
    iJustIntonation[] fullarray 1.000, 1.067, 1.125, 1.200, 1.250, 1.333, 1.406, 1.500, 1.600, 1.667, 1.800, 1.875, 2.000
    iNote = cpsmidinn(p4)
    iIndex = iNote % 12
    iFreq = p4*iJustIntonation[iIndex]
    a1 oscili .8, iFreq
    outs a1, a1
    endin

FWIW, I’m sure there exists a scala plugin that will pitch bend notes to twist them to various tunings. In which case you might only need add the pitch-bend amount to p4?

That looks good!

and then there is cpstmid
an opcode i never used
and there is GEN51
AND if i remember correctly somewhere in my collection of csds i gathered, there was mention of importing Scala data…mmmmm

found this:
TbScala.csd (4.4 KB)

Would be nice to wrap that up into a MIDI plugin. I just did a quick look and there doesn’t seem to be too many (or any?) scala plugins. You could use the filebutton widget to open your scala file and then have it autotune all incoming MIDI notes, before sending them on to a synth. Check the MIDI Arp SImple example in the Misc. examples. It shows you how to process incoming MIDI notes, and output new ones.

I do think the CabbageVST will be able to read Scala files and/or use different tunings in the way you mentioned.

I am still thinking about ways how to get values of >p5 into a CabbageVST. Perhaps Midi 2.0 will provide this option, although the protocol around it is somewhat secretive…
I found this: There’s extended data resolution for all Channel Voice Messages and new Messages for increased per-note expression. System Exclusive messages are bumped up to 8-bit.

And Reaper itself is not Midi2-ready yet…

I do believe a solid sync option between Blue and Reaper/CabbageVST is possible; Reaper has good OSC control options and i have made an Instrument in Blue that controls the position of the cursor in Reaper as it should.

Continuing the comparison of Blue and the world of Cabbage, i have a question regarding plotting data.

I created a Utility in Blue that generates Matrices for use with the Scanned opcodes:


and i am using a Python script for MatLabplot.
Here is the result:
Screenshot from 2024-09-14 13-58-32

I have done the same but for the Trajectory, that reads back the masses in the Matrix. Plotting ls done using MatLabplot.
Is there an equivalent visual option in the CabbageVST? a MatLabPlot option?

It would make a nice introduction to Cabbage for me to port these Utilities over, and get the hang of boiling a Cabbage Stew!

I think you need to change your thinking a little. p5 values can be passed to a Csound instrument in Cabbage either from the score, or from an event/schedule opcode. But I think the bigger issue here is how you expect MIDI to work in a plugins. To simplify things, we can say that plugins don’t get passed any MIDI data, the DAW receives the MIDI data, and then sends parameter updates to the plugins, which in the case of Cabbage are sent to channels. Note events are passed to the plugin, which is why we still use p4 and p5. But control data is all picked up via channels. So no need for MIDI2, everything works as expected, albeit slightly differently to what you are used to.

OSC is definitely an option.

In the current version of Cabbage you can visualise any table data using the gentable widget. You can also display an image from disk. In Cabbage3 you will be able to display these graphs any way you like, even in real time using ploty, d3 or any data visualisation tools you like in JS.

In the process of rethinking, i was able to load in a Scala file of 48 notes in an octave, and running it in Reaper.
It runs when i set the path to the Scala file directly.

ScalaRead.csd (4.2 KB)
48 equal divisions of 2_1.scl.zip (368 Bytes)

Now i am wrestling with the channels, i hope i can get some help.

In order to import the Scala file, using the filebutton:
filebutton bounds( 5, 5, 80, 25), text(“Scala File”,“Scala File”), fontColour(“white”), channel(“ScalaFilename”), shape(“ellipse”)

Is the channel like chnset?

If i try to import the Scala file via the filebutton, i get an error when i use code like this:
gSFile chnget “ScalaFilename”
;giScale TbScala “48 equal divisions of 2_1.scl”
giScale TbScala gSFile

Try something like this. I can’t run it here because I get errors in the UDO code? But I think it might be because I’m using Csound7 locally…

instr 1

    gSFile chnget "ScalaFilename"
    if(filevalid(gSFile)) then
        giScale TbScala gSFile
    else
        giScale TbScala "/media/datae/EigenWerk/eigen_scala/48 equal divisions of 2_1.scl"
    endif
    print p4
    ihz cpstuni p4, giScale
    kenv   madsr   .001, .2, 1, .1
    aOut vco2 p5, ihz
    outs aOut*kenv, aOut*kenv
endin

I am using --Csound version 6.19 (double samples) Sep 2 2024

It needed some scale file to start with
and now i have set that to ¨standard¨ 12TET scale.

Then one can import another Scala file and now all works fine:

instr 1

    SFile chnget "ScalaFilename"
    ir filevalid SFile
    print ir
    if (ir == 1) then
        iScale TbScala SFile
        prints "using the Scala File import, midi key = %d\n", p4
    else
        iScale TbScala "/home/tjingboem/12 equal divisions of 2_1.scl"
        prints "12TET, midi key = %d\n", p4
    endif

 ihz cpstuni p4, iScale
 kenv   madsr   .001, .2, 1, .1
 aOut vco2 p5, ihz
 outs aOut*kenv, aOut*kenv
endin
1 Like

Seems like you have a nice Cabbage stew cooking :slight_smile:

seems i am a fan of slow cooking :upside_down_face:

but i am eager to continue
and catching up with Reaper along the way.

An advantage of working with the Cabbage/Reaper combination is, it is multicore processing.
Java and thus Blue is not.

1 Like