Skip to content

Help with MIDI note repeater sketch not working. #243

Answered by franky47
m-r-m-s asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like you have an extra behaviour compared to Logic's implementation, you want the notes to repeat a given amount of times, instead of indefinitely (until the corresponding NoteOff is received).

This is how I'd go about implementing this:

  1. Abstract away the concept of a Repeater into a class/struct. A Repeater instance deals with:
  • The note number to emit (and associated velocity & MIDI channel)
  • The number of pulses to count between output notes
  • The number of times to play a given note before turning itself off
  • An active state

You define a maximum supported number of notes by creating an array of Repeaters.
All Repeaters start in an inactive state.

  1. When a NoteOn is received, f…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@franky47
Comment options

@m-r-m-s
Comment options

@franky47
Comment options

@m-r-m-s
Comment options

@m-r-m-s
Comment options

Answer selected by m-r-m-s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants