Cheers, yes it was the typo that confused me. I look forward to trying this code tomorrow. Getting there very slowly hehe
Best
first time scripting
-
- KVRian
- Topic Starter
- 844 posts since 6 Nov, 2004 from UK
-
- KVRian
- Topic Starter
- 844 posts since 6 Nov, 2004 from UK
hi guys. I tried this new code, and although it didn't break the script it didn't work... unless i've done something wrong. I'll paste my code screengrabs below.
What is happening is that when i'm recording if i press the 4th button, it stops playing. Then i press it again and it undos. Then every addition press it undos some more steps back.
My aim is to have the button stop, undo, start - all in one go. This seems like it should be a really simple fundamental thing. I don't see how i will ever master this if such a easy one is proving tricky - how would i hope to achieve a more complex function lol!
all help appreciated!
best
(pasted into INIT function) (pasted into main transport part)
What is happening is that when i'm recording if i press the 4th button, it stops playing. Then i press it again and it undos. Then every addition press it undos some more steps back.
My aim is to have the button stop, undo, start - all in one go. This seems like it should be a really simple fundamental thing. I don't see how i will ever master this if such a easy one is proving tricky - how would i hope to achieve a more complex function lol!
all help appreciated!
best
(pasted into INIT function) (pasted into main transport part)
You do not have the required permissions to view the files attached to this post.
- KVRian
- 1372 posts since 28 Dec, 2012 from Meredith NH
Replace the code above with this;
Since there is no debugger, you need to trace everything to make sure the flow is what you expect.
Post back with the traces of what pressing the button does a couple times.
and
Mike
Since there is no debugger, you need to trace everything to make sure the flow is what you expect.
Post back with the traces of what pressing the button does a couple times.
Code: Select all
var isTriggered = false;
application = host.createApplication();
transport = host.createTransport();
transport.addIsPlayingObserver(function(val){
if (!val && isTriggered){
println("enter if() isTriggered:" + isTriggered);
transport.play();
println("transport.play() isTriggered:" + isTriggered));
isTriggered = false;
}
});
Code: Select all
else if (data1 - S1 == 3)
{
println("Button pressed");
transport.stop();
println("transport.stop()");
application.undo();
println("application.undo()");
isTriggered = true;
}
Michael Schmalle
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
http://www.teotigraphix.com
Surfing on sine waves
Maschine4Bitwig - Studio, MK2, MikroMK2, MK1
http://www.teotigraphix.com/bitwig/maschine
