Re: Variables for current rotation/zoom?

Home Forums Scripts Variables for current rotation/zoom? Re: Variables for current rotation/zoom?

#2817
IanniX
Keymaster

After looking at the sticky and understanding it a bit more clearly, I was able to solve my own question by creating a global variable.

var rotation = 0;

//If a message is received
function onMessage(protocol, host, port, destination, values) {
//Message reception

if((protocol == 'midi') && (values[1] == 56)) { //rotates right
rotation += 15;
run('rotate 0 0 ' + rotation);

}
if((protocol == 'midi') && (values[1] == 57)) { //rotates left
rotation += 15;
run('rotate 0 0 ' + rotation);

}
}

© IanniX Association

What is IanniX? | Download | Showcase | Forums | Research | About