[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] Synth Definition Argument Control
On Dec 30, 2005, at 1:02 AM, Esben Stien wrote:
I'm unsure how to control the values of SynthDef arguments when the
synth is not running.
The best technique is to write your control values onto control buses,
then map the synth arguments to the buses each time you create a synth,
e.g.,
~freq = Bus.control(s, 1).set(440);
~amp = Bus.control(s, 1).set(0.2);
Synth("tutorial-sine", [\freq, "c" ++ ~freq.index, \amp, "c" ++
~amp.index]);
GenericGlobalControl in my library offers some neat conveniences:
automatic gui via .gui (with automatic association to a controlspec for
range mapping) (guis are mac only at this time), playing synths onto
the control and a .watch method so that the client-side value stays in
sync, and easier construction of synth args.
// nil means assign me a control bus: you can give a bus number here if
you want
// \freq is a shortcut to the predefined frequency controlspec:
20..20000 mapped exponentially
~freq = GenericGlobalControl(\freq, nil, 440, \freq);
~amp = GenericGlobalControl(\amp, nil, 0.2, \amp);
Synth("tutorial-sine", [\freq, ~freq.asMapArg, \amp, ~amp.asMapArg]);
I intend to bind such arguments to a midi controller.
My lib also has VoicerMIDIController which talks directly to
GenericGlobalControls.
hjh
: H. James Harkins
: jamshark70@xxxxxxxxxxxxxxxxx
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman