Quantcast

multichannel mapping?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

multichannel mapping?

mousaique
hello list,

when for example, trying to map 

SinOsc.ar(10*Array.fill(8,{arg i; (i+1)}))

through a multichannel bus onto another synth using 8 channels (c = Bus.audio(s,8)),

the expanded sinosc doesnt seemt "arrive"as an array (when polling it instead reads 8 fixed outputproxy values)...

is there something to take into special account when using multichannel busses with the .asMap method in a Pbind?

many thanks,
jan


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: multichannel mapping?

lfsaw
Dear jan,

I am not dure I understand your question...

Could you write a small example snippet (possibly with comments on where things do not work as you expect them to work)?


cheers
        Till


> On 09. May 2017, at 13:54, [hidden email] wrote:
>
> hello list,
>
> when for example, trying to map
>
> SinOsc.ar(10*Array.fill(8,{arg i; (i+1)}))
>
> through a multichannel bus onto another synth using 8 channels (c = Bus.audio(s,8)),
>
> the expanded sinosc doesnt seemt "arrive"as an array (when polling it instead reads 8 fixed outputproxy values)...
>
> is there something to take into special account when using multichannel busses with the .asMap method in a Pbind?
>
> many thanks,
> jan
>
>


_______________________________________________
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
|  
Report Content as Inappropriate

Re: multichannel mapping?

mousaique
Hi Till,
thanks for the answer!
so heres the simplified setup (please dont mind eventual code clumsiness:))
the question relates to why the multichannel expanded SinOsc in the control synth doesnt seem to apply the expansion on the "target" synth. i expect to hear 8 differently modulated sinewaves instead of an equal modulation frequency common to all ..
i assume this has something to do with the mapping/busses, im unsure what it is exactly though?
many thanks for helping out!
jan


(
a= Bus.audio(s,8);

SynthDef(\synth1,    { arg mod,out,dur,freq;
var env= EnvGen.ar(Env.sine(1),Impulse.ar(0), timeScale:dur,doneAction:2);
var array=Array.fill(8, {arg i; 1*(i+1)});
var sound= SinOsc.ar(mod*freq*array,0,0.1);      
Out.ar(out,sound*env);
}).add;


SynthDef(\control, { | controlfreq|
var array=Array.fill(8, {arg i; 1*(i+1)});
Out.ar(a,SinOsc.ar(controlfreq*array));

}).add;
)

(
p = Pspawner {|sp|
loop {
sp.par(
Pbind(
\instrument, \synth1,
\out, 0,
\mod, a.asMap,
\dur,  ~delta,
 \freq, Pseq([~freq]),
)
);~delta.wait}};

v = VarGui([
dur: [0, 1, \lin, 0, 1],
delta: [0.1, 1, \lin, 0, 1],
freq: [0.001,2000, \exp, 0.0001, 1000],
],[

controlfreq: [0.001,2000, \exp, 0.0001, 1],
],
p, \control,

).gui(tryColumnNum: 1,sliderPriority: \synth, playerPriority: \synth);
)

On Sat, May 20, 2017 at 5:59 PM, <[hidden email]> wrote:
Dear jan,

I am not dure I understand your question...

Could you write a small example snippet (possibly with comments on where things do not work as you expect them to work)?


cheers
        Till


> On 09. May 2017, at 13:54, [hidden email] wrote:
>
> hello list,
>
> when for example, trying to map
>
> SinOsc.ar(10*Array.fill(8,{arg i; (i+1)}))
>
> through a multichannel bus onto another synth using 8 channels (c = Bus.audio(s,8)),
>
> the expanded sinosc doesnt seemt "arrive"as an array (when polling it instead reads 8 fixed outputproxy values)...
>
> is there something to take into special account when using multichannel busses with the .asMap method in a Pbind?
>
> many thanks,
> jan
>
>


_______________________________________________
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
|  
Report Content as Inappropriate

Re: multichannel mapping?

daniel-mayer

