Multiply operation on a mapped argument

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

Multiply operation on a mapped argument

eobrien
Hi,

If I have a synthdef which outputs values from 0 - 1,  Is there a way to multiply the values depending on which argument is mapped to read them.

i.e. If freq is mapped then multiply by 20000, if multiply is mapped multiple by 1 etc ...

Is there a way to do this, either when mapping or inside the synthdef whose argument is being mapped ?

Thanks,
Enda.
Reply | Threaded
Open this post in threaded view
|

Re: Multiply operation on a mapped argument

ddw_music
eobrien wrote
If I have a synthdef which outputs values from 0 - 1,  Is there a way to multiply the values depending on which argument is mapped to read them.

i.e. If freq is mapped then multiply by 20000, if multiply is mapped multiple by 1 etc ...

Is there a way to do this, either when mapping or inside the synthdef whose argument is being mapped ?
If a Synth argument is mapped to a bus, the input will be directly from the bus. But, after the input reaches the target synth, you can do any math on it that you need, no problem.

That is, "when mapping" -- no, you can't. "Inside the synthdef whose argument is being mapped" -- yes, write it into that SynthDef (within the function).

hjh
Reply | Threaded
Open this post in threaded view
|

Re: Multiply operation on a mapped argument

eobrien
Thanks for this. I get that I can do the math in the synthdef, the question is more about whether I can do the math only if the argument is mapped. So if freq is mapped the multiply happens but I can call set on the argument with freq=20000 and there is no multiply. I was thinkin there might be a way from inside the synthdef to check if the argument is mapped.
Reply | Threaded
Open this post in threaded view
|

Re: Multiply operation on a mapped argument

ddw_music
eobrien wrote
Thanks for this. I get that I can do the math in the synthdef, the question is more about whether I can do the math only if the argument is mapped. So if freq is mapped the multiply happens but I can call set on the argument with freq=20000 and there is no multiply. I was thinkin there might be a way from inside the synthdef to check if the argument is mapped.
I don't think there is... inside the SynthDef, it's just a signal consisting of floats. There's no way to mark floats as "mapped" or "not mapped."

Maybe the best way is to have a control bus for the original modulator signal, and grab a new control bus for each range mapping, and map the synth to the second bus. Control buses are cheap. There's no need to conserve them.

hjh
Reply | Threaded
Open this post in threaded view
|

Re: Multiply operation on a mapped argument

daniel-mayer

Am 18.05.2017 um 17:11 schrieb [hidden email]:

> eobrien wrote
>> Thanks for this. I get that I can do the math in the synthdef, the
>> question is more about whether I can do the math only if the argument is
>> mapped. So if freq is mapped the multiply happens but I can call set on
>> the argument with freq=20000 and there is no multiply. I was thinkin there
>> might be a way from inside the synthdef to check if the argument is
>> mapped.
>
> I don't think there is... inside the SynthDef, it's just a signal consisting
> of floats. There's no way to mark floats as "mapped" or "not mapped."
>
> Maybe the best way is to have a control bus for the original modulator
> signal, and grab a new control bus for each range mapping, and map the synth
> to the second bus. Control buses are cheap. There's no need to conserve
> them.


Interesting problem, I thought about a similar solution: One could write a 'specMap' method or Function that reserves the second bus, maps to it and introduces an intermediate mapping synth, which uses ControlSpec.map for ugens (see last example of ControlSpec help example section). The ControlSpec would be the global spec stored for that argument name or a new passed one. Some bookkeeping would be required though (unmapping: freeing buses and synths etc.)

I wonder if there isn't something existing yet in JITlib world, I would have expected it, at least such a demand sounds very reasonable to be implemented in there.

Regards

Daniel

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



_______________________________________________
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: Multiply operation on a mapped argument

eobrien
The Spec map idea is interesting, its not something I'm familiar with, also I am trying to get this to run in a android application so I am limited to loading synths and controlling them with some very basic OSC messages.

The idea I have at the moment is to use an extra argument in the synth for the multiply, and setting this before doing the map and unsetting when doing unmap. I was hoping for something built in to the language, like a mul argument on the map for example.



On Thu, May 18, 2017 at 10:26 PM, daniel-mayer [via New SuperCollider Mailing Lists Forums (Use These!!!)] <[hidden email]> wrote:

Am 18.05.2017 um 17:11 schrieb [hidden email]:

> eobrien wrote
>> Thanks for this. I get that I can do the math in the synthdef, the
>> question is more about whether I can do the math only if the argument is
>> mapped. So if freq is mapped the multiply happens but I can call set on
>> the argument with freq=20000 and there is no multiply. I was thinkin there
>> might be a way from inside the synthdef to check if the argument is
>> mapped.
>
> I don't think there is... inside the SynthDef, it's just a signal consisting
> of floats. There's no way to mark floats as "mapped" or "not mapped."
>
> Maybe the best way is to have a control bus for the original modulator
> signal, and grab a new control bus for each range mapping, and map the synth
> to the second bus. Control buses are cheap. There's no need to conserve
> them.

Interesting problem, I thought about a similar solution: One could write a 'specMap' method or Function that reserves the second bus, maps to it and introduces an intermediate mapping synth, which uses ControlSpec.map for ugens (see last example of ControlSpec help example section). The ControlSpec would be the global spec stored for that argument name or a new passed one. Some bookkeeping would be required though (unmapping: freeing buses and synths etc.)

I wonder if there isn't something existing yet in JITlib world, I would have expected it, at least such a demand sounds very reasonable to be implemented in there.

Regards

Daniel

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



_______________________________________________
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/



To unsubscribe from Multiply operation on a mapped argument, click here.
NAML