Skip to main content
Glama
emicklei

melrōse musical expression player

by emicklei
sequence_builder_test.go1.05 kB
package core import ( "testing" ) func TestNearest(t *testing.T) { if got, want := nearest(5, 3), int64(6); got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } if got, want := nearest(539, 125), int64(500); got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } if got, want := nearest(8, 10), int64(10); got != want { t.Errorf("got [%v:%T] want [%v:%T]", got, got, want, want) } } func TestNotePeriod_Quantized(t *testing.T) { bpm := 100.0 p := NotePeriod{startMs: 0, endMs: 100, number: 65, velocity: Normal} w := WholeNoteDuration(bpm) / 4 p = p.Quantized(bpm) n := p.Note(bpm) t.Logf("%v %#v %v", w, p, n) { p := NotePeriod{startMs: 0, endMs: 750, number: 65, velocity: Normal} w := WholeNoteDuration(bpm) / 4 p = p.Quantized(bpm) n := p.Note(bpm) t.Logf("%v %#v %v", w, p, n) } { p := NotePeriod{startMs: 0, endMs: 800, number: 65, velocity: Normal} w := WholeNoteDuration(bpm) / 4 p = p.Quantized(bpm) n := p.Note(bpm) t.Logf("%v %#v %v", w, p, n) } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/emicklei/melrose'

If you have feedback or need assistance with the MCP directory API, please join our Discord server