# Tweak Requests

**URL:** <https://forum.cabbageaudio.com/t/tweak-requests/3807>\
**Category:** Cabbage Stew\
**Created:** [5 August 2023 11:32 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807 "2023-08-05T11:32:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![iainmccurdy](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/i/8baadc/32.png) [@iainmccurdy](https://forum.cabbageaudio.com/u/iainmccurdy)\
**Post date:** [5 August 2023 11:32 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/1 "2023-08-05T11:32:55Z")

</div>

A couple of tweak requests:

When editing the code from Cabbage’s built-in examples and saving or restarting the CSD, the edits are not applied because the CSD is stored in the applications folder and therefore cannot be overwritten. The misleading thing is that the changed code remains in the editor and no error or warning is given and this has caught a few students out. Would it be possible to provoke a warning dialogue upon a save attempt that the CSD needs to be saved to a location with user-save privileges?

The second tweak may be trickier. When using `fout` to render audio from Cabbage, the rendered file cannot be opened properly, even when the CSD is stopped. It is necessary to quit Cabbage for the file to be opened with audio contents revealed which is a slight pain. Can anything be done here?  
Students lament the fact that CsoundQt has a built-in mechanism for recording audio. I have a feeling that this feature may have been discussed before in relation to standalone Cabbage.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [5 August 2023 11:40 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/2 "2023-08-05T11:40:50Z")

</div>

> [@iainmccurdy](#):
>
> When editing the code from Cabbage’s built-in examples and saving or restarting the CSD, the edits are not applied because the CSD is stored in the applications folder and therefore cannot be overwritten. The misleading thing is that the changed code remains in the editor and no error or warning is given and this has caught a few students out. Would it be possible to provoke a warning dialogue upon a save attempt that the CSD needs to be saved to a location with user-save privileges?

This should be simple enough to do 👍

> [@iainmccurdy](#):
>
> When using `fout` to render audio from Cabbage, the rendered file cannot be opened properly, even when the CSD is stopped. It is necessary to quit Cabbage for the file to be opened with audio contents revealed which is a slight pain. Can anything be done here?  
> Students lament the fact that CsoundQt has a built-in mechanism for recording audio. I have a feeling that this feature may have been discussed before in relation to standalone Cabbage.

You’re not wrong about this being a little tricker. I’ll take a look. Does using `ficlose` not solve the issue?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [5 August 2023 11:45 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/3 "2023-08-05T11:45:11Z")

</div>

This example lets me open the wav file as soon as it has being written, even though the instrument is still performing? I’m on MacOS…

form size(500, 300), caption("Untitled") nchnls = 2 0dbfs = 1

instr 1  
avco vco2 p5, p4   
outs avco, avco   
fout “/Users/rwalsh/Desktop/test.wav”, 4, avco  
endin

f1 0 1024 10 1 i1 0 5 200 1 f0 z

---

<div class="post-metadata">

**Author:** ![iainmccurdy](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/i/8baadc/32.png) [@iainmccurdy](https://forum.cabbageaudio.com/u/iainmccurdy)\
**Post date:** [5 August 2023 12:26 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/4 "2023-08-05T12:26:06Z")

</div>

My experience is that the file can be opened but contains nothing useful (headerless?) until quitting Cabbage.

`ficlose` needs a handle and therefore will only work with `fiopen` and not `fout`.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [5 August 2023 13:30 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/5 "2023-08-05T13:30:35Z")

</div>

Ok, in my tests the instrument that was doing the recording had finished before I tried the sound file. So it seems that stopping it during recording leaves the file process open somehow. It’s strange because Csound gets destroyed after each run. It is a pain. I’ll investigate when I get a chance. You don’t have class again till September right, I have some time 🤣

---

<div class="post-metadata">

**Author:** ![iainmccurdy](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/i/8baadc/32.png) [@iainmccurdy](https://forum.cabbageaudio.com/u/iainmccurdy)\
**Post date:** [5 August 2023 13:42 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/6 "2023-08-05T13:42:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [5 August 2023 13:43 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/7 "2023-08-05T13:43:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![iainmccurdy](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/i/8baadc/32.png) [@iainmccurdy](https://forum.cabbageaudio.com/u/iainmccurdy)\
**Post date:** [5 August 2023 13:49 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/8 "2023-08-05T13:49:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [5 August 2023 13:51 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/9 "2023-08-05T13:51:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [6 August 2023 10:53 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/10 "2023-08-06T10:53:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [6 August 2023 12:35 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/11 "2023-08-06T12:35:54Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![iainmccurdy](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/i/8baadc/32.png) [@iainmccurdy](https://forum.cabbageaudio.com/u/iainmccurdy)\
**Post date:** [6 August 2023 16:22 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/12 "2023-08-06T16:22:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [6 August 2023 17:37 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/13 "2023-08-06T17:37:09Z")

</div>

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

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. 👍 I’m not sure how well the icon looks but it will do as a placeholder until I can work out something better 🙂

---

<div class="post-metadata">

**Author:** ![iainmccurdy](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/i/8baadc/32.png) [@iainmccurdy](https://forum.cabbageaudio.com/u/iainmccurdy)\
**Post date:** [6 August 2023 17:42 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/14 "2023-08-06T17:42:57Z")

</div>

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

 ![image](https://forum.cabbageaudio.com/uploads/default/original/2X/a/adcc9e3cbe22cd5f44fd4d7a9fd565be95404320.png)  
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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [6 August 2023 17:48 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/15 "2023-08-06T17:48:06Z")

</div>

> [@iainmccurdy](#):
>
> 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 🤣 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 👍

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [15 August 2023 15:12 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/16 "2023-08-15T15:12:42Z")

</div>

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. 👍

---

<div class="post-metadata">

**Author:** ![iainmccurdy](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/i/8baadc/32.png) [@iainmccurdy](https://forum.cabbageaudio.com/u/iainmccurdy)\
**Post date:** [15 August 2023 20:07 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/17 "2023-08-15T20:07:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 August 2023 06:26 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/18 "2023-08-16T06:26:43Z")

</div>

> [@iainmccurdy](#):
>
> Is it supposed to record a file with the same name as the currently focussed .csd and in the same location?

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.

> [@iainmccurdy](#):
>
> 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.

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.

> [@iainmccurdy](#):
>
> Should this setting not go in the ‘Audio and MIDI’ tab?

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. ☹

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

---

<div class="post-metadata">

**Author:** ![iainmccurdy](https://forum.cabbageaudio.com/letter_avatar_proxy/v4/letter/i/8baadc/32.png) [@iainmccurdy](https://forum.cabbageaudio.com/u/iainmccurdy)\
**Post date:** [16 August 2023 07:33 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/19 "2023-08-16T07:33:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 August 2023 10:18 UTC](https://forum.cabbageaudio.com/t/tweak-requests/3807/20 "2023-08-16T10:18:19Z")

</div>

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

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. 😁

[Next page](https://forum.cabbageaudio.com/t/tweak-requests/3807.md?page=2)
