Discussion:
SuperCollider Volume Control?
Andrew Grathwohl
2007-12-11 17:16:56 UTC
Permalink
Hi list,

Could anybody direct me to an example of how to program a GUI
interface which can control the level output from SuperCollider?

Thanks,
-Andrew
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
Alternate Email: andrew-tobjiWpysdOCnqJtzz8Ru1aTQe2KTcn/@public.gmane.org
IU Email: andgrath-***@public.gmane.org
AIM: Gwohl1
Josh Parmenter
2007-12-11 17:29:26 UTC
Permalink
If you have my library from sc3-plugins (JoshLib), there is global
control involved with the ProcEvents class and GUI. I usually have a
SynthDef with a ReplaceOut running at the VERY tail of all processing,
and this SynthDef has an amplitude control for an arg. The GUI slider
then writes it's values to the node where that synth is running.

Another possibility is to write values from a GUI to a control bus,
and have nodes reading that control bus. This isn't quite as nice
though, since every synth has to have access to this data. The first
idea above doesn't require your other synths to change... you just add
a synth at the tail of 0 that scales the sound for you.

You can get the library I mentioned here:

http://sourceforge.net/projects/sc3-plugins/

Hope that helps.

Josh
Post by Andrew Grathwohl
Hi list,
Could anybody direct me to an example of how to program a GUI
interface which can control the level output from SuperCollider?
Thanks,
-Andrew
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
AIM: Gwohl1
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
Andrew Grathwohl
2007-12-11 17:53:29 UTC
Permalink
Hi Josh,

Thanks much for the quick and thoughtful response!

Unfortunately, I'm an extreme uber newbie when it comes to
SuperCollider, and while I'm pretty sure I understand what you're
talking about, I simply have no idea how this concept is implemented
into a SynthDef. A lot of times, SuperCollider is used as an
improvisation tool, so all of the work I do is usually coded on the
spot (and many of my sounds produced are not SynthDefs).

Is there no way to control simply the entire application's output
levels, instead of having to assign a slider to every synth?

I apologize greatly if my ignorance on this subject is frustrating. I
really appreciate the help.

Thanks, -
-Andrew
Post by Josh Parmenter
If you have my library from sc3-plugins (JoshLib), there is global
control involved with the ProcEvents class and GUI. I usually have a
SynthDef with a ReplaceOut running at the VERY tail of all processing,
and this SynthDef has an amplitude control for an arg. The GUI slider
then writes it's values to the node where that synth is running.
Another possibility is to write values from a GUI to a control bus,
and have nodes reading that control bus. This isn't quite as nice
though, since every synth has to have access to this data. The first
idea above doesn't require your other synths to change... you just add
a synth at the tail of 0 that scales the sound for you.
http://sourceforge.net/projects/sc3-plugins/
Hope that helps.
Josh
Post by Andrew Grathwohl
Hi list,
Could anybody direct me to an example of how to program a GUI
interface which can control the level output from SuperCollider?
Thanks,
-Andrew
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
AIM: Gwohl1
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
Alternate Email: andrew-tobjiWpysdOCnqJtzz8Ru1aTQe2KTcn/@public.gmane.org
IU Email: andgrath-***@public.gmane.org
AIM: Gwohl1
Josh Parmenter
2007-12-11 18:08:19 UTC
Permalink
Here is a quick example that works ... you would need to probably make
it more elegant to suit your needs, but perhaps it will get you started:

// the SynthDef that will control amplitude
SynthDef(\amp, {arg inbus, amp = 1;
ReplaceOut.ar(inbus, In.ar(inbus, 2) * amp);
}).load(s);

// start the global control
a = Synth(\amp, target: 0, addAction: \addToTail);

// make the window and slider
w = GUI.window.new("Volume", Rect(100, 100, 100, 300)).front;
GUI.slider.new(w, Rect(10, 10, 80, 280))
.value_(1)
.action_({arg slider;
// when the slider moves, change the 'amp' parameter of a
a.set([\amp, slider.value]);
});

// start some synths. These go out to bus 0... the Synth a is running
at the tail of group 0, so
// it catches all the output

z = 100.do({
{SinOsc.ar(440.rrand(880), 0, 0.001)}.play
});

// notice in the tree that 'amp' is running last... this is why this
works
s.queryAllNodes

// stop everything
s.freeAll;

best,

Josh
Post by Andrew Grathwohl
Hi Josh,
Thanks much for the quick and thoughtful response!
Unfortunately, I'm an extreme uber newbie when it comes to
SuperCollider, and while I'm pretty sure I understand what you're
talking about, I simply have no idea how this concept is implemented
into a SynthDef. A lot of times, SuperCollider is used as an
improvisation tool, so all of the work I do is usually coded on the
spot (and many of my sounds produced are not SynthDefs).
Is there no way to control simply the entire application's output
levels, instead of having to assign a slider to every synth?
I apologize greatly if my ignorance on this subject is frustrating. I
really appreciate the help.
Thanks, -
-Andrew
Post by Josh Parmenter
If you have my library from sc3-plugins (JoshLib), there is global
control involved with the ProcEvents class and GUI. I usually have a
SynthDef with a ReplaceOut running at the VERY tail of all
processing,
and this SynthDef has an amplitude control for an arg. The GUI slider
then writes it's values to the node where that synth is running.
Another possibility is to write values from a GUI to a control bus,
and have nodes reading that control bus. This isn't quite as nice
though, since every synth has to have access to this data. The first
idea above doesn't require your other synths to change... you just add
a synth at the tail of 0 that scales the sound for you.
http://sourceforge.net/projects/sc3-plugins/
Hope that helps.
Josh
Post by Andrew Grathwohl
Hi list,
Could anybody direct me to an example of how to program a GUI
interface which can control the level output from SuperCollider?
Thanks,
-Andrew
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
AIM: Gwohl1
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
AIM: Gwohl1
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
Andrea Valle
2007-12-11 23:34:38 UTC
Permalink
Josh,

I was going to write exactly a little utility class with the proposed
mechanism, so I used yours (thanks!).
Now, I have to pass the constructor a server, I was thinking I could
refer to Server.default inside the class (i.e. without passing a
server), but doesn't work in this way.
What am I missing?

Best

-a-



// Utility class for a simple general volume
// andrea after Josh

/*
// a sound
{SinOsc.ar(mul:0.1)}.play

v = Volume.new(s) ;
v.gui ;
v.volume_(0.5) ;
v.volume ;

*/

Volume {

var server, amp, <>window, <volume ;
var slider, box ;


*new { arg server ;
^super.new.initVolume(server) ;
}

initVolume { arg aServer ;
server = aServer ;
if ( server.serverRunning.not, { server.boot }) ;
//server = Server.default.boot ;
server.doWhenBooted({
this.sendDef ;
}) ;
volume = 1 ;
}

sendDef {
SynthDef(\amp, { arg inbus, amp = 1;
ReplaceOut.ar( inbus, In.ar(inbus, 2) * amp );
}).send(server);
amp = Synth(\amp, target: 0, addAction: \addToTail) ;
}

// cleaner with MVC
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume]) ;
box.value_(aVolume) ;
slider.value_(aVolume) ;
}

