Page 1 of 1

How to control internal clock

Posted: 13 Nov 2014 19:45
by mmake
Hello forums!

I'm TRYING to understand sequencing and the scripts involved. I'm hoping to build a standalone sequencer in Lemur. I've ripped apart the iPad Monosequencer, and i'd like to include a tap tempo in it. There's tap tempo -patches in the user library, but i don't know how to combine the two.

To be honest, i'm having a hard time understanding the documentation about the clock scripts. A lot of the sequencing patches and examples are using clock from outside Lemur. One would think it's easy to build basic functionality (nudge, tap tempo) into a patch, that's using internal clocks, nope! :D

Would be nice to have small examples on how to script sequencing? Many of the patches have so much stuff, i'm confused! If anyone is willing to point out some of the basics of scripting & sequencing, i would be happy to study them!


Thanks: Marko

Re: How to control internal clock

Posted: 13 Nov 2014 23:43
by mmake
....to be a bit more precise maybe, how do i access the internal clocks bpm? How could i modify that value? I see in the Monosequencer -patch, there is a "time" -value, that is being modified by the 'plus' & 'minus' scripts. Should i script something that modifies a "time" variable? A bit lost....

Re: How to control internal clock

Posted: 14 Nov 2014 03:42
by Macciza
Hi
First, many older sequencer only used external clock because that was all that was available via midiIn scripting...
Now we have dedicated clock support for both external an d internal clocks - which you use is selectable in Settings . .

Have a look through the additional docs for full info, or look in the internal functions/clock section of the Project pane . .
See the clock_getbpm/setbpm functions ? These get or set the bpm, in Monoseq they are used within the increment() function which gets called by those plus / minus scripts . . .
That 'time' var you are seeing is actually an internal var that reports time,( see the Internal/State section as above) you can't change it, it is getting assigned to other vars . .

So what you need is simply a script that after working out the bpm calls the clock_setbpm function
Or takes changes in a bpm var that the TapTempo part reports to trigger setting, there are a few ways of doing it
Of course the more elegant way would be to interpol a between existing and target bpm to avoid radical changes of tempo

hope that helps

Re: How to control internal clock

Posted: 14 Nov 2014 15:28
by mmake
I thought the external clock was the new addition, and before that was only internal... Thank you for the extra help, much appreciated!

I didn't notice before there was a 'setbpm'.

The tap tempo I've been using is called "SLTapTempo," thank you to who ever made it! I can find the tapped BPM, with a variable called SLTapTempo.clock, with the monitor. I bypass the increment function, because, well i thought they might interfere, and make a new script.

Right now in transport, i have this script on manual execution:

Code: Select all

decl new_bpm = SLTapTempo.tempo;
clock_setbpm(selected_clock, new_bpm);
...but it's not doing anything to the sequencers, or the bpm indicator! I'm horribly no0bie at this scripting, as you can probably tell :oops:

Re: How to control internal clock

Posted: 14 Nov 2014 16:20
by mmake
Oh wait...it seems to be working as expected (changing the 'selected_clock' bpm). I had it on execution manual, and when i changed it to frame, it started to do something. What a hassle :) Well i don't learn if i don't put my feet in to the water. Thanks again for helping! I am sure everything is in the manual. It's just my lousy coding skills that prevent me understanding the documentation ;)