Cabbage Logo
Back to Cabbage Site

Tweak Requests

I was showing my two-line method for capturing audio in Cabbage using monitor and fout to the student and they complained: “I have to write all that code? In CsoundQt I just have to hit a button”. Victor teaches just using CsoundQt (perhaps you should have a word) so by the time they reach me I have to convince them of the benefits of Cabbage. To be honest, quitting Cabbage each time is not a big deal, it’s just a mild embarrassment for demos.

How does it go in CsoundQT? You hit record, and the csd plays whilst CsoundQT records the output to a file, do you need to name the file first, or is it just some generic name?

It’s an alternative to hitting play (it activates the play/perform button at the same time) so it just captures the audio from the entire performance and puts it into a sound file with the same name as the CSD with “-000” appended, incrementing each time another recording with the same CSD is made. The sound file is placed in the same directory as the CSD. The sound file is accessible while CsoundQt is still playing the CSD so I guess it is periodically overwriting the file with a header.

Thanks Iain. I can look into doing this. It’s a little more complex here because I have to capture the output of the entire graph rather than one .csd - but I’ll take a look.

I’ve fixed the issue of fout not writing until Cabbage is closed. I’m also looking into a simple realtime render to disk ala CsoundQT. I’ll let you know when I’ve pushed the changes.

I just pushed a new way to record to the develop branch. Simply hit the ‘rec’ button on the file tab and Cabbage will record the output of that instrument to a file with the same name as the .csd file. Note subsequent runs will overwrite the previous output file. I can change this in the future, but I’m running out of time here today…

That’s amazing, Rory.

The fout thing works from my side too.

The ‘rec’ feature works as described. It creates a mono, 16-bit sound file. Could the channel count reflect nchnls? Also, could the bit depth be selected in Cabbage Settings? 32-bit float would be great option to include as clipped audio could then be rescued.

I’m amazed you were able to implement this so quickly. It will be very useful for many users. I sometimes encourage student to request features they think are missing but I suspect they think that Cabbage Inc. is a huge, faceless corporation that won’t listen to them.

Thanks for testing this Iain. All the elves here at Cabbage Inc. worked tirelessly to implement it :rofl:

The output should match the nchnls, I didn’t even test it to be honest. I must have gone awry somewhere.
Adding a bit-depth setting is a good idea. I will take a look when I get a chance. Probably won’t be till later in the week. :+1: I’m not sure how well the icon looks but it will do as a placeholder until I can work out something better :slight_smile:

It’s fine as a placeholder but it is an oval and if the file name is long, it gets hidden:


Is there any reason why some of these tab buttons can’t be on the main toolbar? If pressed they can then be applied to the CSD tab that is in focus.

That sounds like way too obvious a solution :rofl: I will take a look. Having them as children of the tab makes it easy to keep track of them. But the rec button could definitely be there. Good shout. And I could probably work in a nicer logo too :+1:

1 Like

I just pushed some updates on this. I moved the record button to the main tool bar, and added a bit-depth setting. It’s 32 by default. I also sorted the channels issue. :+1:

I’m not having much luck with this. Is it supposed to record a file with the same name as the currently focussed .csd and in the same location?
I found the bit depth setting, there are both floating-point and fixed-point 32 bit formats so I imagine that this will have to be set using a drop-down list. Should this setting not go in the ‘Audio and MIDI’ tab?

Yes, so long as you have write access to that directory, so for me here it won’t work when I try to record one of the examples, I need to first save it to a location I have access to. But apart from that, it seems to work fine for me.

With JUCE we can only set the bit depth in ints. So I think it’s Ok to have a text box? Although anything under 8 is not supported it seems.

Probably, but that will involve more work as that Audio/MIDI settings window is a JUCE component in itself, so I’d need to hack it in order to add an extra field. :frowning:

p.s. I could add a recording output directory to the settings either so that all recordings end up in the same place?

Okay, got it now. I have to press REC first and then play on the CSD. Stopping record doesn’t stop the recording, even if the button deactivates, only stopping the CSD does. This is all fit for purpose, just aspects of the procedure weren’t entirely intuitive for a dunce like me.

How about this:
Pressing REC, REC blinks continuously until a CSD is played when it goes solid red. Pressing REC again while the CSD is still playing does nothing. Only stopping the CSD deactivates REC once recording has begun. Have I just made your life a nightmare?

Selecting an output folder could be a useful but this could be a tickable option with the default being the same directory as the CSD.

1 Like

My life is a constant nightmare, don’t worry about it :rofl:

Blinking and flashing all sound great but I’m not sure how easy it will be to achieve it. So we might have to think about a solid colour scheme, but I’ll take a look and let you know. :grin:

The output sound files seem to actually be 32-bit float. So that’s nice.

That’s good to know :+1: I just pushed another change here. You press arm for record, it turns red. You hit play on an instrument and the arm for record button is disabled, turning a slightly darker red. In this state it cannot be interacted with. When the user stops a performance, the recording will stop, and the button will return to it normal state, waiting to be armed for the next recording.

I could probably add some flashing colours, but should it not be blinking when it’s recording? Or maybe this does the trick. I will leave out the optional default directory output thing for now, it’s probably easier to simply place each file in the same dir as the csd file.

Finally, the output file now contains the date and time of recording. For example, something like this:
ringmod_20230817_143308.wav where year month date are followed by hour minute seconds. This way there is no chance of overwriting a previous recording by accident.

Let me know what you think.

Date stamping is nice safety improvement. The other new features are a help to intuitive use too.

The norm is for flashing red to indicate record ready/pause and for solid red to indicate actually recording.

By the way, the student who originally requested this passes on her gratitude.

Then I fear it must be implemented… :writing_hand:

Try the next build when it’s ready. You may want to stress test this; it’s definitely flashing though… :wink: