--
//=============================
-> Peter O'Doherty
-> http://www.peterodoherty.net
-> ma...@peterodoherty.net
-> facebook: Peter-ODoherty
//=============================
there might be a few ways to do this.
of course, you can always just create an athenacl generator in Python and send out data via OSC or otherwise. a simple example of instantiating a generator is here:
http://www.flexatone.net/athenaDocs/www/sect-python-generator.htm
full-fledged usage would, like with csound, take advantage of stored instrument models and multi-parameter generation. i developed some of this as a sort of proof of concept a little while ago, but have not extended or developed it fully.
there is a superColliderNative.py orchestra definition in athenacl that produces sc synth-def code; in event list generation, this is paired with a number of timed events. the output is an sc file that contains a synthdef and a Task with defined events.
pi{}ti{} :: emo scn
EventMode mode set to: superColliderNative.
pi{}ti{} :: emi
superColliderNative instruments:
{number,name}
0 noiseBasic
10 electroKick
pi{}ti{} :: tin a 0
TI a created.
pi{auto}ti{a} :: eln
command.py: temporary file: /Volumes/xdisc/_scratch/ath2011.01.17.10.35.27.xml
EventList ath2011.01.17.10.35.27 complete:
/Volumes/xdisc/_scratch/ath2011.01.17.10.35.27.mid
/Volumes/xdisc/_scratch/ath2011.01.17.10.35.27.scd
pi{auto}ti{a} :: elv
EventList view initiated: /Volumes/xdisc/_scratch/ath2011.01.17.10.35.27.scd
the .scd file generated starts out something like this:
( // start main
s = Server.local;
s.boot;
SynthDef("noiseBasic", {
arg sus, amp, pan, attackPercent, releasePercent, cfMidi;
var env, ampEnvl, gate, panPos, sigPrePan;
panPos = (pan*2)-1;
gate = Line.ar(1, 0, sus, doneAction: 2);
env = Env.perc(sus*attackPercent, sus*releasePercent, amp, -4);
ampEnvl = EnvGen.kr(env, gate);
sigPrePan = LPF.ar(WhiteNoise.ar(ampEnvl), cfMidi.midicps);
Out.ar(0, Pan2.ar(sigPrePan, panPos));
}).writeDefFile;
s.sendSynthDef("noiseBasic");
// athenaCL 2.0.0a15
// www.athenacl.org
// Mon Jan 17 10:35:27 2011
// output generator: EngineSuperColliderTask (orchestra: superColliderNative)
t = Task({ // TM(athenaCL.libATH.libTM.LineGroove), TI(a)
s.sendBundle(0,
["/s_new", "noiseBasic", -1, 1, 0,
"sus", 0.09375, "amp", 0.89652820222, "pan", 0.899330552563, "attackPercent", 0.2, "releasePercent", 0.3, "cfMidi", 78.879575839]);
s.sendBundle(0.125,
["/s_new", "noiseBasic", -1, 1, 0,
"sus", 0.1875, "amp", 0.829327819726, "pan", 0.0224665524468, "attackPercent", 0.2, "releasePercent", 0.1, "cfMidi", 119.758221231]);
and ends:
t.start;
) // end main
i hope this gives you some ideas. adding instruments to superColliderNative.py should not be too difficult if the integrated, native approach interests you.
> I have another question. I'm on Linux (Ubuntu) and would quite like to be able to hear the midi file using elh but I get the error:
> Permission denied
> EventList hear failed
some others have had this permission problem on linux. i think the issues is the default place where the file is being written. this can be set with the apdir command:
pi{auto}ti{a} :: apdir x /Volumes/xdisc/_scratch
user fpScratchDir directory set to /Volumes/xdisc/_scratch.
> I suppose athenaCL would really need to know which program to use to for this (Timididy in my case) but how do I set this up as a preference?
exactly. this is the apea, external applications, command, which can be done with a single command:
pi{auto}ti{a} :: apea mp /Applications/QuickTime Player.app
application file path changed:
/Applications/QuickTime Player.app
or interactively:
pi{auto}ti{a} :: apea
enter a file path to set: csoundCommand, midiPlayer, audioPlayer, textReader, imageViewer, or psViewer? (cc, mp, ap, tr, iv, or pv): mp
current application path:
/Applications/QuickTime Player.app
select a midiPlayer application:
name file, change directory, or cancel? (f, cd, c): f
name file? /Applications/QuickTime Player.app
/Applications/QuickTime Player.app
select this file? (y, n, or cancel): 1
application file path changed:
/Applications/QuickTime Player.app