mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
feat(tracker): indicate release and hold with better symbols
This commit is contained in:
parent
c02c5c3c3d
commit
2e2b5261ae
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user