How to use NodeProxies in array?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use NodeProxies in array?

NoDefault
Do you know any way to apply proxies more dinamically in arrays, collections or something?

// For example

p = ProxySpace.push(s.boot);
(
~s = nil!2;
~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
~s[0].play;
~s[1] = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
~s[1].play;

// Then be able to change: 
~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);

)


Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

julian.rohrhuber
It is very easy:

a = Array.fill(8, { NodeProxy.new });

a[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
a[5].play;

a[5].source = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);


So you don’t need a ProxySpace for that really.

If you don’t push a ProxySpace, you can just use the current environment:

~array = Array.fill(8, { NodeProxy.new });

~array[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };

and so on.


> On 10.07.2017, at 06:15, [hidden email] wrote:
>
> Do you know any way to apply proxies more dinamically in arrays, collections or something?
>
> // For example
>
> p =
> ProxySpace
> .push(s.boot);
> (
> ~s = nil!2;
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
> ~s[0].play;
> ~s[1] = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
> ~s[1].play;
>
> // Then be able to change:
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);
>
> )
>
>
>


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

bandrewskey
I am trying to do something similar but running into trouble when I try to assign multichannel controls.  I'm trying to use frequency and amplitude data from six audio inputs to control synths on node proxies.  There is something major that I'm missing when it comes to multichannel mapping but I haven't been able to figure it out from the help file yet.  Can I map an array to another array without being explicit with each index?

//get freq and amp data
(
~gfreq = NodeProxy.new(s,\control, 6, 6);
~gfreq[0] = {Tartini.kr(SoundIn.ar(3))};
~gfreq[1] = {Tartini.kr(SoundIn.ar(4))};
~gfreq[2] = {Tartini.kr(SoundIn.ar(5))};
~gfreq[3] = {Tartini.kr(SoundIn.ar(6))};
~gfreq[4] = {Tartini.kr(SoundIn.ar(7))};
~gfreq[5] = {Tartini.kr(SoundIn.ar(8))};

~gamp = NodeProxy.new(s, \control, 6, 6);
~gamp[0] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(3), atk, rel, 0.9)};
~gamp[1] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(4), atk, rel, 0.9)};
~gamp[2] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(5), atk, rel, 0.9)};
~gamp[3] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(6), atk, rel, 0.9)};
~gamp[4] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(7), atk, rel, 0.9)};
~gamp[5] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(8), atk, rel, 0.9)};
)

//create synths, assign controls

~x = Array.fill(6, {NodeProxy.new(s, \audio)});
~x.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 };

~x.map(\freq, ~gfreq, \amp, ~gamp);

~x.play;
~x.stop;


From this I get "WARNING: Can't monitor a control rate bus."

On Sun, Jul 9, 2017 at 11:50 PM, <[hidden email]> wrote:
It is very easy:

a = Array.fill(8, { NodeProxy.new });

a[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
a[5].play;

a[5].source = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);


So you don’t need a ProxySpace for that really.

If you don’t push a ProxySpace, you can just use the current environment:

~array = Array.fill(8, { NodeProxy.new });

~array[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };

and so on.


> On 10.07.2017, at 06:15, [hidden email] wrote:
>
> Do you know any way to apply proxies more dinamically in arrays, collections or something?
>
> // For example
>
> p =
> ProxySpace
> .push(s.boot);
> (
> ~s = nil!2;
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
> ~s[0].play;
> ~s[1] = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
> ~s[1].play;
>
> // Then be able to change:
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);
>
> )
>
>
>


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