gui {
window = GUI.window.new("Volume", Rect(100, 100, 60, 320)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
box.value_(volume) ;
}) ;
box.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
slider.value_(volume)
}) ;

}

}
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle-Ob+***@public.gmane.org
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who
doesn't in university, right? I was in this strip club giving this
guy a lap dance and all he wanted to do was to discuss Foucault with
me. Well, I can stand naked and do my little dance, or I can discuss
Foucault, but not at the same time; too much information.
(Annabel Chong)
Sciss
2007-12-11 23:50:32 UTC
Permalink
i see at least three mistakes:

sendDef {
amp = Synth.basicNew(\amp, server ); // ! server
SynthDef(\amp, { arg inbus, amp = 1;
ReplaceOut.ar( inbus, In.ar(inbus, 2) * amp );
}).send(server, amp.newMsg( 0, [ \amp, volume ],
\addToTail) ; // ! completionMsg because /d_recv is asynchronous ; !
initial volume
);
}

in initVolume you could do

server = aServer ?? { Server.default };


ciao, -sciss-
Post by Andrea Valle
Josh,
I was going to write exactly a little utility class with the
proposed mechanism, so I used yours (thanks!).
Now, I have to pass the constructor a server, I was thinking I
could refer to Server.default inside the class (i.e. without
passing a server), but doesn't work in this way.
What am I missing?
Best
-a-
// Utility class for a simple general volume
// andrea after Josh
/*
// a sound
{SinOsc.ar(mul:0.1)}.play
v = Volume.new(s) ;
v.gui ;
v.volume_(0.5) ;
v.volume ;
*/
Volume {
var server, amp, <>window, <volume ;
var slider, box ;
*new { arg server ;
^super.new.initVolume(server) ;
}
initVolume { arg aServer ;
server = aServer ;
if ( server.serverRunning.not, { server.boot }) ;
//server = Server.default.boot ;
server.doWhenBooted({
this.sendDef ;
}) ;
volume = 1 ;
}
sendDef {
SynthDef(\amp, { arg inbus, amp = 1;
ReplaceOut.ar( inbus, In.ar(inbus, 2) * amp );
}).send(server);
amp = Synth(\amp, target: 0, addAction: \addToTail) ;
}
// cleaner with MVC
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume]) ;
box.value_(aVolume) ;
slider.value_(aVolume) ;
}
gui {
window = GUI.window.new("Volume", Rect(100, 100, 60, 320)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
box.value_(volume) ;
}) ;
box.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
slider.value_(volume)
}) ;
}
}
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--------------------------------------------------
I did this interview where I just mentioned that I read Foucault.
Who doesn't in university, right? I was in this strip club giving
this guy a lap dance and all he wanted to do was to discuss
Foucault with me. Well, I can stand naked and do my little dance,
or I can discuss Foucault, but not at the same time; too much
information.
(Annabel Chong)
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
Andrea Valle
2007-12-12 00:09:36 UTC
Permalink
Ah, thanks Sciss,
So, how many others? :)

-a-

// Utility class for a simple general volume
// andrea after Josh, with comments by Sciss

/*
// a sound
{SinOsc.ar(mul:0.1)}.play

v = Volume.new(s) ;
v.gui ;
v.volume_(0.5) ;
v.volume ;

*/

Volume {

var server, amp, <>window, <volume ;
var slider, box ;


*new { arg server ;
^super.new.initVolume(server) ;
}

initVolume { arg aServer ;
server = aServer ?? (Server.default) ;
if ( server.serverRunning.not, { server.boot }) ;
server.doWhenBooted({
this.sendDef ;
}) ;
volume = 1 ;
}

sendDef {
amp = Synth.basicNew(\amp, server) ;
SynthDef(\amp, { arg inbus, amp = 1;
ReplaceOut.ar( inbus, In.ar(inbus, 2) * amp );
}).send(server, amp.newMsg( 0, [ \amp, volume ], \addToTail));
}

// cleaner with MVC
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume]) ;
box.value_(aVolume) ;
slider.value_(aVolume) ;
}

gui {
window = GUI.window.new("Volume", Rect(100, 100, 60, 320)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
box.value_(volume) ;
}) ;
box.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
slider.value_(volume)
}) ;

}

}
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle-Ob+***@public.gmane.org
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who
doesn't in university, right? I was in this strip club giving this
guy a lap dance and all he wanted to do was to discuss Foucault with
me. Well, I can stand naked and do my little dance, or I can discuss
Foucault, but not at the same time; too much information.
(Annabel Chong)
tom tlalim
2007-12-12 01:09:18 UTC
Permalink
yea, nice one.
was it cmd-f4 / f5 to change master volume back in SC2?
quite useful !

t
jostM
2007-12-12 13:56:55 UTC
Permalink
yes, this is exactly what I have been doing. I added to this by making
SC always listen to a specific midi control. If my volume control synth
is not running, and I hit the volume knob on my midi pannel, the volume
synth is is instantly played and lowers the volume.

jostM
Post by Josh Parmenter
Here is a quick example that works ... you would need to probably make
// the SynthDef that will control amplitude
SynthDef(\amp, {arg inbus, amp = 1;
ReplaceOut.ar(inbus, In.ar(inbus, 2) * amp);
}).load(s);
// start the global control
a = Synth(\amp, target: 0, addAction: \addToTail);
// make the window and slider
w = GUI.window.new("Volume", Rect(100, 100, 100, 300)).front;
GUI.slider.new(w, Rect(10, 10, 80, 280))
.value_(1)
.action_({arg slider;
// when the slider moves, change the 'amp' parameter of a
a.set([\amp, slider.value]);
});
// start some synths. These go out to bus 0... the Synth a is running
at the tail of group 0, so
// it catches all the output
z = 100.do({
{SinOsc.ar(440.rrand(880), 0, 0.001)}.play
});
// notice in the tree that 'amp' is running last... this is why this
works
s.queryAllNodes
// stop everything
s.freeAll;
best,
Josh
Post by Andrew Grathwohl
Hi Josh,
Thanks much for the quick and thoughtful response!
Unfortunately, I'm an extreme uber newbie when it comes to
SuperCollider, and while I'm pretty sure I understand what you're
talking about, I simply have no idea how this concept is implemented
into a SynthDef. A lot of times, SuperCollider is used as an
improvisation tool, so all of the work I do is usually coded on the
spot (and many of my sounds produced are not SynthDefs).
Is there no way to control simply the entire application's output
levels, instead of having to assign a slider to every synth?
I apologize greatly if my ignorance on this subject is frustrating. I
really appreciate the help.
Thanks, -
-Andrew
Post by Josh Parmenter
If you have my library from sc3-plugins (JoshLib), there is global
control involved with the ProcEvents class and GUI. I usually have a
SynthDef with a ReplaceOut running at the VERY tail of all processing,
and this SynthDef has an amplitude control for an arg. The GUI slider
then writes it's values to the node where that synth is running.
Another possibility is to write values from a GUI to a control bus,
and have nodes reading that control bus. This isn't quite as nice
though, since every synth has to have access to this data. The first
idea above doesn't require your other synths to change... you just add
a synth at the tail of 0 that scales the sound for you.
http://sourceforge.net/projects/sc3-plugins/
Hope that helps.
Josh
Post by Andrew Grathwohl
Hi list,
Could anybody direct me to an example of how to program a GUI
interface which can control the level output from SuperCollider?
Thanks,
-Andrew
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
AIM: Gwohl1
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
AIM: Gwohl1
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
James Harkins
2007-12-12 02:49:42 UTC
Permalink
Post by Andrew Grathwohl
Unfortunately, I'm an extreme uber newbie when it comes to
SuperCollider, and while I'm pretty sure I understand what you're
talking about, I simply have no idea how this concept is implemented
into a SynthDef. A lot of times, SuperCollider is used as an
improvisation tool, so all of the work I do is usually coded on the
spot (and many of my sounds produced are not SynthDefs).
Is there no way to control simply the entire application's output
levels, instead of having to assign a slider to every synth?
A volume utility is a good thing to have in the general distribution.
Glad to see someone is working on it.

