Cabbage Logo
Back to Cabbage Site

Help! Generating a combobox with information from fluidLoad

Hello, this is my first time posting in this forum :slight_smile:

I am working on a .sf2-player for a friend. I am building it in Cabbage using Csound’s fluidSynth-opcodes. I have currently found a way to select different presets and banks, but this is where my limited experience with both csound and cabbage stops me…

At this moment, I only use a rotary slider to select the different presets from the .sf2-files. This means that there is no way for the user to know what sound is currently selected, and what number the sound he might want is.

The only solution i see to this is that the opcode fluidLoad can output exactly this information. The issue is that it is only output to the terminal. My question then is if there is any way to access this information?

The manual says fluidLoad outputs information about the soundfont in this format:

SoundFont: 1 Bank: 0 Preset: 0 Seagul Acoustic Git

I feel like if it is possible to grab this information in any way, it should not be too difficult to generate a combobox to let the user select the sounds he wants, instead of guessing. Is this even possible in Cabbage?

Thanks on beforehand for reading this, and if anyone could help, I would be really really grateful.

Børge

Here is my project file and my examplse .sf2 if anyone wants to look into it.

Børge

sf2player.csd (1.2 KB)
mcsf2.sf2 (1.9 MB)

I don’t think there is a way to access this information in Csound. I don’t see much information being passed to the console from fluidLoad either? All I get is:

Created fluidEngine 0x000001858A134BD0 with sampling rate = 44100.000000, chorus on, reverb on, channels 256, voices 4096.
Loading SoundFont : mcsf2.sf2.
fluidSynth: 0x000001858A134BD0  soundFontId: 1. 

Do you get more information than this? I could potentially write a fluidInfo opcode that would send the information to a string, but I would need to know that the information is available on some level first.

Oh! I see it does not actually get printed to the terminal in Cabbage. I did some testing now and I see that it does get printed if I remove the -m0d flag in the CsOptions for some reason! But I guess that means the information is available. It would be really kind if you could take your time to make that!

I can have a look during the week. It might be useful for others too.

1 Like

Great! Thank you very much rory :slight_smile:

Also, I have another quick question if you don’t mind. Is there a way to drag an drop files into the VST window in order to load their file path into the program?

You can drag and drop files onto a soundfiler widget as far as I recall, but there is no generic way to do this. I will take a look. I’m thinking that a reserved channel could be used that would hold the name of the last files to be dropped onto the plugin window?

I’ve added this now. I’ll just want to test on OSX first.

1 Like

This sounds very useful, thank you very much!

I just checked on Windows and some of the back slashes ('s) are not being passed through. I’ll need to fix this. It might be a day or two before I get around to fixing it. It’s a nice feature, I’m glad you mentioned it. Could be very nice for all sorts of things.

@boergelu I wrote that opcode for you, and made a pull request to the Csound developers. It should be in the next release.

Nice, thank you very much!! I’ll keep my eyes out for the next release.