Module Lattice
module for creating a lattice of patterns based on a single fast "superclock"
Info:
- Release: v1.2.1
- Author: tyleretters & ezra & zack
Functions
new ([args]) | instantiate a new lattice |
start () | start running the lattice |
reset () | reset the norns clock without restarting lattice |
hard_restart () | reset the norns clock and restart lattice |
stop () | stop the lattice |
toggle () | toggle the lattice |
destroy () | destroy the lattice |
set_meter (meter) | set the meter of the lattice |
auto_pulse (s) | use the norns clock to pulse |
pulse () | advance all patterns in this lattice a single by pulse, call this manually if lattice.auto = false |
new_pattern ([args]) | factory method to add a new pattern to this lattice |
Pattern:new (args) | "private" method to instantiate a new pattern, only called by Lattice:new_pattern() |
Pattern:start () | start the pattern |
Pattern:stop () | stop the pattern |
Pattern:toggle () | toggle the pattern |
Pattern:destroy () | flag the pattern to be destroyed |
Pattern:set_division (n) | set the division of the pattern |
Pattern:set_action (the) | set the action for this pattern |
Pattern:set_swing (the) | set the swing of the pattern |
Functions
- new ([args])
-
instantiate a new lattice
Parameters:
- args table optional named attributes are: - "auto" (boolean) turn off "auto" pulses from the norns clock, defaults to true - "meter" (number) of quarter notes per measure, defaults to 4 - "ppqn" (number) the number of pulses per quarter note of this superclock, defaults to 96 (optional)
Returns:
-
table
a new lattice
- start ()
- start running the lattice
- reset ()
- reset the norns clock without restarting lattice
- hard_restart ()
- reset the norns clock and restart lattice
- stop ()
- stop the lattice
- toggle ()
- toggle the lattice
- destroy ()
- destroy the lattice
- set_meter (meter)
-
set the meter of the lattice
Parameters:
- meter number the meter the lattice counts
- auto_pulse (s)
-
use the norns clock to pulse
Parameters:
- s table this lattice
- pulse ()
- advance all patterns in this lattice a single by pulse, call this manually if lattice.auto = false
- new_pattern ([args])
-
factory method to add a new pattern to this lattice
Parameters:
- args table optional named attributes are: - "action" (function) called on each step of this division (lattice.transport is passed as the argument), defaults to a no-op - "division" (number) the division of the pattern, defaults to 1/4 - "enabled" (boolean) is this pattern enabled, defaults to true - "swing" (number) is the percentage of swing (0 - 100%), defaults to 50 - "delay" (number) specifies amount of delay, as fraction of division (0.0 - 1.0), defaults to 0 (optional)
Returns:
-
table
a new pattern
- Pattern:new (args)
-
"private" method to instantiate a new pattern, only called by Lattice:new_pattern()
Parameters:
- args
Returns:
-
table
a new pattern
- Pattern:start ()
- start the pattern
- Pattern:stop ()
- stop the pattern
- Pattern:toggle ()
- toggle the pattern
- Pattern:destroy ()
- flag the pattern to be destroyed
- Pattern:set_division (n)
-
set the division of the pattern
Parameters:
- n number the division of the pattern
- Pattern:set_action (the)
-
set the action for this pattern
Parameters:
- the function action
- Pattern:set_swing (the)
-
set the swing of the pattern
Parameters:
- the number swing value 0-100%