ddw_music
Andrew Blandrew wrote
//get freq and amp data
(
~gfreq = NodeProxy.new(s,\control, 6, 6);
~gfreq[0] = {Tartini.kr(SoundIn.ar(3))};
~gfreq[1] = {Tartini.kr(SoundIn.ar(4))};
~gfreq[2] = {Tartini.kr(SoundIn.ar(5))};
~gfreq[3] = {Tartini.kr(SoundIn.ar(6))};
~gfreq[4] = {Tartini.kr(SoundIn.ar(7))};
~gfreq[5] = {Tartini.kr(SoundIn.ar(8))};
The indices on a node proxy are not channel indices. They allow you to assign multiple sources to the same proxy, and the sources are summed to produce the final output. So this is totally the wrong approach to get parallel channels.

Also note that Tartini produces two outputs, so you need 12 channels for 6 of them.

For parallel channels, you should write one source that outputs an array. Here, I'll use multichannel expansion:

~gfreq = {
    Tartini.kr(SoundIn.ar((3..8))).flat
}

And you should get [freq3, confidence3, freq4, confidence4...].

hjh
Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

user_weego
In reply to this post by bandrewskey
So after following James' correction here, the next error comes up with ~x. It's currently an Array of NodeProxies, you are treating it as a single NodePx. 

if u want 6 of them, write this form
x.do(_.play);
To assign the commands to all Proxies of the Array. 
Also, 
~x.do(_.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 });
Should work. 
Not sure about the mapping: 
~x.do_.map(\freq, ~gfreq, \amp, ~gamp));

But maybe you just want one Sine cluster? 


lG, 
Hannes

typed this on a "smart" keypad. 

On Jul 25, 2017, at 23:00, [hidden email] wrote:

I am trying to do something similar but running into trouble when I try to assign multichannel controls.  I'm trying to use frequency and amplitude data from six audio inputs to control synths on node proxies.  There is something major that I'm missing when it comes to multichannel mapping but I haven't been able to figure it out from the help file yet.  Can I map an array to another array without being explicit with each index?

//get freq and amp data
(
~gfreq = NodeProxy.new(s,\control, 6, 6);
~gfreq[0] = {Tartini.kr(SoundIn.ar(3))};
~gfreq[1] = {Tartini.kr(SoundIn.ar(4))};
~gfreq[2] = {Tartini.kr(SoundIn.ar(5))};
~gfreq[3] = {Tartini.kr(SoundIn.ar(6))};
~gfreq[4] = {Tartini.kr(SoundIn.ar(7))};
~gfreq[5] = {Tartini.kr(SoundIn.ar(8))};

~gamp = NodeProxy.new(s, \control, 6, 6);
~gamp[0] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(3), atk, rel, 0.9)};
~gamp[1] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(4), atk, rel, 0.9)};
~gamp[2] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(5), atk, rel, 0.9)};
~gamp[3] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(6), atk, rel, 0.9)};
~gamp[4] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(7), atk, rel, 0.9)};
~gamp[5] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(8), atk, rel, 0.9)};
)

//create synths, assign controls

~x = Array.fill(6, {NodeProxy.new(s, \audio)});
~x.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 };

~x.map(\freq, ~gfreq, \amp, ~gamp);

~x.play;
~x.stop;


From this I get "WARNING: Can't monitor a control rate bus."

On Sun, Jul 9, 2017 at 11:50 PM, <[hidden email]> wrote:
It is very easy:

a = Array.fill(8, { NodeProxy.new });

a[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
a[5].play;

a[5].source = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);


So you don’t need a ProxySpace for that really.

If you don’t push a ProxySpace, you can just use the current environment:

~array = Array.fill(8, { NodeProxy.new });

~array[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };

and so on.


> On 10.07.2017, at 06:15, [hidden email] wrote:
>
> Do you know any way to apply proxies more dinamically in arrays, collections or something?
>
> // For example
>
> p =
> ProxySpace
> .push(s.boot);
> (
> ~s = nil!2;
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
> ~s[0].play;
> ~s[1] = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
> ~s[1].play;
>
> // Then be able to change:
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);
>
> )
>
>
>


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