If you're coming to SC from the point-of-view of DAWs or similar,
MixerChannel can be a nice bridge since it not only lets you control
multiple synths with one GUI unit, but also do submixing, pre- and
post-fader sends for effects, and it keeps track of the right server
order for you.

You can play synthdefs by giving the name, and it also takes
functions and crucial-library Instr or Patch objects.

m = MixerChannel(\demo, s, 1, 2); // one channel in, two out
a = m.play { SinOsc.ar(440) }; // like { }.play but runs the signal
thru the mixer
m.level = 0.2;
m.level = 0.5;
m.pan = -1;
m.automate(\pan, { SinOsc.kr(0.1) });
m.pan = 0; // stop automation

MixingBoard(\demo, nil, m); // there's your gui

a.free;
m.free;

The Volume utility might meet your need for the moment, but it might
not be long before you need more than a simple volume control :)

hjh


: H. James Harkins
: jamshark70-***@public.gmane.org
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
Andrea Valle
2007-12-12 11:05:19 UTC
Permalink
I think that we should add a volume utility to the distribution.
I have just enveloped Josh's idea in a class.
I have not tested the example but seems really nice.
I would vote for add it to the official distro.

Best

-a-
Post by James Harkins
Post by Andrew Grathwohl
Unfortunately, I'm an extreme uber newbie when it comes to
SuperCollider, and while I'm pretty sure I understand what you're
talking about, I simply have no idea how this concept is implemented
into a SynthDef. A lot of times, SuperCollider is used as an
improvisation tool, so all of the work I do is usually coded on the
spot (and many of my sounds produced are not SynthDefs).
Is there no way to control simply the entire application's output
levels, instead of having to assign a slider to every synth?
A volume utility is a good thing to have in the general
distribution. Glad to see someone is working on it.
If you're coming to SC from the point-of-view of DAWs or similar,
MixerChannel can be a nice bridge since it not only lets you
control multiple synths with one GUI unit, but also do submixing,
pre- and post-fader sends for effects, and it keeps track of the
right server order for you.
You can play synthdefs by giving the name, and it also takes
functions and crucial-library Instr or Patch objects.
m = MixerChannel(\demo, s, 1, 2); // one channel in, two out
a = m.play { SinOsc.ar(440) }; // like { }.play but runs the
signal thru the mixer
m.level = 0.2;
m.level = 0.5;
m.pan = -1;
m.automate(\pan, { SinOsc.kr(0.1) });
m.pan = 0; // stop automation
MixingBoard(\demo, nil, m); // there's your gui
a.free;
m.free;
The Volume utility might meet your need for the moment, but it
might not be long before you need more than a simple volume control :)
hjh
: H. James Harkins
: http://www.dewdrop-world.net
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle-Ob+***@public.gmane.org
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who
doesn't in university, right? I was in this strip club giving this
guy a lap dance and all he wanted to do was to discuss Foucault with
me. Well, I can stand naked and do my little dance, or I can discuss
Foucault, but not at the same time; too much information.
(Annabel Chong)
Andrea Valle
2007-12-12 11:17:24 UTC
Permalink
(I meant: James H's MixerChannel)

-a-
Post by Andrea Valle
I think that we should add a volume utility to the distribution.
I have just enveloped Josh's idea in a class.
I have not tested the example but seems really nice.
I would vote for add it to the official distro.
Best
-a-
Post by James Harkins
Post by Andrew Grathwohl
Unfortunately, I'm an extreme uber newbie when it comes to
SuperCollider, and while I'm pretty sure I understand what you're
talking about, I simply have no idea how this concept is implemented
into a SynthDef. A lot of times, SuperCollider is used as an
improvisation tool, so all of the work I do is usually coded on the
spot (and many of my sounds produced are not SynthDefs).
Is there no way to control simply the entire application's output
levels, instead of having to assign a slider to every synth?
A volume utility is a good thing to have in the general
distribution. Glad to see someone is working on it.
If you're coming to SC from the point-of-view of DAWs or similar,
MixerChannel can be a nice bridge since it not only lets you
control multiple synths with one GUI unit, but also do submixing,
pre- and post-fader sends for effects, and it keeps track of the
right server order for you.
You can play synthdefs by giving the name, and it also takes
functions and crucial-library Instr or Patch objects.
m = MixerChannel(\demo, s, 1, 2); // one channel in, two out
a = m.play { SinOsc.ar(440) }; // like { }.play but runs the
signal thru the mixer
m.level = 0.2;
m.level = 0.5;
m.pan = -1;
m.automate(\pan, { SinOsc.kr(0.1) });
m.pan = 0; // stop automation
MixingBoard(\demo, nil, m); // there's your gui
a.free;
m.free;
The Volume utility might meet your need for the moment, but it
might not be long before you need more than a simple volume
control :)
hjh
: H. James Harkins
: http://www.dewdrop-world.net
"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--------------------------------------------------
I did this interview where I just mentioned that I read Foucault.
Who doesn't in university, right? I was in this strip club giving
this guy a lap dance and all he wanted to do was to discuss
Foucault with me. Well, I can stand naked and do my little dance,
or I can discuss Foucault, but not at the same time; too much
information.
(Annabel Chong)
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> andrea.valle-Ob+***@public.gmane.org
--------------------------------------------------