Am 21.05.2017 um 12:08 schrieb [hidden email]:

> Hi Till,
> thanks for the answer!
> so heres the simplified setup (please dont mind eventual code clumsiness:))
> the question relates to why the multichannel expanded SinOsc in the control synth doesnt seem to apply the expansion on the "target" synth. i expect to hear 8 differently modulated sinewaves instead of an equal modulation frequency common to all ..
> i assume this has something to do with the mapping/busses, im unsure what it is exactly though?


Hi,

some points coming together here:
first you need an array argument 'mod' in synth1,
now only one modulator signal can be taken over,
which is what you hear.

Secondly automatic multichannel mapping is not supported yet, see this thread:

http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/multichannel-busses-td6314991.html#a6315389


Third, the mapping symbols passed from a Pbind need to get an extra bracket, e.g. see "Event patterns and array args" in miSCellaneous lib.


It could look like this:


(
a= Bus.audio(s,8);

// If you don't like the #[...] syntax see NamedControl

SynthDef(\synth1,    { arg mod = #[1,1,1,1,1,1,1,1],out,dur,freq;
        var env= EnvGen.ar(Env.sine(1),Impulse.ar(0), timeScale:dur,doneAction:2);
        var array=Array.fill(8, {arg i; 1*(i+1)});
        var sound= SinOsc.ar(mod*freq*array,0,0.1);
        Out.ar(out,sound*env);
}).add;


SynthDef(\control, { | controlfreq|
        var array=Array.fill(8, {arg i; 1*(i+1)});
        Out.ar(a,SinOsc.ar(controlfreq*array));

}).add;
)

(
p = Pspawner {|sp|
        loop {
                sp.par(
                        Pbind(
                                \instrument, \synth1,
                                \out, 0,
                                // because of (2) and (3) above:
                                \mod, [(0..7).collect { |i| a.subBus(i).asMap }],
                                \dur,  ~delta,
                                \freq, Pseq([~freq]),
                        )
);~delta.wait}};

v = VarGui([
        dur: [0, 1, \lin, 0, 1],
        delta: [0.1, 1, \lin, 0, 1],
        freq: [0.001,2000, \exp, 0.0001, 1000],
],[

        controlfreq: [0.001,2000, \exp, 0.0001, 1],
],
p, \control,

).gui(tryColumnNum: 1,sliderPriority: \synth, playerPriority: \synth);
)


hope that helps, regards

Daniel

----------------------------------------------------
http://daniel-mayer.at/software_en.htm
----------------------------------------------------




_______________________________________________
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
|  
Report Content as Inappropriate

Re: multichannel mapping?

mousaique
hi daniel,
thank you so much! 
a question regarding your example: since im trying to keep arrays in the language-side, what would be the alternative to declaring the array arg 
mod = #[1,1,1,1,1,1,1,1] in the synthdef in favor of doing so in the pbind? (normally i avoid declaring arrays in the synthdefs themselves, mistakenly i did so in the code snippet)...
greetings,
jan

On Sun, May 21, 2017 at 8:24 PM, <[hidden email]> wrote:

Am 21.05.2017 um 12:08 schrieb [hidden email]:

> Hi Till,
> thanks for the answer!
> so heres the simplified setup (please dont mind eventual code clumsiness:))
> the question relates to why the multichannel expanded SinOsc in the control synth doesnt seem to apply the expansion on the "target" synth. i expect to hear 8 differently modulated sinewaves instead of an equal modulation frequency common to all ..
> i assume this has something to do with the mapping/busses, im unsure what it is exactly though?


Hi,

some points coming together here:
first you need an array argument 'mod' in synth1,
now only one modulator signal can be taken over,
which is what you hear.

Secondly automatic multichannel mapping is not supported yet, see this thread:

http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/multichannel-busses-td6314991.html#a6315389


Third, the mapping symbols passed from a Pbind need to get an extra bracket, e.g. see "Event patterns and array args" in miSCellaneous lib.


It could look like this:


