sorry i missed that you wanted to control midi with this. for that case, agree that lua side is best

Has anyone got any experience of updating metro tick speed without stopping and then starting it again? I’d like to smoothly update a BPM but can only get the update to happen if I stop then restart the metro.

One solution could be to run the metro at a very fast base speed, but maintain your ā€œrealā€ tempo in a separate variable.

Then you could only execute the code in the metro’s callback function every X (your speed divided by base speed - I think?) times.

3 Likes

ā€œthat looks too complicatedā€ is i think actually all i needed to know, started over and am on much more solid ground, don’t think i need an example anymore. thank you!

edit: @P1505, @mimetaur’s idea is actually in my script above right now. can smoothly update the bpm, but need to change it slightly to round off the decimals. haven’t tried keeping time long term but 10ms seems good enough for most tempos in my 5-10 minute tests

1 Like

have you checked out the beatclock lib?

1 Like

I haven’t but will. Does it solve this issue? I’d love to know how so I’ll go digging.

Actually thinking about it more can’t you just set the metro’s time property? I don’t think there’s any need to restart it. Beatclock wraps it all up with a load of other useful functionality anyway.

1 Like

This works for me, without the need for a stop/start of the metro.

1 Like

Hmm. Maybe I’ve done something wrong. I’ll play.

one thing to be aware of - if you set the metro period while the metro is sleeping, new period won’t take effect until after it wakes up. this is unfortunately true even if you set the metro from its callback, b/c lua event loop doesn’t get the callback until the metro thread has already gone to sleep.

1 Like

Is there a way to provide a standard pmset and data file? I want to pre-set the factory samples and other params in Ack.

(I’m working on a Mark Fell inspired modulo matrix sequencer)

2 Likes

If I remember correctly we didn’t include a standard way to let a script load data from it’s own directory
automatically but you should be able to just load it using a relative path I think (like ./data/default.pset). I might be wrong though.

How would you expect it to work?

1 Like

ah, we’ve discussed factory preset support a bit, but it hasn’t quite yet been baked into the system. you could hack it as a library pretty easily.

(testing out a quick implementation, one moment…)

ok yea, this works for me - quickly tested using awake

it is a bit hacky b/c it depends on knowledge about paramset / menu internals.

in a nutshell: if there is nothing in the script’s designated preset/pmap location, try and copy from a script-local data folder. (e.g. i added ~/dust/code/awake/data/awake.pset, .../awake.pmap.) then, proceed with default preset init as usual.

2 Likes

hum… now that i did that, i’m not actually sure it adds any functionality compared to just setting up the parameter default values as you want them within the script. i suppose it could be much easier to maintain a default .pset file though.

(oh and yes, you could load an arbitrary .pset file path instead of copying like in the gist.)

1 Like

it seems like everyone other than me’s scripts are showing up correctly with tab=two spaces in github. is there something in git to change to fix that, or should i be looking for something to put in my vimrc file? i have set tabstop=2 in vim so it looks fine locally, but am guessing github doesn’t take that into account. no way everyone just using spaces instead of tabs, right??

lua style guide here: https://github.com/monome/norns/wiki/coding-style-(lua)

I suppose everyone could be using spaces? (sorry I realize this is probably not that helpful of a reply)

thanks! yeah i try to follow the style guide locally (but i have been using camel case for variables and snake case for functions, just easier for me to write/read), but just on github my tabs aren’t showing up correctly.

i could convert all tabs to spaces before pushing but i am pretty sure it would get annoying having to deal with all the spaces when i realize i have done everything wrong and need to change the indent level. i can probably also convert spaces back to tabs but then i’m converting all my spaces to tabs and back every time i want to push to github which seems not good?

maybe it’s a sign i’m indenting too much and not abstracting out to functions often enough…

How do you access the current amount of a param, specifically - Ack reverb send for each channel? Can’t quite crack the syntax on it… having no problems to set it but to get.

params.get or params.get_raw ?

(or should that be colons? Can’t check from my phone right now)

Yep, should be params:get("param_id").