feat: MIDI velocity, keyboard splits, and fixing instrument channel

Closes #124
Closes #215
Closes #221
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2026-02-07 10:03:44 +02:00
parent 0179b24fd4
commit b349474c4d
11 changed files with 369 additions and 24 deletions

View File

@ -2,6 +2,7 @@ package tracker
import (
"fmt"
"strconv"
"time"
"github.com/vsariola/sointu"
@ -45,6 +46,7 @@ type (
railWidth int
params [][]Parameter
paramsWidth int
title string
}
derivedTrack struct {
@ -72,6 +74,25 @@ func (m *Model) updateDeriveData(changeType ChangeType) {
m.updateParams()
m.updateRails()
m.updateWires()
m.buildInstrumentTitles()
}
}
func (m *Model) buildInstrumentTitles() {
m.midiAssign.update(m.d.Song.Patch)
for i, instr := range m.d.Song.Patch {
if i >= len(m.midiAssign.itoc) || m.midiAssign.itoc[i] == 0 {
m.derived.patch[i].title = "---"
continue
}
t := strconv.Itoa(m.midiAssign.itoc[i])
if instr.MIDI.Velocity {
t = t + " vel"
}
if instr.MIDI.Start > 0 || instr.MIDI.End > 0 {
t = t + fmt.Sprintf(" [%d-%d]", instr.MIDI.Start, 127-instr.MIDI.End)
}
m.derived.patch[i].title = t
}
}