(
a= Bus.audio(s,8);

// If you don't like the #[...] syntax see NamedControl

SynthDef(\synth1,    { arg mod = #[1,1,1,1,1,1,1,1],out,dur,freq;
        var env= EnvGen.ar(Env.sine(1),Impulse.ar(0), timeScale:dur,doneAction:2);
        var array=Array.fill(8, {arg i; 1*(i+1)});
        var sound= SinOsc.ar(mod*freq*array,0,0.1);
        Out.ar(out,sound*env);
}).add;


SynthDef(\control, { | controlfreq|
        var array=Array.fill(8, {arg i; 1*(i+1)});
        Out.ar(a,SinOsc.ar(controlfreq*array));

}).add;
)

(
p = Pspawner {|sp|
        loop {
                sp.par(
                        Pbind(
                                \instrument, \synth1,
                                \out, 0,
                                // because of (2) and (3) above:
                                \mod, [(0..7).collect { |i| a.subBus(i).asMap }],
                                \dur,  ~delta,
                                \freq, Pseq([~freq]),
                        )
);~delta.wait}};

v = VarGui([
        dur: [0, 1, \lin, 0, 1],
        delta: [0.1, 1, \lin, 0, 1],
        freq: [0.001,2000, \exp, 0.0001, 1000],
],[

        controlfreq: [0.001,2000, \exp, 0.0001, 1],
],
p, \control,

).gui(tryColumnNum: 1,sliderPriority: \synth, playerPriority: \synth);
)


hope that helps, regards

Daniel

----------------------------------------------------
http://daniel-mayer.at/software_en.htm
----------------------------------------------------

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: multichannel mapping?

daniel-mayer

Am 22.05.2017 um 00:58 schrieb [hidden email]:

hi daniel,
thank you so much! 
a question regarding your example: since im trying to keep arrays in the language-side, what would be the alternative to declaring the array arg 
mod = #[1,1,1,1,1,1,1,1] in the synthdef in favor of doing so in the pbind? (normally i avoid declaring arrays in the synthdefs themselves, mistakenly i did so in the code snippet)...


See NamedControl, this is also described in the tutorial,

e.g.

var mod = NamedControl.ar(\mod, 1!8);

or

var mod = \mod.ar(1!8);

BTW, now as I write NamedControl.ar it comes to my mind: as you do FM, better define an audio rate input,
with default control input as in the original example you get aliasing with higher freqs.


Greetings

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: multichannel mapping?

ddw_music
In reply to this post by mousaique
Jan Ferreira wrote
hi daniel,
thank you so much!
a question regarding your example: since im trying to keep arrays in the
language-side, what would be the alternative to declaring the array arg
mod = #[1,1,1,1,1,1,1,1] in the synthdef in favor of doing so in the
pbind? (normally
i avoid declaring arrays in the synthdefs themselves, mistakenly i did so
in the code snippet)...
If you wish to pass an array into a synth, then you must make room for the array within the SynthDef by declaring an array input. That's not optional. Otherwise it will be a single-channel input.

Both #[...] and NamedControl are valid ways to create array inputs.

hjh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: multichannel mapping?

mousaique
i see. thank you both!

On Mon, May 22, 2017 at 6:39 AM, <[hidden email]> wrote:
Jan Ferreira wrote
> hi daniel,
> thank you so much!
> a question regarding your example: since im trying to keep arrays in the
> language-side, what would be the alternative to declaring the array arg
> mod = #[1,1,1,1,1,1,1,1] in the synthdef in favor of doing so in the
> pbind? (normally
> i avoid declaring arrays in the synthdefs themselves, mistakenly i did so
> in the code snippet)...

If you wish to pass an array into a synth, then you must make room for the
array within the SynthDef by declaring an array input. That's not optional.
Otherwise it will be a single-channel input.

Both #[...] and NamedControl are valid ways to create array inputs.

hjh



--
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/multichannel-mapping-tp7632209p7632540.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.

Loading...