bandrewskey
Awesome!  Thanks for helping me simplify things.  Looking into the mapping still; from other threads it looks as though mapping multichannel controls may be unsupported.  Ultimately I'm just trying to figure out how to take the output of a hexaphonic pickup and use it to control synths in hopefully the least cumbersome way, so your tips are greatly appreciated.

On Tue, Jul 25, 2017 at 3:01 PM, <[hidden email]> wrote:
So after following James' correction here, the next error comes up with ~x. It's currently an Array of NodeProxies, you are treating it as a single NodePx. 

if u want 6 of them, write this form
x.do(_.play);
To assign the commands to all Proxies of the Array. 
Also, 
~x.do(_.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 });
Should work. 
Not sure about the mapping: 
~x.do_.map(\freq, ~gfreq, \amp, ~gamp));

But maybe you just want one Sine cluster? 


lG, 
Hannes

typed this on a "smart" keypad. 

On Jul 25, 2017, at 23:00, [hidden email] wrote:

I am trying to do something similar but running into trouble when I try to assign multichannel controls.  I'm trying to use frequency and amplitude data from six audio inputs to control synths on node proxies.  There is something major that I'm missing when it comes to multichannel mapping but I haven't been able to figure it out from the help file yet.  Can I map an array to another array without being explicit with each index?

//get freq and amp data
(
~gfreq = NodeProxy.new(s,\control, 6, 6);
~gfreq[0] = {Tartini.kr(SoundIn.ar(3))};
~gfreq[1] = {Tartini.kr(SoundIn.ar(4))};
~gfreq[2] = {Tartini.kr(SoundIn.ar(5))};
~gfreq[3] = {Tartini.kr(SoundIn.ar(6))};
~gfreq[4] = {Tartini.kr(SoundIn.ar(7))};
~gfreq[5] = {Tartini.kr(SoundIn.ar(8))};

~gamp = NodeProxy.new(s, \control, 6, 6);
~gamp[0] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(3), atk, rel, 0.9)};
~gamp[1] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(4), atk, rel, 0.9)};
~gamp[2] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(5), atk, rel, 0.9)};
~gamp[3] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(6), atk, rel, 0.9)};
~gamp[4] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(7), atk, rel, 0.9)};
~gamp[5] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(8), atk, rel, 0.9)};
)

//create synths, assign controls

~x = Array.fill(6, {NodeProxy.new(s, \audio)});
~x.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 };

~x.map(\freq, ~gfreq, \amp, ~gamp);

~x.play;
~x.stop;


From this I get "WARNING: Can't monitor a control rate bus."

On Sun, Jul 9, 2017 at 11:50 PM, <[hidden email]> wrote:
It is very easy:

a = Array.fill(8, { NodeProxy.new });

a[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
a[5].play;

a[5].source = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);


So you don’t need a ProxySpace for that really.

If you don’t push a ProxySpace, you can just use the current environment:

~array = Array.fill(8, { NodeProxy.new });

~array[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };

and so on.


> On 10.07.2017, at 06:15, [hidden email] wrote:
>
> Do you know any way to apply proxies more dinamically in arrays, collections or something?
>
> // For example
>
> p =
> ProxySpace
> .push(s.boot);
> (
> ~s = nil!2;
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
> ~s[0].play;
> ~s[1] = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
> ~s[1].play;
>
> // Then be able to change:
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);
>
> )
>
>
>


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

user_weego
Hi hexaphonist:)

