Page 1 of 1

Paint (Layer) Module map the speed function ?

Posted: Fri Jan 02, 2015 1:17 am
by pele2010
Hi,

i was trying to map the "speed" function to a midi controller. But the "speed" function has no keyword.

it´s only named animspeed and it´s located in


init
animSpeed = 0

MessageEvent
elif msg=='animspeed':
animSpeed = param['value']


deserialize
if 'ANIMSPEED' in inDict:
animSpeed = inDict['ANIMSPEED']
module.setValue('animspeed',0, animSpeed)

As the paint module is already a module i was asking myself if it´s possible to include "code"
so it addresses the correct "rotary" knob.

or do i need to programm a module for the controller and insert there the code ?

and how are such controls addressed ?

thanxs

pele2010

Re: Paint (Layer) Module map the speed function ?

Posted: Mon Jan 05, 2015 4:23 am
by anomad
. i'm not sure i understand what you're asking…

. you can 'command-shift-M' and click the 'speed' control in the Paint module and assign it to any incoming MIDI signal.

. if you want to address the 'speed' control in the module, you would use :

module.setValue('animspeed',0, animSpeed)

. you can tell it isn't a Modul8 keyword b/c it uses module.setValue instead of modul8.setValue



-james
(a nomad. )

Re: Paint (Layer) Module map the speed function ?

Posted: Mon Jan 05, 2015 10:13 am
by pele2010
Hi thanks ,

you are right. mapping it to a midi device works.

but i can´t map it to the bpm router. I would like to animate the "pos" with changing values.

or changing values that are linked to color.

the BPM Router can´t pick the pos. or the speed.

module.setValue('animspeed',0, animSpeed)


so i need to build a module with a knob , right?

thanks a lot

pele2010

Re: Paint (Layer) Module map the speed function ?

Posted: Mon Jan 05, 2015 4:15 pm
by anomad
. i think what you're asking is getting into inter-module communications… (something i never really researched very much…)

. so, i looked around and i think the short answer you might be able to do it w/a little work on the Painter module…

. right now, Painter just reads the value from the animSpeed knob (that is local to Painter) and keeps that value in the module. you would need to change the Painter module to read the sharedDict['ANIMSPEED'] value (in Periodical Event, would probably want to update the control in the module as well) and write to the sharedDict['ANIMSPEED'] value in MessageEvent when the knob was changed - then any module could control the speed (or position) of the animation by writing to the sharedDict

. to use it w/BPM Router, you would have to add the ability to used dictionary values (and not just UI elements)

-james
(a nomad. )