Discussion:
Restricting synths / voices in Supercollider
block
2010-05-11 18:19:49 UTC
Permalink
Good evening,

Can anyone advise me on how you restrict synths / voices in Supercollider?
As in, make the application play mono-phonically, as opposed to
polyphonically. .
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Restricting-synths-voices-in-Supercollider-tp5037488p5037488.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
James Harkins
2010-05-11 18:35:13 UTC
Permalink
Post by block
Good evening,
Can anyone advise me on how you restrict synths / voices in Supercollider?
As in, make the application play mono-phonically, as opposed to
polyphonically. .
To play monophonically with a pattern, use Pmono or PmonoArtic.

For a general solution to voice-limiting and voice-stealing, see the
ddwVoicer quark: Voicer() for a polyphonic player with note-stealing,
and MonoPortaVoicer() for a monophonic player with "fingered portamento."

http://quarks.svn.sourceforge.net/viewvc/quarks/dewdrop_lib/ddwVoicer/Help/Voicer.html

hjh
--
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


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
block
2010-05-11 19:59:44 UTC
Permalink
Thanks James, but is there any other general way to do this? As I'm on
Windows (no Quarks right(?)), and I'm not using patterns. .
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Restricting-synths-voices-in-Supercollider-tp5037488p5037941.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
James Harkins
2010-05-11 20:03:45 UTC
Permalink
Post by block
Thanks James, but is there any other general way to do this? As I'm on
Windows (no Quarks right(?)),
http://swiki.hfbk-hamburg.de:8888/MusicTechnology/883
Post by block
and I'm not using patterns. .
Well, if you're creating the synths manually, then monophony is easy:
only create one synth! When you need to change pitch or other
parameters, call .set() on the Synth object.

It isn't exactly clear to me what you want. With the basic Node classes,
you can address the server-side synths pretty much any way you want,
meaning there's no real problem then. If you wanted a higher-level
abstraction to handle that for you, then my suggestions apply.

hjh
--
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


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
pete moss
2010-05-11 20:06:17 UTC
Permalink
Post by block
Thanks James, but is there any other general way to do this? As I'm on
Windows (no Quarks right(?)), and I'm not using patterns. .
i recently had some success with this by using NodeWatcher. it allows
only one instance of a SynthDef to play at a time if you use it correctly.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
block
2010-05-11 20:39:02 UTC
Permalink
Right, here's some example code. .

They certainly seem to be overlapping (looking at the Ugen and Synth count
in the localhost server window).

I'm wondering the playing SinOsc can be muted / cut off when the next is
triggered / played.
I got a little lost with the NodeWatcher Paul.



(
SynthDef(\sinegrain3, {
var grain, final;

grain= Limiter.ar(LPF.ar(SinOsc.ar(500, 0,
1)*(XLine.kr(1.001,0.0001,0.51049,doneAction:2)-0.001), 850));

final= Mix(grain*4);

Out.ar(0,Pan2.ar(final*8))}).send(s);
)


(
{
1000.do{arg i;

Synth(\sinegrain3);
[0.0025+(1.0.rand*0.2598)].choose.wait;

};
}.fork
)
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Restricting-synths-voices-in-Supercollider-tp5037488p5038147.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
block
2010-05-11 20:48:07 UTC
Permalink
(Sorry, double post)

Right, here's some example code. .

They certainly seem to be overlapping (looking at the Ugen and Synth count
in the localhost server window).

I'm wondering if the playing SinOsc can be muted / cut off when the next is
triggered / played.
I got a little lost with the NodeWatcher Paul.



(
SynthDef(\sinegrain3, {
var grain, final;

grain= Limiter.ar(LPF.ar(SinOsc.ar(500, 0,
1)*(XLine.kr(1.001,0.0001,0.51049,doneAction:2)-0.001), 850));

final= Mix(grain*4);

Out.ar(0,Pan2.ar(final*8))}).send(s);
)


(
{
1000.do{arg i;

Synth(\sinegrain3);
[0.0025+(1.0.rand*0.2598)].choose.wait;

};
}.fork
)
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Restricting-synths-voices-in-Supercollider-tp5037488p5038196.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
James Harkins
2010-05-11 21:53:06 UTC
Permalink
Post by block
(Sorry, double post)
Right, here's some example code. .
They certainly seem to be overlapping (looking at the Ugen and Synth count
in the localhost server window).
I'm wondering if the playing SinOsc can be muted / cut off when the next is
triggered / played.
I got a little lost with the NodeWatcher Paul.
Most likely, there will always be a little overlap if your envelope and
the sound. You can cut off the old synths brutally using n_free, but if
their output is not silent at the time, expect some clicking.

With Node Watcher, there's always the chance that the client and server
could be a little out of sync, since it takes a few milliseconds for the
node status update messages to be transmitted from server to client.
Since you have some very short wait times, that could be an issue.

Using XLine for your envelope really limits your options, because it's
timed and there's no way to make it cut off early -- and "cutting off
early" is essential for controlling overlap. You'll need, I think,
another mechanism to bring the envelope down on demand. I'd suggest
EnvGen and Env.

- Add a 'gate' argument to your SynthDef: SynthDef(..., { arg gate = 1;
... })

- Replace XLine with:

EnvGen.kr(Env(#[0.001, 1.001, 0.001], #[0.005, 0.51049], \exp), gate,
doneAction: 2)

- In your routine, you can force the envelope to do a linear fade out by
setting the gate to a value < -1. For a 5 ms fade out, synth.set(\gate,
-1.005). Include that 'set' message in a bundle, so that the release and
new-synth messages execute at the same time.

What if the old node finished before you try to cut it off manually?
Normally that would produce a "node not found" error, but you can use
the /error OSC command to disable error posting temporarily. (Note,
there's a Server method that makes a bundle for you, so that you don't
have to deal with message syntax directly.)

{
var node;
1000.do {
s.makeBundle(nil, {
s.sendMsg(\error, -1);
node !? { node.set(\gate, -1.005) };
s.sendMsg(\error, -2);
node = Synth(\sinegrain3);
});
0.0025+(1.0.rand*0.2598).wait;
}
}.fork;

Note, I don't have time to test, but I think this will work. Reply if
there are any problems.

hjh
--
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


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
block
2010-05-12 08:15:33 UTC
Permalink
Wow, thanks James, lots of things of to try here. .

For what I'm doing; I think I may want the clicking artifacts included. So
doing the below appears to be working for now :)


(
{
1000.do{arg i;

a = Synth(\sinegrain3);
[0.0025+(1.0.rand*0.2598)].choose.wait;
a.free;
};
}.fork
)


Cheers guys! Many thanks. .
--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/Restricting-synths-voices-in-Supercollider-tp5037488p5040053.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

_______________________________________________
sc-users mailing list

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