If it may be a little less modular, you can certainly hard-code the control data buses into your synth (in case the mapping should fail, which I don't see a reason for).
E. g. 
Ndef(\sine6, {SinOsc.ar(Ndef(\freqs).kr(6), 0, Ndef(\ampz).kr(6) )}.play;

This works with any JITLib-style signals. 
If I was ever sitting on a laptop, I could paste together a working example instead of this dry-swimming stuff:)

lG, 
Hannes

typed this on a "smart" keypad. 

On Jul 26, 2017, at 08:55, [hidden email] wrote:

Awesome!  Thanks for helping me simplify things.  Looking into the mapping still; from other threads it looks as though mapping multichannel controls may be unsupported.  Ultimately I'm just trying to figure out how to take the output of a hexaphonic pickup and use it to control synths in hopefully the least cumbersome way, so your tips are greatly appreciated.

On Tue, Jul 25, 2017 at 3:01 PM, <[hidden email]> wrote:
So after following James' correction here, the next error comes up with ~x. It's currently an Array of NodeProxies, you are treating it as a single NodePx. 

if u want 6 of them, write this form
x.do(_.play);
To assign the commands to all Proxies of the Array. 
Also, 
~x.do(_.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 });
Should work. 
Not sure about the mapping: 
~x.do_.map(\freq, ~gfreq, \amp, ~gamp));

But maybe you just want one Sine cluster? 


lG, 
Hannes

typed this on a "smart" keypad. 

On Jul 25, 2017, at 23:00, [hidden email] wrote:

I am trying to do something similar but running into trouble when I try to assign multichannel controls.  I'm trying to use frequency and amplitude data from six audio inputs to control synths on node proxies.  There is something major that I'm missing when it comes to multichannel mapping but I haven't been able to figure it out from the help file yet.  Can I map an array to another array without being explicit with each index?

//get freq and amp data
(
~gfreq = NodeProxy.new(s,\control, 6, 6);
~gfreq[0] = {Tartini.kr(SoundIn.ar(3))};
~gfreq[1] = {Tartini.kr(SoundIn.ar(4))};
~gfreq[2] = {Tartini.kr(SoundIn.ar(5))};
~gfreq[3] = {Tartini.kr(SoundIn.ar(6))};
~gfreq[4] = {Tartini.kr(SoundIn.ar(7))};
~gfreq[5] = {Tartini.kr(SoundIn.ar(8))};

~gamp = NodeProxy.new(s, \control, 6, 6);
~gamp[0] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(3), atk, rel, 0.9)};
~gamp[1] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(4), atk, rel, 0.9)};
~gamp[2] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(5), atk, rel, 0.9)};
~gamp[3] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(6), atk, rel, 0.9)};
~gamp[4] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(7), atk, rel, 0.9)};
~gamp[5] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(8), atk, rel, 0.9)};
)

//create synths, assign controls

~x = Array.fill(6, {NodeProxy.new(s, \audio)});
~x.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 };

~x.map(\freq, ~gfreq, \amp, ~gamp);

~x.play;
~x.stop;


From this I get "WARNING: Can't monitor a control rate bus."

On Sun, Jul 9, 2017 at 11:50 PM, <[hidden email]> wrote:
It is very easy:

a = Array.fill(8, { NodeProxy.new });

a[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
a[5].play;

a[5].source = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);


So you don’t need a ProxySpace for that really.

If you don’t push a ProxySpace, you can just use the current environment:

~array = Array.fill(8, { NodeProxy.new });

~array[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };

and so on.


> On 10.07.2017, at 06:15, [hidden email] wrote:
>
> Do you know any way to apply proxies more dinamically in arrays, collections or something?
>
> // For example
>
> p =
> ProxySpace
> .push(s.boot);
> (
> ~s = nil!2;
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
> ~s[0].play;
> ~s[1] = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
> ~s[1].play;
>
> // Then be able to change:
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);
>
> )
>
>
>


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/


Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

bandrewskey
Sorry to revive such an old thread (life, procrastination, etc.). I wanted to make sure I'm on the right track and maybe get some advice on how to map just the frequency data (and not hasFreq from Tartini) under ~gfreq in the following:


(
   //Set Server Options and boot server
    o = Server.local.options;
    o.numInputBusChannels = 16;
    o.numOutputBusChannels = 6;
    s.boot;
)
(
    s.meter;
    s.plotTree;
)

