Norns—pattern class examples?

does anyone have an example script or two that could educate me on basic implementation of the norns pattern class?

my goal is to loop a series of key-presses for use as a variable-interval clock source, if it helps!

thanks!

1 Like

gah, i keep forgetting to formalize this as a study, but this seemed to help @Olivier :

once you’ve collected your pattern, you can query the .time for each entry in your total .count (which is all in pattern_time.lua: https://github.com/monome/dust/blob/master/lib/lua/pattern_time.lua)

let me know if I can help with anything specific! fwiw, i’d love an excuse to add the quantization methods from cheat codes to pattern_time (as well as 1-shot and windowing, etc), so lmk if that’s of interest!

(tagging @autreland because I edited after posting)

6 Likes

amazing—this is exactly what i needed!

i will certainly give a shout if i run into trouble—thank you kindly!

1 Like

I’d like this… I copied what MLR does for quantizing key presses in animator (when recording, if “quantize” is on, push those events to a queue, and then record them on a synced clock/metro pulse), but this seems to break down if you change the global tempo after recording.

It would be great if there was a way to quantize the events post-record.

hopefully that makes sense!

1 Like

totally makes sense! cool cool, i’ll poke at it this week :slight_smile:

3 Likes

definitely wouldn’t say no—also interested in pattern-wide rate-multiplier strategies, if you have any up your sleeve!

i have not had time to check out the new cheat codes (live stream and other twitch performance video were so great btw) but depending on how it works, i would be really interested in this for my script traffic as well! the transpose/modulation pattern recording being totally free running was always more “ehhh” than “happy accident, wow!” on the Quirky and Different Because I Can’t Code Scale, and now that the clock syncs to link, it feels really bad not having it. so another expression of interest here!

1 Like

I’m looking at the pattern class source, but can’t quite figure out if the length of presses (or z == 1) is captured in addition to x and y values. I’m trying to add Molly the Polly to a script, but I can’t seem to release the gate(s) when my pattern is playing…I have a feeling it’s because the pattern doesn’t know when keys are pressed and then released.

1 Like

excellent q and yeah, your hunch is right on!

earthsea is a great example. it doesn’t differentiate between down/up events, committing each to the pattern as e.state. since .process is defined as grid_note_trans, the event information is passed as it was added – e.state > 0 triggers a note-on, otherwise it’s note-off.

the study i previously drafted only handled note-on presses, but working on a new one to handle releases, as well!

potential idiosyncratic "gotcha"

if pattern recording is turned off before a note-off is committed, then that note will drone on when replayed. you’ll want to include some mechanism after recording to check the last .event in the pattern is a note-off, otherwise you’ll want to insert an entry for that (it’ll need to include all the other things you’re committing to the pattern, as well, otherwise you’ll get errors when replaying).

2 Likes

Adding a ping here for the quantization stuff mentioned above.

I’ve got a thing I wanna do and will need quantization and was planning to ask you directly how best to handle that. :grin:

1 Like

good callllllll

1 Like