[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Score issue (FAILURE s_new SynthDef not found)



Hi Josh,

> Hmm... in your startup.rtf file, do you set the SynthDef directory to
> anything other then the default?

no, I havn't yet played with that file.

>  If you don't, can you post the SynthDef code itself so I can test it?

here it is below, it reads form a 4 channel file (1st order ambisonic,
but I guess you dont need that to test).

Etienne.

Server.default = Server.internal;
s = Server.default;
s.options.sampleRate = 48000.0;
s.options.device="JackRouter";
s.boot;

// organise some file buffers to read from.
(
var file;
file = "some1stOrderAmbisonicFile.amb";
w = Buffer.readChannel(s, file,  channels: [0]);
x = Buffer.readChannel(s, file,  channels: [1]);
y = Buffer.readChannel(s, file,  channels: [2]);
z = Buffer.readChannel(s, file,  channels: [3]);
)

(
// sizeFactor is like an overlap thing ... where 1 is no overlap, 5
would mean that 5 grains overlap sequentially.
SynthDef(\ambisonic_grain, {arg w, x, y, z, triggerEvery = 4,
lengthToTriggerFactor = 12, randomPositionSpread = 24,
randomDurationSpread = 0, windowbuf = -1;

       var triggerFrequency = 1000 / triggerEvery; // triggerEvery is in msec
       var soundFileLength = BufDur.kr(w) * 1000; // in sec
       var msecConversionFactor = 1 / soundFileLength ; // used to
convert a msec value to 0 - 1 value
       var duration = triggerEvery / 1000 * lengthToTriggerFactor;
       var positionAddition = TRand.kr(0, msecConversionFactor *
randomPositionSpread, Impulse.kr(triggerFrequency)) ;
       var pos = MouseX.kr(0, 1) + positionAddition;
       var playBackrate = 1;

       Out.ar(0,
               GrainBuf.ar(1,  // number of channels
                               Impulse.ar( triggerFrequency ), //
trigger (sample accurate)
                               [duration, duration / 2, duration * 2,
duration / 4],       // duration (size of grain in seconds) 100msec
                               [w, x, y, z], // the audio buffer use
Buffer.readChannel for multichannel sound
                               playBackrate,  // playback rate
                               pos, // position in file 0 to 1
                               1,      // interpolation ( 2 is linear,
1 is none)
                               0, // pan left or right
                               windowbuf) // the window to use.
                               * 0.2) //instead of env
       }).load(s);

)

// works
g = Synth(\ambisonic_grain, [\w, w, \x, x, \y, y, \z, z,\triggerEvery,
4, \lengthToTriggerFactor, 12, \randomPositionSpread, 24,
\randomDurationSpread, 0]);

// works
s.sendSynthDef(\ambisonic_grain);
s.sendMsg(\s_new, \ambisonic_grain, s.nextNodeID, 1, 1,\w, w, \x, x,
\y, y, \z, z,\triggerEvery, 4, \lengthToTriggerFactor, 12,
\randomPositionSpread, 24, \randomDurationSpread, 0 );

// doesn't work
(
var f, g;
TempoClock.default.tempo = 1;
g = [
	[0.0, [ \s_new, \ambisonic_grain, s.nextNodeID, 1, 1, \w, w, \x, x,
\y, y, \z, z,\triggerEvery, 4, \lengthToTriggerFactor, 12,
\randomPositionSpread, 24, \randomDurationSpread, 0]],
	[2.0, [\c_set, 0, 0]] // finish
	];
f = File("score-test","w");
f.write(g.asCompileString);
f.close;
)

h = Score.newFromFile("score-test");
h.play(s);

// a synthdef browswer
(
SynthDescLib.global.read;
SynthDescLib.global.browse;
)

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/