/*The goal here is to take the audio from a hexaphonic pickup (each guitar string has its own output), translate the audio into frequency and amplitude control data and apply these controls to synths in a hopefully modular, efficient and easy manner. Ideally the set up would allow for the guitar to control several different independent voices simultaneously without having to run more than 6 Tartini and 6 Amplitude ugens at any given time (get the data once then use it).*/

//get frequency and amplitude from each string in a hexaphonic guitar pickup

~g = {SoundIn.ar((2..7))}; //raw string audio from inputs 3-8 on hardware interface
~g.bus;// 6 channels
~g.mold(1).play(0,2);//sounds dry and uninteresting
~g.stop;

//by the way, in case anyone is interested, I got my pickup from this guy: http://www.ubertar.com/hexaphonic/


~gfreq = {Tartini.kr(~g).flat}; //set up array of Tartinis using ~g audio
~gfreq.bus; // 12 channels
//how to strip away every other output in the array so we're just left with 6 freqs?


~gamp = {Amplitude.kr(~g)}; //set up array of Amplitudes using ~g audio
~gamp.bus; //6 channels

//a simple voicing spanning 6 channels
/*let me know if I haven't quite got this right... I feel like when I ~y.play; I should have to specify that it all goes to one output bus but it seems to be doing that automatically which makes me think I might have some unintentional wrapping going on*/
(
~y = {arg freq=#[200,300,500,800,1300,2100];
    SinOsc.ar(freq + SinOsc.kr(1,0,20),0,~gamp)
};
)
~y.play;
~y.stop;
//now how to map just the freq data (and not hasFreq) from ~gfreq?

~y.clear;

On Wed, Jul 26, 2017 at 1:20 AM, <[hidden email]> wrote:
Hi hexaphonist:)

If it may be a little less modular, you can certainly hard-code the control data buses into your synth (in case the mapping should fail, which I don't see a reason for).
E. g. 
Ndef(\sine6, {SinOsc.ar(Ndef(\freqs).kr(6), 0, Ndef(\ampz).kr(6) )}.play;

This works with any JITLib-style signals. 
If I was ever sitting on a laptop, I could paste together a working example instead of this dry-swimming stuff:)

lG, 
Hannes

typed this on a "smart" keypad. 

On Jul 26, 2017, at 08:55, [hidden email] wrote:

Awesome!  Thanks for helping me simplify things.  Looking into the mapping still; from other threads it looks as though mapping multichannel controls may be unsupported.  Ultimately I'm just trying to figure out how to take the output of a hexaphonic pickup and use it to control synths in hopefully the least cumbersome way, so your tips are greatly appreciated.

On Tue, Jul 25, 2017 at 3:01 PM, <[hidden email]> wrote:
So after following James' correction here, the next error comes up with ~x. It's currently an Array of NodeProxies, you are treating it as a single NodePx. 

if u want 6 of them, write this form
x.do(_.play);
To assign the commands to all Proxies of the Array. 
Also, 
~x.do(_.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 });
Should work. 
Not sure about the mapping: 
~x.do_.map(\freq, ~gfreq, \amp, ~gamp));

But maybe you just want one Sine cluster? 


lG, 
Hannes

typed this on a "smart" keypad. 

On Jul 25, 2017, at 23:00, [hidden email] wrote:

I am trying to do something similar but running into trouble when I try to assign multichannel controls.  I'm trying to use frequency and amplitude data from six audio inputs to control synths on node proxies.  There is something major that I'm missing when it comes to multichannel mapping but I haven't been able to figure it out from the help file yet.  Can I map an array to another array without being explicit with each index?

