It seems to me that combobox with populate does not work properly on Mac OS (10.15.7). Here is the example code: https://drive.google.com/file/d/18MSydroZOG46DE3sOoJLNsG49uGcD3yk/view?usp=sharing (You need to create a directory Mpresets here from https://gitlab.com/RZ-FZJ/rz-cabbage-recipes/-/tree/master/Mpresets or just create it with dummy files as foo.mset, bar.mset…)
When I run this on Mac OS I get in the console:
Csound output message console
/============================================================/
WARNING: could not open library ‘/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libfluidOpcodes.dylib’ (-1)
WARNING: could not open library ‘/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/librtjack.dylib’ (-1)
UnifiedCSD: /Users/zorn/P/Texte/OwnMusic/Cabbage/Cboxtest.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
Creating score
rtaudio: PortAudio module enabled …
using callback interface
opcode changed deprecated
sample rate overrides: esr = 44100.0000, ekr = 1378.1250, ksmps = 3
sorting score …
… done
displays suppressed
0dBFS level = 1.0
orch now loaded
audio buffered in 1024 sample-frame blocks
SECTION 1:
Cabbage version:2.8.0
Filename from Combobox: |0.0|
Filename from Combobox: |Pluck|
Filename from Combobox: |Scratch|
The first item (Filename from Combobox: |0.0|) appears even before I select anything. In the second and third item (after selecting in the GUI) there is only the file base name (without extension and path), i.e. just what is displayed in the GUI. This made my instrument “Morpheus” crash what made me aware of the problem.
If I start the same test code under Windows (10) the result is as expected from the docs:
WARNING: could not open library ‘C:\Program Files\Csound6_x64\plugins64\py.dll’ (-1)
UnifiedCSD: C:\Users\Reiner\Documents\OwnMusic\Cabbage\Cboxtest.csd
STARTING FILE
Creating options
Creating orchestra
closing tag
Creating score
rtaudio: PortAudio module enabled …
using callback interface
opcode changed deprecated
sample rate overrides: esr = 48000.0000, ekr = 1500.0000, ksmps = 32
sorting score …
… done
midi channel 1 using instr 20
…
midi channel 64 using instr 20
displays suppressed
0dBFS level = 1.0
orch now loaded
audio buffered in 4096 sample-frame blocks
SECTION 1:
Cabbage version:2.7.0
Filename from Combobox: |C:/Users/Reiner/Documents/OwnMusic/Cabbage/Mpresets/Pluck.mset|
Filename from Combobox: |C:/Users/Reiner/Documents/OwnMusic/Cabbage/Mpresets/Scratch.mset|
There is nothing sent by the combobox before I choose a file and the filename returned is with full path as expected from the docs.
Is it possible to change the Mac OS code so that it works like on a PC? That would save me from coding some clause in Csound to add the path and extension if it is not included with the combobox value.
PS: I tried to trap this error with a
if (filevalid(SLoad)==1) then
but for some reason filevalid also does not return 1 if the file really exists. Does it check for anything else but existence of a file? What would be the correct way to check for file existence in Cabbage? (Python’s “try” is the most ugly concept in the history of programming languages. But at that point it would be handy.)