I wrote this compile.scd code to create binary files that I want to load using d_loadDir. But I’ve determined by looking at the binary results that it only includes the last synthdef. Do I have to create the .scd I’m compiling differently?
Here’s how I build the binaries:
"Building ".post;
thisProcess.argv.postln;
if(thisProcess.argv.size == 0, { "No file provided.".postln; 1.exit; },
{
try {
r = this.compileFile(thisProcess.argv[0]);
if(r.value == nil,
{ 1.exit; },
{ r.value.writeDefFile("bin"); 0.exit; });
} {
1.exit;
}
});
And then here’s a sample of which the result is a binary that only includes the last synth def, which I created so the resulting name would make sense, rather than using the last synthdef, which I suppose now I understand is why.
SynthDef(\mic, {
arg inBus = 0, level = 1.0, wetBus = 0, dryBus = 33333, mix = 1.0;
var micIn = SoundIn.ar(0);
// this will be our main output
Out.ar(wetBus, micIn * mix * level);
// this will be our effects output
Out.ar(dryBus, micIn * (1 - mix) * level);
});
SynthDef(\speaker, {
arg inBus = 0;
Out.ar([0,1], In.ar(inBus,1));
});
SynthDef(\fader, {
arg inBus = 0, level = 1.0, wetBus = 0;
// Ignoring outBus for now, but could be different outputs
Out.ar(wetBus, In.ar(inBus, 1) * level);
});
SynthDef('gl', {arg v;
s.options.pgaGainLeft = v;
});
SynthDef('dl', {arg v;
s.options.dacLevel = v;
});
SynthDef('test', {
arg level = 0.5, dryBus = 0;
Out.ar(dryBus, SinOsc.ar(1000) * level );
});
SynthDef('l1', {
arg inBus = 0;
// SendTrig.kr(Impulse.kr(5), 11, Amplitude.ar(SoundIn.ar(0), 0.01, 0.55));
SendPeakRMS.ar(SoundIn.ar(0), 20, 1, '/tr', 11);
});
SynthDef('basics', {});
Why does the resulting binary only contain basics rather than all the synthdefs?