//get freq and amp data
(
~gfreq = NodeProxy.new(s,\control, 6, 6);
~gfreq[0] = {Tartini.kr(SoundIn.ar(3))};
~gfreq[1] = {Tartini.kr(SoundIn.ar(4))};
~gfreq[2] = {Tartini.kr(SoundIn.ar(5))};
~gfreq[3] = {Tartini.kr(SoundIn.ar(6))};
~gfreq[4] = {Tartini.kr(SoundIn.ar(7))};
~gfreq[5] = {Tartini.kr(SoundIn.ar(8))};

~gamp = NodeProxy.new(s, \control, 6, 6);
~gamp[0] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(3), atk, rel, 0.9)};
~gamp[1] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(4), atk, rel, 0.9)};
~gamp[2] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(5), atk, rel, 0.9)};
~gamp[3] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(6), atk, rel, 0.9)};
~gamp[4] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(7), atk, rel, 0.9)};
~gamp[5] = {arg atk=0.02, rel=1.5; Amplitude.kr(SoundIn.ar(8), atk, rel, 0.9)};
)

//create synths, assign controls

~x = Array.fill(6, {NodeProxy.new(s, \audio)});
~x.source = { arg freq=#[500,500,500,500,500,500], amp =#[0.3,0.3,0.3,0.3,0.3,0.3]; SinOsc.ar(freq, 0, amp) * 0.1 };

~x.map(\freq, ~gfreq, \amp, ~gamp);

~x.play;
~x.stop;


From this I get "WARNING: Can't monitor a control rate bus."

On Sun, Jul 9, 2017 at 11:50 PM, <[hidden email]> wrote:
It is very easy:

a = Array.fill(8, { NodeProxy.new });

a[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
a[5].play;

a[5].source = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);


So you don’t need a ProxySpace for that really.

If you don’t push a ProxySpace, you can just use the current environment:

~array = Array.fill(8, { NodeProxy.new });

~array[5].source = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };

and so on.


> On 10.07.2017, at 06:15, [hidden email] wrote:
>
> Do you know any way to apply proxies more dinamically in arrays, collections or something?
>
> // For example
>
> p =
> ProxySpace
> .push(s.boot);
> (
> ~s = nil!2;
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([1],inf)],inf),\amp,1);
> ~s[0].play;
> ~s[1] = { Pulse.ar(130, Saw.kr(0.3)) * 0.1 };
> ~s[1].play;
>
> // Then be able to change:
> ~s[0] = Pbind(\instrument,\default,\dur,Pseq([0.5,Pseq([0.25],inf)],inf),\amp,1);
>
> )
>
>
>


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/



Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

julian.rohrhuber

> On 07.01.2018, at 04:17, [hidden email] wrote:
>
> ~gfreq = {Tartini.kr(~g).flat}; //set up array of Tartinis using ~g audio
> ~gfreq.bus; // 12 channels
> //how to strip away every other output in the array so we're just left with 6 freqs?

the tartini of an array is an array of tartinis

the ugen output of an array is an array of ugen outputs
an array ugen output of an array is an array of arrays of ugen outputs
to select only some elements of an array’s arrays, collect it

~gfreq = { Tartini.kr(~g).collect { |x| x[0] } };

or:

~gfreq = { Tartini.kr(~g).collect { |x| x.first } };

or:

~gfreq = { Tartini.kr(~g).collect(_.first) };

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to use NodeProxies in array?

bandrewskey
Awesome, that clarified a lot for me.  Thanks so much!

On Mon, Jan 8, 2018 at 2:12 PM, <[hidden email]> wrote:

> On 07.01.2018, at 04:17, [hidden email] wrote:
>
> ~gfreq = {Tartini.kr(~g).flat}; //set up array of Tartinis using ~g audio
> ~gfreq.bus; // 12 channels
> //how to strip away every other output in the array so we're just left with 6 freqs?

the tartini of an array is an array of tartinis

the ugen output of an array is an array of ugen outputs
an array ugen output of an array is an array of arrays of ugen outputs
to select only some elements of an array’s arrays, collect it

~gfreq = { Tartini.kr(~g).collect { |x| x[0] } };

or:

~gfreq = { Tartini.kr(~g).collect { |x| x.first } };

or:

~gfreq = { Tartini.kr(~g).collect(_.first) };