//
SynthDef(\test, { arg out = 0, mul = 0.1;
var freq = q.audioControl(\freq, 2); // you have to know in
advance that this is audio rate.
Out.ar(out, SinOsc.ar(freq, 0, mul))
}).send(s);
SynthDef(\ctl, { arg out = 0, freq=30, mul=200, add=300;
Out.ar(out, LFSaw.ar(freq, 0, mul))
}).send(s);
a = Synth.new(\test, [\freq, 440]);
b = Synth.new(\ctl, [\freq, 10, \mul, 440 * 4, \out, 10]);
// set the freq input to the audio bus 10
// this is a made up syntax, just to illustrate what I though the idea was
q.mapAudio(a, \freq, 10);
all that is needed is a reinterpretation of \map as \set, and a
different UGen (In.ar). We don't need to change the bus system, I
think. All we need is an ar type control that maps onto an In.ar
(possible FeddbackIn.ar) and a different map message.
// a sketch
Node {
mapAr { |key, bus, pairs... |
this.set(key, bus, *pairs)
}
}
Control {
*ar { |values|
var ctl = this.kr(1);
In.ar(ctl, values.size) // here we miss the default values.
}
}
Hmm... except, this doesn't really solve the problem (at least in
my mind). What I thought of in relation to this when we talked
about it sometime ago was that something like this would work:
SynthDef(\test, {arg out = 0, freq, mul = 0.1;
Out.ar(out, SinOsc.ar(freq, 0, mul))
}).send(s);
a = Synth.new(\test, [\freq, 440]);
b = Synth.new(\test, [\freq, 200, \mul, 440 * 4, \out, 10]);
// set the freq input to the audio bus 10
// this is a made up syntax, just to illustrate what I though the idea was
a.mapToAudio(\freq, 10);
Is this what you meant Andrea? I started thinking about how to do
this some time ago, and came up with a few ideas...
1) make all Busses part of the same structure (no audio or control per se).
2) Make the first portion (let's say, busses 0 -127) audio,
therefore arrays (pointers) of s.options.blockSize
3) make the rest (let's say 128 - 4096) single values (just like
the current control busses)
... here is where I don't know how to solve the problem ...
4) Make Control a UGen that outputs its rate (based on bus number)
and either the audio signal OR a scaler.
5) 4 (above) causes problems - another possible idea is to make
Control always output blockSize samples, either as its audio
output, or as linearly interpolated control data (doing the work
that the input UGen would be doing otherwise - other UGens then see
all Control UGens as audio data - which is a problem as well).
Control.names gets iffy.
6) Maybe make all args to a SynthDef a special kind of Control
(.ar?) that behaves as above, but you can still create
Control.names.kr UGens in the SynthDef by hand?
7) OR - make the default control be as it is now, but the user can
specify a rate in the rates part of the SynthDef, making the above:
SynthDef(\test, {arg out = 0, freq, mul = 0.1;
Out.ar(out, SinOsc.ar(freq, 0, mul))
}, [nil, \ar, nil]).send(s);
Now - freq is a Control that takes care of things as described in
option 5 above, while the others are just the normal Controls that
a SynthDef wraps all args in.
I believe changes in Bus would prevent code breakage with the
renumbered bus approach. The only code I can really see breaking is
hard coded control and audio bus ids (since there would no longer
be things like control bus '0')... or maybe that step isn't
necessary? Though I don't see any other way for the Control.ar
method to know whether a bus is audio or control (other then doing
a < check on the id).
Ideas?
Josh
On Dec 17, 2008, at 10:03 AM, Julian Rohrhuber wrote:
Just to know and to bring some ideas from a user pov:
- What about mapping audio buses as synth controls for 3.3?
<http://sourceforge.net/tracker/index.php?func=detail&aid=1991641&group_id=54622&atid=474251>http://sourceforge.net/tracker/index.php?func=detail&aid=1991641&group_id=54622&atid=474251
here is a solution, a bit of a hack, but works as long as there is
no change in the synthDef format.
(
q = ();
q.audioBusses = Bus.control(s, s.options.numAudioBusChannels);
q.audioBusses.setn((0..s.options.numAudioBusChannels-1));
q.mapAudio = { |q, node, key, bus|
node.set(key, bus);
};
q.audioControl = { |q, key, numChannels|
In.ar(Control.names(key).kr(0), numChannels)
};
)
(
a = {
SinOsc.ar(q.audioControl(\freq, 2)) * 0.1
}.play;
b = { Out.ar(62, LFNoise2.ar(1.dup).exprange(800, 1700)) }.play;
);
q.mapAudio(a, \freq, 62);
I'll see if I can implement it in JITLib, so that it can be used easily.
--
.
_______________________________________________
sc-dev mailing list
info (subscription, etc.):
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/
******************************************
/* Joshua D. Parmenter
http://www.realizedsound.net/josh/
"Every composer - at all times and in all cases - gives his own
interpretation of how modern society is structured: whether
actively or passively, consciously or unconsciously, he makes
choices in this regard. He may be conservative or he may subject
himself to continual renewal; or he may strive for a revolutionary,
historical or social palingenesis." - Luigi Nono
*/
_______________________________________________
sc-dev mailing list
info (subscription, etc.):
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/
--
.
_______________________________________________
sc-dev mailing list
info (subscription, etc.):
http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/