NOTESTACK
Detailed Description
Generic Notestack Module
Usage Examples: $MIOS32_PATH/apps/tutorial/016_aout $MIOS32_PATH/apps/tutorial/017_sequencer $MIOS32_PATH/apps/tutorial/018_arpeggiator $MIOS32_PATH/apps/sequencers/midibox_seq_v4/core/seq_midi_in.c
Function Documentation
Clears the note stack
- Parameters:
-
[in] | *n | pointer to notestack structure |
- Returns:
- < 0 on errors
Counts all active notes in notestack
- Parameters:
-
[in] | *n | pointer to notestack structure |
- Returns:
- < 0 on errors
-
0 if no active note
-
> 0 if active notes have been found
Initializes a Notestack
Has to be called before NOTESTACK_Push/Pop/Clear functions are used!
- Parameters:
-
[in] | *n | pointer to notestack structure |
[in] | mode | one of following modes:
-
NOTESTACK_MODE_PUSH_TOP: new notes are added to the top of the note stack
-
NOTESTACK_MODE_PUSH_BOTTOM: new notes are added to the bottom of the note stack
-
NOTESTACK_MODE_PUSH_TOP_HOLD: same like above, but notes won't be removed so long there is a free item in note stack. Instead, they will be marked with .depressed=1
-
NOTESTACK_MODE_PUSH_BOTTOM_HOLD,: same like above, but new notes will be added to the bottom of the note stack
-
NOTESTACK_MODE_SORT: Notes will be sorted
-
NOTESTACK_MODE_SORT_HOLD: Like above, but notes won't be removed so long there is a free item in note stack. Instead, they will be marked with .depressed=1
|
[in] | *note_items | pointer to notestack_item_t array which stores the notes and related informations |
[in] | size | number of note items stored in the array |
- Returns:
- < 0 if initialisation failed
Removes a note from the stack
- Parameters:
-
[in] | *n | pointer to notestack structure |
[in] | old_note | the note number which should be removed (1..127) |
- Returns:
- < 0 on errors
-
0 if note hasn't been found
-
1 if note has been found and removed from stack (in hold mode: marked as depressed)
-
2 only in hold mode: if all notes are depressed now
Pushes a new note, bundled with a tag, to the note stack
- Parameters:
-
[in] | *n | pointer to notestack structure |
[in] | new_note | the note number which should be added (1..127) |
[in] | tag | an optional tag which is bundled with the note. It can contain a voice number, the velocity, or... |
- Returns:
- < 0 on errors
Removes all non-active notes from notestack
- Parameters:
-
[in] | *n | pointer to notestack structure |
- Returns:
- < 0 on errors
Sends the content of the Notestack to the MIOS Terminal
- Parameters:
-
[in] | *n | pointer to notestack structure |
- Returns:
- < 0 on errors