Partial example for a structure holding Midi Data #6
operatortwo
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is just a partial example for how midi-data can be stored in the usual way. Of course there are many possible ways.
Then a List object can be used (from System.Collections.Generic)
Public EventList As New List(Of TrackEvent)
List(Of T) has many interesting methods like add, find, insert, sort,..
Midi events are added to the List. Note-Events are always pairs of Note-On and Note-Off, but most time not consecutively (index 5, index 6) but more (index 5, other events, index 11)
The player starts at index 0 of the list.
At every timer interval, the timer proc compares the song-position with the Time of the event.
When Song-Position < Time then the proc is exited
else: the note will be played, index is increased by 1, next check for time,..
Beta Was this translation helpful? Give feedback.
All reactions