I did this interview where I just mentioned that I read Foucault. Who
doesn't in university, right? I was in this strip club giving this
guy a lap dance and all he wanted to do was to discuss Foucault with
me. Well, I can stand naked and do my little dance, or I can discuss
Foucault, but not at the same time; too much information.
(Annabel Chong)
James Harkins
2007-12-12 14:14:12 UTC
Permalink
Post by Andrea Valle
(I meant: James H's MixerChannel)
-a-
Post by Andrea Valle
I think that we should add a volume utility to the distribution.
I have just enveloped Josh's idea in a class.
I have not tested the example but seems really nice.
I would vote for add it to the official distro.
Best
-a-
I brought it (MixerChannel) up for inclusion before and it was turned
down for what I think are good reasons.

Advantages to including it in the distribution: it's flexible,
robust, battle-tested over nearly five years now, stable (especially
since I fixed a weird crashing bug last night that happens only if
you do something wrong)

Disadvantages: it's a heavier structure that imposes a certain way of
thinking about signal routing that might not suit every one. The
general philosophy of SuperCollider is to provide the basic tools for
users to build what they need, or add on existing packages. Putting
MixerChannel in the distribution goes against that because it implies
that this is the "right" way to do signal routing. (*I* think it's
the best way... for me. Maybe not everybody.)

So I have no problem keeping it as a quark... which then raises the
problem (which I think is more basic) of, "how do new users find out
what extensions are there?" I think I was supposed to work on that
some time ago, but never found the time... oops...

Anyway, back to the master volume control. I think this, at least, is
such basic functionality that it should be checked into the
distribution. I would even suggest adding the volume slider to the
server windows drawn at startup!

hjh


: H. James Harkins
: jamshark70-***@public.gmane.org
: http://www.dewdrop-world.net
.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
Scott Wilson
2007-12-12 14:55:45 UTC
Permalink
Post by James Harkins
Anyway, back to the master volume control. I think this, at least,
is such basic functionality that it should be checked into the
distribution. I would even suggest adding the volume slider to the
server windows drawn at startup!
I've sometimes wondered if this shouldn't just be a server command
(flame shield on ;-). I certainly miss the gain controls from SC2,
and it is a fairly basic thing.

At the very least I think an example of how to do this should be
added to the examples folder.

S.
Josh Parmenter
2007-12-12 15:18:39 UTC
Permalink
I think adding it would be fine, but I don't think I would like it on
by default (especially since a user can simply add it to the startup
file). The class I made yesterday was quick... I'll look at it a bit
more, and see if I can have it included in a view (with a mute
button). If so, it could be something that a user could add to the
Server windows at startup. Having it there by default is something I
wouldn't like very much though, since I often run my own controls at
the tail of 0!

Or, perhaps we should add a scaler to the output of scsynth, and avoid
it being a SynthDef that is running in the node tree? This could
possibly be an updatable option through OSC messaging, that could then
have a slider or control hooked up to it. I'll see if this is possible
later today probably (battling a nasty cold... must return to bed).

Best,
Josh
Post by Scott Wilson
Post by James Harkins
Anyway, back to the master volume control. I think this, at least,
is such basic functionality that it should be checked into the
distribution. I would even suggest adding the volume slider to the
server windows drawn at startup!
I've sometimes wondered if this shouldn't just be a server command
(flame shield on ;-). I certainly miss the gain controls from SC2,
and it is a fairly basic thing.
At the very least I think an example of how to do this should be
added to the examples folder.
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
Scott Wilson
2007-12-12 15:28:24 UTC
Permalink
Post by Josh Parmenter
I think adding it would be fine, but I don't think I would like it
on by default (especially since a user can simply add it to the
startup file). The class I made yesterday was quick... I'll look at
it a bit more, and see if I can have it included in a view (with a
mute button). If so, it could be something that a user could add to
the Server windows at startup. Having it there by default is
something I wouldn't like very much though, since I often run my
own controls at the tail of 0!
Or, perhaps we should add a scaler to the output of scsynth, and
avoid it being a SynthDef that is running in the node tree? This
could possibly be an updatable option through OSC messaging, that
could then have a slider or control hooked up to it. I'll see if
this is possible later today probably (battling a nasty cold...
must return to bed).
That's what I was thinking, but I think the objections are easily
anticipatable... ;-)

S.
Post by Josh Parmenter
Best,
Josh
Post by Scott Wilson
Post by James Harkins
Anyway, back to the master volume control. I think this, at
least, is such basic functionality that it should be checked into
the distribution. I would even suggest adding the volume slider
to the server windows drawn at startup!
I've sometimes wondered if this shouldn't just be a server command
(flame shield on ;-). I certainly miss the gain controls from SC2,
and it is a fairly basic thing.
At the very least I think an example of how to do this should be
added to the examples folder.
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
Jascha Narveson
2007-12-12 17:09:47 UTC
Permalink
If so, it could be something that a user could add to the Server
windows at startup. Having it there by default is something I
wouldn't like very much though, since I often run my own controls
at the tail of 0!
Creating a volume control by default like this would also mean that
it'd be scaling the output of the "Record" synths generated from the
server window buttons - something people may or may not want...
Sciss
2007-12-12 15:34:54 UTC
Permalink
an extra command does not make any sense I.M.O. ; you will want to
have maybe other things, like a master limiter, meter display, etc.
this should all be done with a regular synth at the tree tail, i see
no reason why to increase the number of commands or special cases.

here's another suggestion: put a gain slider in the server-window
code, the synth can be created as soon as one departs from 0 dB.

ciao, -sciss-
Post by Scott Wilson
Post by James Harkins
Anyway, back to the master volume control. I think this, at least,
is such basic functionality that it should be checked into the
distribution. I would even suggest adding the volume slider to the
server windows drawn at startup!
I've sometimes wondered if this shouldn't just be a server command
(flame shield on ;-). I certainly miss the gain controls from SC2,
and it is a fairly basic thing.
At the very least I think an example of how to do this should be
added to the examples folder.
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
Scott Wilson
2007-12-12 16:29:20 UTC
Permalink
Post by Sciss
an extra command does not make any sense I.M.O. ; you will want to
have maybe other things, like a master limiter, meter display, etc.
this should all be done with a regular synth at the tree tail, i
see no reason why to increase the number of commands or special cases.
Sorry, but I don't really believe the slippery slope argument. I
think a master volume is both simpler and more general than these
other things you mention, and there is a precedent for this as a
special case in SC2. Soft drugs don't necessarily lead to hard ones.
But it's a question of where to draw the line. JMC didn't include
this in scsynth, I presume on the grounds of keeping the design as
simple as possible?

So I'm not prepared to push for it very hard...

S.
Dan Stowell
2007-12-12 17:20:06 UTC
Permalink
I like Sciss's suggestion here. Re Josh's post, the gain slider could
certainly be optional, but my vote would be for it to be visible by
default.

Re Jascha's post just now, the master gain synth could be made to come
after the recording synth?

