fix NoteOff ElapsedTime of MIDI Tracks
This commit is contained in:
parent
102763b94d
commit
a78c346371
@ -86,6 +86,12 @@ func (a *App) OpenMidiPort(index int) error {
|
|||||||
channel := bytes[0] & 0x0f
|
channel := bytes[0] & 0x0f
|
||||||
switch msgType {
|
switch msgType {
|
||||||
case 0x8:
|
case 0x8:
|
||||||
|
elapsed := time.Since(lastNoteTime)
|
||||||
|
lastNoteTime = time.Now()
|
||||||
|
runtime.EventsEmit(a.ctx, "midiMessage", &MIDIMessage{
|
||||||
|
MessageType: "ElapsedTime",
|
||||||
|
Value: int(elapsed.Milliseconds()),
|
||||||
|
})
|
||||||
note := bytes[1]
|
note := bytes[1]
|
||||||
runtime.EventsEmit(a.ctx, "midiMessage", &MIDIMessage{
|
runtime.EventsEmit(a.ctx, "midiMessage", &MIDIMessage{
|
||||||
MessageType: "NoteOff",
|
MessageType: "NoteOff",
|
||||||
|
Loading…
Reference in New Issue
Block a user