Skip to content

Commit

Permalink
feat: active midi notes velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
davay42 committed Mar 19, 2023
1 parent 0e27f90 commit 07a98ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions use/midi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export interface MidiInterface {
}>
forwards: Record<string, Record<string, boolean>>
channels: Record<number, { notes: {}, activeNotes: {}, cc: {} }>
activeNotes: Record<number, boolean>
activeNotes: Record<number, boolean | number>
guessChords: string[]
note: {
pitch: number
Expand Down Expand Up @@ -342,7 +342,7 @@ function noteInOn(ev: NoteMessageEvent) {
delete midi.channels[note.channel].activeNotes[note.number]
} else {
note.velocity = 120 * (ev.note.attack || 1);
midi.channels[note.channel].activeNotes[note.number] = true
midi.channels[note.channel].activeNotes[note.number] = ev.note.attack
}
midi.note = note;
return note;
Expand Down

0 comments on commit 07a98ea

Please sign in to comment.