Module backends.note_state
Active MIDI note state backend.
Reads a user‐maintained active_notes.lua
file, caches its list of MIDI notes,
and exposes lookup functions for whether a given circle‐of‐fourths step is active
or is the bass (lowest) note.
Usage:
local note_state = require("backends.note_state") local raw = note_state.getActiveNotes() local isActive = note_state.isNoteActive(5) local isBass = note_state.isNoteBass(5)
Functions
getActiveNotes () | Returns the raw list of active MIDI notes. |
isNoteActive (stepIndex) | Check if a given circle‐of‐fourths step is active. |
isNoteBass (stepIndex) | Check if a given step is the bass (lowest) active note. |
Functions
- getActiveNotes ()
-
Returns the raw list of active MIDI notes.
Re‐reads the file if it’s been modified.
Returns:
-
int[]
list of MIDI note numbers
- isNoteActive (stepIndex)
-
Check if a given circle‐of‐fourths step is active.
Parameters:
- stepIndex int 1–12 (will be converted internally to 0–11)
Returns:
-
boolean
true if that step is set in
activeSteps
- isNoteBass (stepIndex)
-
Check if a given step is the bass (lowest) active note.
Compares against the circle‐of‐fourths index of
minNote
.Parameters:
- stepIndex int 1–12 (converted internally to 0–11)
Returns:
-
boolean
true if that step equals the bass step