gogins / csound-ac

A C++ library for algorithmic composition, designed to be used with Csound, with both C++ and Python interfaces.
GNU Lesser General Public License v2.1
5 stars 0 forks source link

Test embedding soundfonts in .csd #27

Closed gogins closed 2 months ago

gogins commented 4 months ago

In theory, embedding a Base64 encoded file in the .csd will automatically be saved to the runtime directory, which for CsoundAudioNode would be the sandbox's filesystem, and the sf opcodes should then be able to read that file.

gogins commented 2 months ago

csb64enc doesn't exist on my MacBook. The base64 utility does:

base64 -i 01hpschd.sf2 -b72 -o 01hpschd.txt
gogins commented 2 months ago

This definitely does work!

A big SoundFont would be a huge amount of text. It is awkward to combine the parts, possibly the makecsd utility can do it. But of course, makecsd does not exist on my MacBook.

I can write a Python utility to do the job, e.g.

python3 add2csd.py existing.csd midi_score.mid sample1.wav sample2.ogg soundfont1.sf2 soundfont2.sf2