Irrespective of whether the slippery-slope argument applies (re
Scott's post), using a synth to achieve the effect sounds reasonable
to me. It'd be the same as happens with the "record" button after all.
But I'm not arguing strongly here, just my 2p.

Dan
Post by Sciss
an extra command does not make any sense I.M.O. ; you will want to
have maybe other things, like a master limiter, meter display, etc.
this should all be done with a regular synth at the tree tail, i see
no reason why to increase the number of commands or special cases.
here's another suggestion: put a gain slider in the server-window
code, the synth can be created as soon as one departs from 0 dB.
ciao, -sciss-
Post by Scott Wilson
Post by James Harkins
Anyway, back to the master volume control. I think this, at least,
is such basic functionality that it should be checked into the
distribution. I would even suggest adding the volume slider to the
server windows drawn at startup!
I've sometimes wondered if this shouldn't just be a server command
(flame shield on ;-). I certainly miss the gain controls from SC2,
and it is a fairly basic thing.
At the very least I think an example of how to do this should be
added to the examples folder.
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--
http://www.mcld.co.uk
Jascha Narveson
2007-12-12 17:43:41 UTC
Permalink
Something like the "record" button on the server window seems to make
sense: click the button and get a volume control in the corner of
your screen if you want it, otherwise ignore it and deal with volume
in your own way. It'd have to be able to deal with multichannel
though - I guess the synth could be generated from an Instr which
could be passed numOutputBusChannels as the argument for how many
consecutive buses to read.

Since "record" and "volume" would both be adding themselves to the
end of node 0, their order would change depending on the order in
which people pushed the buttons. This could either be explicitly
stated in the documentation somewhere, or place-holding nodes could
be created on startup to hold the record and volume synths to which
each synth would be assigned if they were called, and it would just
have to be decided which order those things would go in.
Post by Dan Stowell
I like Sciss's suggestion here. Re Josh's post, the gain slider could
certainly be optional, but my vote would be for it to be visible by
default.
Re Jascha's post just now, the master gain synth could be made to come
after the recording synth?
Irrespective of whether the slippery-slope argument applies (re
Scott's post), using a synth to achieve the effect sounds reasonable
to me. It'd be the same as happens with the "record" button after all.
But I'm not arguing strongly here, just my 2p.
Dan
Post by Sciss
an extra command does not make any sense I.M.O. ; you will want to
have maybe other things, like a master limiter, meter display, etc.
this should all be done with a regular synth at the tree tail, i see
no reason why to increase the number of commands or special cases.
here's another suggestion: put a gain slider in the server-window
code, the synth can be created as soon as one departs from 0 dB.
ciao, -sciss-
Post by Scott Wilson
Post by James Harkins
Anyway, back to the master volume control. I think this, at least,
is such basic functionality that it should be checked into the
distribution. I would even suggest adding the volume slider to the
server windows drawn at startup!
I've sometimes wondered if this shouldn't just be a server command
(flame shield on ;-). I certainly miss the gain controls from SC2,
and it is a fairly basic thing.
At the very least I think an example of how to do this should be
added to the examples folder.
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--
http://www.mcld.co.uk
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
Scott Wilson
2007-12-12 17:57:21 UTC
Permalink
Post by Jascha Narveson
Something like the "record" button on the server window seems to
make sense: click the button and get a volume control in the corner
of your screen if you want it, otherwise ignore it and deal with
volume in your own way. It'd have to be able to deal with
multichannel though - I guess the synth could be generated from an
Instr which could be passed numOutputBusChannels as the argument
for how many consecutive buses to read.
Since "record" and "volume" would both be adding themselves to the
end of node 0, their order would change depending on the order in
which people pushed the buttons. This could either be explicitly
stated in the documentation somewhere, or place-holding nodes could
be created on startup to hold the record and volume synths to which
each synth would be assigned if they were called, and it would just
have to be decided which order those things would go in.
Or the relative nodes are just stored in an instance var when
created, so that if one already exists you can target appropriately.

S.
Scott Wilson
2007-12-12 18:01:15 UTC
Permalink
Post by Scott Wilson
Or the relative nodes are just stored in an instance var when
created, so that if one already exists you can target appropriately.
er, um relevant nodes...

S.
Jan Trutzschler
2007-12-12 18:47:19 UTC
Permalink
a perhaps related issue:
i'm having this master volume fader since ages in my start-up and it
can be done with a few lines of code (as we've seen in previous posts).
i have a synth on the tail of the root node, which is started in the
server's tree function. It might be worth working out a good
mechanism to register different (ordered) tree functions. Then we
could have simply the option to add a function there, which starts a
volume synth (in another group). Such a function could be a classvar
of a ServerTreeFunction class.
I have such a class lying around, but it would need a serious clean-up.

j.
Post by Scott Wilson
Post by Scott Wilson
Or the relative nodes are just stored in an instance var when
created, so that if one already exists you can target appropriately.
er, um relevant nodes...
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
Josh Parmenter
2007-12-12 19:44:25 UTC
Permalink
So... how about this? Perhaps there can be a volume control that runs
after group 1 (addAction: 1, target: 1), then record, scope etc. that
run at the tail of 0 would catch it's action. It shows up in the
server window, but the synth doesn't start until it is touched. Then,
a button to mute, and a button to remove the synth (setting output
back to 1).

nothing changes on the Server, and as long as everything is in group 1
(except for the special cases, and something explicitly put there by
the user), all should work fine.

If this is wanted, I can clean up a bit more with the Volume class I
posted yesterday, setting the default number of channels to the server
options value like Scott suggested. sound good?

Josh
Post by Jan Trutzschler
i'm having this master volume fader since ages in my start-up and it
can be done with a few lines of code (as we've seen in previous posts).
i have a synth on the tail of the root node, which is started in the
server's tree function. It might be worth working out a good
mechanism to register different (ordered) tree functions. Then we
could have simply the option to add a function there, which starts a
volume synth (in another group). Such a function could be a classvar
of a ServerTreeFunction class.
I have such a class lying around, but it would need a serious clean-
up.
j.
Post by Scott Wilson
Post by Scott Wilson
Or the relative nodes are just stored in an instance var when
created, so that if one already exists you can target appropriately.
er, um relevant nodes...
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
Josh Parmenter
2007-12-12 21:37:52 UTC
Permalink
that makes sense also...

and I meant addAction 3 earlier...

Josh
Post by Scott Wilson
Post by Scott Wilson
Or the relative nodes are just stored in an instance var when
created, so that if one already exists you can target appropriately.
er, um relevant nodes...
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
Josh Parmenter
2007-12-12 23:32:48 UTC
Permalink
Hi all...

to continue the discussion, here is another version of the class (not
in the Server window yet). Added mute and unmute. Usage at the top.
Now... I made this originally (and at present) with db values expected
(thinking about the old panic key in SC2, and the other controls to
knock of 3 or 60 db). However, it seems to make more sense to me to do
everything in linear amplitudes (since this is how most UGens work).
Thoughts?

Josh

/*

s.boot;

a = Volume(s, 0, s.options.numOutputBusChannels);
a.play;

z = {SinOsc.ar(440, 0, 0.1)}.play

a.volume_(-12);
a.mute;
a.unmute;
a.volume_(0);

a.gui;

a.free;

z.free;

*/

Volume {

var startBus, numChans, min, max, server, <amp, <>window, <volume,
spec ;
var slider, box, <lag, sdname, gui, isPlaying, muteamp;


*new { arg server, startBus = 0, numChans = 2, min = -90, max = 6 ;
^super.newCopyArgs(startBus, numChans, min, max).initVolume(server);
}

initVolume { arg aServer, aStartBus, aNumChans, aMin, aMax ;
var cond;
server = aServer ?? {Server.default};
volume = 0;
isPlaying = false;
gui = false;
spec = [min, max, \db].asSpec;
}

sendDef {
SynthDef(sdname = (\volume_amp_control++numChans).asSymbol, { arg
amp = 1, lag = 0.1;
ReplaceOut.ar( startBus, In.ar(startBus, numChans) * Lag.kr(amp,
lag) );
}).send(server);
}

play {
var cond;
cond = Condition.new;
server.serverRunning.if({
Routine.run({
this.sendDef;
server.sync(cond);
isPlaying = true;
amp = Synth(sdname, [\amp, volume.dbamp, \lag, lag],
target: 1, addAction: \addAfter);
})
}, {
"Volume only works on a running Server. Please boot".warn;
})
}

free {
amp.free;
isPlaying = false;
}

mute {
muteamp = volume;
this.volume_(-inf);
}

unmute {
this.volume_(muteamp)
}

// sets volume back to 1 - removes the synth
reset {
this.free;
}

// cleaner with MVC - in db
volume_ { arg aVolume ;
volume = aVolume;
isPlaying.if({amp.set([\amp, volume.dbamp])}) ;
gui.if({
box.value_(volume.round(0.01)) ;
slider.value_(spec.unmap(volume)) ;
})
}

lag_ {arg aLagTime;
lag = aLagTime;
amp.set([\lag, lag]);
}


gui {arg window, bounds;
gui = true;
bounds = bounds ?? {Rect(100, 100, 80, 330)};
window = window ?? {GUI.window.new("Volume", bounds).front};
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(spec.unmap(volume)) ;
slider.action_({ arg item ;
this.volume_(spec.map(item.value));
}) ;
box.action_({ arg item ;
this.volume_(item.value) ;
}) ;
window.onClose_({
gui = false;
});

}

close {
window.close;
}

}
Post by Scott Wilson
Post by Scott Wilson
Or the relative nodes are just stored in an instance var when
created, so that if one already exists you can target appropriately.
er, um relevant nodes...
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
Scott Wilson
2007-12-12 23:41:13 UTC
Permalink
I'd vote for dB.

S.
Post by Josh Parmenter
Hi all...
to continue the discussion, here is another version of the class
(not in the Server window yet). Added mute and unmute. Usage at the
top. Now... I made this originally (and at present) with db values
expected (thinking about the old panic key in SC2, and the other
controls to knock of 3 or 60 db). However, it seems to make more
sense to me to do everything in linear amplitudes (since this is
how most UGens work). Thoughts?
Josh
/*
s.boot;
a = Volume(s, 0, s.options.numOutputBusChannels);
a.play;
z = {SinOsc.ar(440, 0, 0.1)}.play
a.volume_(-12);
a.mute;
a.unmute;
a.volume_(0);
a.gui;
a.free;
z.free;
*/
Volume {
var startBus, numChans, min, max, server, <amp, <>window,
<volume, spec ;
var slider, box, <lag, sdname, gui, isPlaying, muteamp;
*new { arg server, startBus = 0, numChans = 2, min = -90, max = 6 ;
^super.newCopyArgs(startBus, numChans, min, max).initVolume(server);
}
initVolume { arg aServer, aStartBus, aNumChans, aMin, aMax ;
var cond;
server = aServer ?? {Server.default};
volume = 0;
isPlaying = false;
gui = false;
spec = [min, max, \db].asSpec;
}
sendDef {
SynthDef(sdname = (\volume_amp_control++numChans).asSymbol, { arg
amp = 1, lag = 0.1;
ReplaceOut.ar( startBus, In.ar(startBus, numChans) * Lag.kr(amp,
lag) );
}).send(server);
}
play {
var cond;
cond = Condition.new;
server.serverRunning.if({
Routine.run({
this.sendDef;
server.sync(cond);
isPlaying = true;
amp = Synth(sdname, [\amp, volume.dbamp, \lag, lag],
target: 1, addAction: \addAfter);
})
}, {
"Volume only works on a running Server. Please boot".warn;
})
}
free {
amp.free;
isPlaying = false;
}
mute {
muteamp = volume;
this.volume_(-inf);
}
unmute {
this.volume_(muteamp)
}
// sets volume back to 1 - removes the synth
reset {
this.free;
}
// cleaner with MVC - in db
volume_ { arg aVolume ;
volume = aVolume;
isPlaying.if({amp.set([\amp, volume.dbamp])}) ;
gui.if({
box.value_(volume.round(0.01)) ;
slider.value_(spec.unmap(volume)) ;
})
}
lag_ {arg aLagTime;
lag = aLagTime;
amp.set([\lag, lag]);
}
gui {arg window, bounds;
gui = true;
bounds = bounds ?? {Rect(100, 100, 80, 330)};
window = window ?? {GUI.window.new("Volume", bounds).front};
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(spec.unmap(volume)) ;
slider.action_({ arg item ;
this.volume_(spec.map(item.value));
}) ;
box.action_({ arg item ;
this.volume_(item.value) ;
}) ;
window.onClose_({
gui = false;
});
}
close {
window.close;
}
}
Post by Scott Wilson
Post by Scott Wilson
Or the relative nodes are just stored in an instance var when
created, so that if one already exists you can target appropriately.
er, um relevant nodes...
S.
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
James Harkins
2007-12-11 17:30:30 UTC
Permalink
MixerChannel in my library - you can use the Quarks class to check out
the "ddwMixerChannel" quark. That requires svn, which is easy to
install and worth the time.

Some (slightly out of date) screenshots are here -
http://www.dewdrop-world.net/sc3/tutorials/index.php?id=1 - scroll
down about 2/3.

You can create a master MixerChannel and then have other mixers feed
into it. I do that in every piece.

hjh
Post by Andrew Grathwohl
Hi list,
Could anybody direct me to an example of how to program a GUI
interface which can control the level output from SuperCollider?
Thanks,
-Andrew
--
Andrew Grathwohl
G-Wohl Productions
www.gwohlproductions.com
Cell: 203-331-6688
AIM: Gwohl1
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
--
James Harkins /// dewdrop world
jamshark70-***@public.gmane.org
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal." -- Whitman
Josh Parmenter
2007-12-12 01:37:38 UTC
Permalink
How about this (server works... added a few other things - min and
max, numChannels, and startbus):

/*
// Utility class for a simple general volume
// andrea after Josh

// Volume.new(server, startBus, numChans, min, max); // min and max in
db

a = Volume.new; // use all defaults

z = {SinOsc.ar(440 * [1, 2], 0, 0.2)}.play(s)

a.close; // frees the Volume control. So does closing the window

// only control the left channel
a = Volume.new(startBus: 1, numChans: 1, min: -60, max: 12);

a.close;

z.free;

*/

Volume {

var server, <amp, <>window, <volume, spec ;
var slider, box, <lag ;


*new { arg server, startBus = 0, numChans = 2, min = -90, max = 6 ;
^super.new.initVolume(server, startBus, numChans, min, max) ;
}

initVolume { arg aServer, aStartBus, aNumChans, aMin, aMax ;
var cond;
cond = Condition.new;
server = aServer ?? {Server.default};
if ( server.serverRunning.not, { server.boot }) ;
volume = 0;
spec = [aMin, aMax, \db].asSpec;
//server = Server.default.boot ;
server.doWhenBooted({
Routine.run({
this.sendDef(aStartBus, aNumChans);
server.sync(cond);
{
this.gui;
this.volume_(0);
this.play;
}.defer;
});
})
}

// avoid confilcts with someone elses SynthDef called \amp
// by giving it a name that hopefully won't be used!
sendDef {arg startBus, numChans;
SynthDef(\volume_amp_sd_32768, { arg amp = 1, lag = 0.1;
ReplaceOut.ar( startBus, In.ar(startBus, numChans) * Lag.kr(amp,
lag) );
}).send(server);
}

play {
amp = Synth(\volume_amp_sd_32768, [\amp, volume.dbamp, \lag, lag],
target: 0, addAction: \addToTail);
}

// cleaner with MVC - in db
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume.dbamp]) ;
box.value_(volume.round(0.01)) ;
slider.value_(spec.unmap(volume)) ;
}

lag_ {arg aLagTime;
lag = aLagTime;
amp.set([\lag, lag]);
}


gui {
window = GUI.window.new("Volume", Rect(100, 100, 80, 330)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
this.volume_(spec.map(item.value));
}) ;
box.action_({ arg item ;
this.volume_(item.value) ;
}) ;
window.onClose_({
amp.free;
});

}

close {
window.close;
}

}
Post by Andrea Valle
Josh,
I was going to write exactly a little utility class with the
proposed mechanism, so I used yours (thanks!).
Now, I have to pass the constructor a server, I was thinking I could
refer to Server.default inside the class (i.e. without passing a
server), but doesn't work in this way.
What am I missing?
Best
-a-
// Utility class for a simple general volume
// andrea after Josh
/*
// a sound
{SinOsc.ar(mul:0.1)}.play
v = Volume.new(s) ;
v.gui ;
v.volume_(0.5) ;
v.volume ;
*/
Volume {
var server, amp, <>window, <volume ;
var slider, box ;
*new { arg server ;
^super.new.initVolume(server) ;
}
initVolume { arg aServer ;
server = aServer ;
if ( server.serverRunning.not, { server.boot }) ;
//server = Server.default.boot ;
server.doWhenBooted({
this.sendDef ;
}) ;
volume = 1 ;
}
sendDef {
SynthDef(\amp, { arg inbus, amp = 1;
ReplaceOut.ar( inbus, In.ar(inbus, 2) * amp );
}).send(server);
amp = Synth(\amp, target: 0, addAction: \addToTail) ;
}
// cleaner with MVC
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume]) ;
box.value_(aVolume) ;
slider.value_(aVolume) ;
}
gui {
window = GUI.window.new("Volume", Rect(100, 100, 60, 320)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
box.value_(volume) ;
}) ;
box.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
slider.value_(volume)
}) ;
}
}
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--------------------------------------------------
I did this interview where I just mentioned that I read Foucault.
Who doesn't in university, right? I was in this strip club giving
this guy a lap dance and all he wanted to do was to discuss Foucault
with me. Well, I can stand naked and do my little dance, or I can
discuss Foucault, but not at the same time; too much information.
(Annabel Chong)
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/


