feat(tracker): indicate release and hold with better symbols

This commit is contained in:
vsariola 2020-12-30 23:32:20 +02:00
parent c02c5c3c3d
commit 2e2b5261ae

View File

@ -21,10 +21,16 @@ var notes = []string{
// valueAsNote returns the textual representation of a note value // valueAsNote returns the textual representation of a note value
func valueAsNote(val byte) string { func valueAsNote(val byte) string {
if val == 1 {
return "..." // hold
}
if val == 0 {
return "---" // release
}
octave := (val - baseNote) / 12 octave := (val - baseNote) / 12
oNote := (val - baseNote) % 12 oNote := (val - baseNote) % 12
if octave < 0 || oNote < 0 || octave > 10 { if octave < 0 || oNote < 0 || octave > 10 {
return "..." return "???"
} }
return fmt.Sprintf("%s%d", notes[oNote], octave) return fmt.Sprintf("%s%d", notes[oNote], octave)
} }