******************************************
/* 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
*/
Scott Wilson
2007-12-12 01:44:54 UTC
Permalink
Why not just read numChannels from the server's options?

S.
Post by Josh Parmenter
How about this (server works... added a few other things - min and
/*
// Utility class for a simple general volume
// andrea after Josh
// Volume.new(server, startBus, numChans, min, max); // min and max
in db
a = Volume.new; // use all defaults
z = {SinOsc.ar(440 * [1, 2], 0, 0.2)}.play(s)
a.close; // frees the Volume control. So does closing the window
// only control the left channel
a = Volume.new(startBus: 1, numChans: 1, min: -60, max: 12);
a.close;
z.free;
*/
Volume {
var server, <amp, <>window, <volume, spec ;
var slider, box, <lag ;
*new { arg server, startBus = 0, numChans = 2, min = -90, max = 6 ;
^super.new.initVolume(server, startBus, numChans, min, max) ;
}
initVolume { arg aServer, aStartBus, aNumChans, aMin, aMax ;
var cond;
cond = Condition.new;
server = aServer ?? {Server.default};
if ( server.serverRunning.not, { server.boot }) ;
volume = 0;
spec = [aMin, aMax, \db].asSpec;
//server = Server.default.boot ;
server.doWhenBooted({
Routine.run({
this.sendDef(aStartBus, aNumChans);
server.sync(cond);
{
this.gui;
this.volume_(0);
this.play;
}.defer;
});
})
}
// avoid confilcts with someone elses SynthDef called \amp
// by giving it a name that hopefully won't be used!
sendDef {arg startBus, numChans;
SynthDef(\volume_amp_sd_32768, { arg amp = 1, lag = 0.1;
ReplaceOut.ar( startBus, In.ar(startBus, numChans) * Lag.kr(amp,
lag) );
}).send(server);
}
play {
amp = Synth(\volume_amp_sd_32768, [\amp, volume.dbamp, \lag, lag],
target: 0, addAction: \addToTail);
}
// cleaner with MVC - in db
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume.dbamp]) ;
box.value_(volume.round(0.01)) ;
slider.value_(spec.unmap(volume)) ;
}
lag_ {arg aLagTime;
lag = aLagTime;
amp.set([\lag, lag]);
}
gui {
window = GUI.window.new("Volume", Rect(100, 100, 80, 330)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
this.volume_(spec.map(item.value));
}) ;
box.action_({ arg item ;
this.volume_(item.value) ;
}) ;
window.onClose_({
amp.free;
});
}
close {
window.close;
}
}
Post by Andrea Valle
Josh,
I was going to write exactly a little utility class with the
proposed mechanism, so I used yours (thanks!).
Now, I have to pass the constructor a server, I was thinking I
could refer to Server.default inside the class (i.e. without
passing a server), but doesn't work in this way.
What am I missing?
Best
-a-
// Utility class for a simple general volume
// andrea after Josh
/*
// a sound
{SinOsc.ar(mul:0.1)}.play
v = Volume.new(s) ;
v.gui ;
v.volume_(0.5) ;
v.volume ;
*/
Volume {
var server, amp, <>window, <volume ;
var slider, box ;
*new { arg server ;
^super.new.initVolume(server) ;
}
initVolume { arg aServer ;
server = aServer ;
if ( server.serverRunning.not, { server.boot }) ;
//server = Server.default.boot ;
server.doWhenBooted({
this.sendDef ;
}) ;
volume = 1 ;
}
sendDef {
SynthDef(\amp, { arg inbus, amp = 1;
ReplaceOut.ar( inbus, In.ar(inbus, 2) * amp );
}).send(server);
amp = Synth(\amp, target: 0, addAction: \addToTail) ;
}
// cleaner with MVC
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume]) ;
box.value_(aVolume) ;
slider.value_(aVolume) ;
}
gui {
window = GUI.window.new("Volume", Rect(100, 100, 60, 320)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
box.value_(volume) ;
}) ;
box.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
slider.value_(volume)
}) ;
}
}
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--------------------------------------------------
I did this interview where I just mentioned that I read Foucault.
Who doesn't in university, right? I was in this strip club giving
this guy a lap dance and all he wanted to do was to discuss
Foucault with me. Well, I can stand naked and do my little dance,
or I can discuss Foucault, but not at the same time; too much
information.
(Annabel Chong)
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
Scott Wilson
2007-12-12 01:47:02 UTC
Permalink
I mean as a default.
Post by Scott Wilson
Why not just read numChannels from the server's options?
S.
Post by Josh Parmenter
How about this (server works... added a few other things - min and
/*
// Utility class for a simple general volume
// andrea after Josh
// Volume.new(server, startBus, numChans, min, max); // min and
max in db
a = Volume.new; // use all defaults
z = {SinOsc.ar(440 * [1, 2], 0, 0.2)}.play(s)
a.close; // frees the Volume control. So does closing the window
// only control the left channel
a = Volume.new(startBus: 1, numChans: 1, min: -60, max: 12);
a.close;
z.free;
*/
Volume {
var server, <amp, <>window, <volume, spec ;
var slider, box, <lag ;
*new { arg server, startBus = 0, numChans = 2, min = -90, max = 6 ;
^super.new.initVolume(server, startBus, numChans, min, max) ;
}
initVolume { arg aServer, aStartBus, aNumChans, aMin, aMax ;
var cond;
cond = Condition.new;
server = aServer ?? {Server.default};
if ( server.serverRunning.not, { server.boot }) ;
volume = 0;
spec = [aMin, aMax, \db].asSpec;
//server = Server.default.boot ;
server.doWhenBooted({
Routine.run({
this.sendDef(aStartBus, aNumChans);
server.sync(cond);
{
this.gui;
this.volume_(0);
this.play;
}.defer;
});
})
}
// avoid confilcts with someone elses SynthDef called \amp
// by giving it a name that hopefully won't be used!
sendDef {arg startBus, numChans;
SynthDef(\volume_amp_sd_32768, { arg amp = 1, lag = 0.1;
ReplaceOut.ar( startBus, In.ar(startBus, numChans) * Lag.kr
(amp, lag) );
}).send(server);
}
play {
amp = Synth(\volume_amp_sd_32768, [\amp, volume.dbamp, \lag, lag],
target: 0, addAction: \addToTail);
}
// cleaner with MVC - in db
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume.dbamp]) ;
box.value_(volume.round(0.01)) ;
slider.value_(spec.unmap(volume)) ;
}
lag_ {arg aLagTime;
lag = aLagTime;
amp.set([\lag, lag]);
}
gui {
window = GUI.window.new("Volume", Rect(100, 100, 80, 330)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
this.volume_(spec.map(item.value));
}) ;
box.action_({ arg item ;
this.volume_(item.value) ;
}) ;
window.onClose_({
amp.free;
});
}
close {
window.close;
}
}
Post by Andrea Valle
Josh,
I was going to write exactly a little utility class with the
proposed mechanism, so I used yours (thanks!).
Now, I have to pass the constructor a server, I was thinking I
could refer to Server.default inside the class (i.e. without
passing a server), but doesn't work in this way.
What am I missing?
Best
-a-
// Utility class for a simple general volume
// andrea after Josh
/*
// a sound
{SinOsc.ar(mul:0.1)}.play
v = Volume.new(s) ;
v.gui ;
v.volume_(0.5) ;
v.volume ;
*/
Volume {
var server, amp, <>window, <volume ;
var slider, box ;
*new { arg server ;
^super.new.initVolume(server) ;
}
initVolume { arg aServer ;
server = aServer ;
if ( server.serverRunning.not, { server.boot }) ;
//server = Server.default.boot ;
server.doWhenBooted({
this.sendDef ;
}) ;
volume = 1 ;
}
sendDef {
SynthDef(\amp, { arg inbus, amp = 1;
ReplaceOut.ar( inbus, In.ar(inbus, 2) * amp );
}).send(server);
amp = Synth(\amp, target: 0, addAction: \addToTail) ;
}
// cleaner with MVC
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume]) ;
box.value_(aVolume) ;
slider.value_(aVolume) ;
}
gui {
window = GUI.window.new("Volume", Rect(100, 100, 60, 320)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
box.value_(volume) ;
}) ;
box.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
slider.value_(volume)
}) ;
}
}
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--------------------------------------------------
I did this interview where I just mentioned that I read Foucault.
Who doesn't in university, right? I was in this strip club giving
this guy a lap dance and all he wanted to do was to discuss
Foucault with me. Well, I can stand naked and do my little dance,
or I can discuss Foucault, but not at the same time; too much
information.
(Annabel Chong)
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
Josh Parmenter
2007-12-12 01:53:50 UTC
Permalink
Sure...

Josh
Post by Scott Wilson
I mean as a default.
Post by Scott Wilson
Why not just read numChannels from the server's options?
S.
Post by Josh Parmenter
How about this (server works... added a few other things - min and
/*
// Utility class for a simple general volume
// andrea after Josh
// Volume.new(server, startBus, numChans, min, max); // min and
max in db
a = Volume.new; // use all defaults
z = {SinOsc.ar(440 * [1, 2], 0, 0.2)}.play(s)
a.close; // frees the Volume control. So does closing the window
// only control the left channel
a = Volume.new(startBus: 1, numChans: 1, min: -60, max: 12);
a.close;
z.free;
*/
Volume {
var server, <amp, <>window, <volume, spec ;
var slider, box, <lag ;
*new { arg server, startBus = 0, numChans = 2, min = -90, max = 6 ;
^super.new.initVolume(server, startBus, numChans, min, max) ;
}
initVolume { arg aServer, aStartBus, aNumChans, aMin, aMax ;
var cond;
cond = Condition.new;
server = aServer ?? {Server.default};
if ( server.serverRunning.not, { server.boot }) ;
volume = 0;
spec = [aMin, aMax, \db].asSpec;
//server = Server.default.boot ;
server.doWhenBooted({
Routine.run({
this.sendDef(aStartBus, aNumChans);
server.sync(cond);
{
this.gui;
this.volume_(0);
this.play;
}.defer;
});
})
}
// avoid confilcts with someone elses SynthDef called \amp
// by giving it a name that hopefully won't be used!
sendDef {arg startBus, numChans;
SynthDef(\volume_amp_sd_32768, { arg amp = 1, lag = 0.1;
ReplaceOut.ar( startBus, In.ar(startBus, numChans) *
Lag.kr(amp, lag) );
}).send(server);
}
play {
amp = Synth(\volume_amp_sd_32768, [\amp, volume.dbamp, \lag, lag],
target: 0, addAction: \addToTail);
}
// cleaner with MVC - in db
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume.dbamp]) ;
box.value_(volume.round(0.01)) ;
slider.value_(spec.unmap(volume)) ;
}
lag_ {arg aLagTime;
lag = aLagTime;
amp.set([\lag, lag]);
}
gui {
window = GUI.window.new("Volume", Rect(100, 100, 80, 330)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
this.volume_(spec.map(item.value));
}) ;
box.action_({ arg item ;
this.volume_(item.value) ;
}) ;
window.onClose_({
amp.free;
});
}
close {
window.close;
}
}
Post by Andrea Valle
Josh,
I was going to write exactly a little utility class with the
proposed mechanism, so I used yours (thanks!).
Now, I have to pass the constructor a server, I was thinking I
could refer to Server.default inside the class (i.e. without
passing a server), but doesn't work in this way.
What am I missing?
Best
-a-
// Utility class for a simple general volume
// andrea after Josh
/*
// a sound
{SinOsc.ar(mul:0.1)}.play
v = Volume.new(s) ;
v.gui ;
v.volume_(0.5) ;
v.volume ;
*/
Volume {
var server, amp, <>window, <volume ;
var slider, box ;
*new { arg server ;
^super.new.initVolume(server) ;
}
initVolume { arg aServer ;
server = aServer ;
if ( server.serverRunning.not, { server.boot }) ;
//server = Server.default.boot ;
server.doWhenBooted({
this.sendDef ;
}) ;
volume = 1 ;
}
sendDef {
SynthDef(\amp, { arg inbus, amp = 1;
ReplaceOut.ar( inbus, In.ar(inbus, 2) * amp );
}).send(server);
amp = Synth(\amp, target: 0, addAction: \addToTail) ;
}
// cleaner with MVC
volume_ { arg aVolume ;
volume = aVolume ;
amp.set([\amp, volume]) ;
box.value_(aVolume) ;
slider.value_(aVolume) ;
}
gui {
window = GUI.window.new("Volume", Rect(100, 100, 60, 320)).front;
box = GUI.numberBox.new(window, Rect(10, 10, 60, 30))
.value_(volume) ;
slider = GUI.slider.new(window, Rect(10, 40, 60, 280))
.value_(volume) ;
slider.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
box.value_(volume) ;
}) ;
box.action_({ arg item ;
volume = item.value ;
amp.set([\amp, volume]) ;
slider.value_(volume)
}) ;
}
}
--------------------------------------------------
Andrea Valle
--------------------------------------------------
CIRMA - DAMS
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--------------------------------------------------
I did this interview where I just mentioned that I read Foucault.
Who doesn't in university, right? I was in this strip club giving
this guy a lap dance and all he wanted to do was to discuss
Foucault with me. Well, I can stand naked and do my little dance,
or I can discuss Foucault, but not at the same time; too much
information.
(Annabel Chong)
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
******************************************
/* 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-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
_______________________________________________
sc-users mailing list
http://www.create.ucsb.edu/mailman/listinfo/sc-users
******************************************
/* 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
*/
Continue reading on narkive:
Loading...