dingram/jsmidgen

Is that a bug with the durations in noteOn?

Opened this issue · 1 comments

let pianoTrack = new midi.Track()
pianoTrack.setTempo( 120 )
pianoTrack.instrument( 0, 0 )

pianoTrack
	.noteOn( 0, 'c4', 0 )
	.noteOn( 0, 'e4', 256 )
	.noteOn( 0, 'g4', 512 )

	.noteOff( 0, 'c4', 512 )
	.noteOff( 0, 'e4', 512 )
	.noteOff( 0, 'g4', 512 )

It sounds wrong. Each new note should sounds in the same interval:

.noteOn( 0, 'c4', 0 )
.noteOn( 0, 'e4', 256 )
.noteOn( 0, 'g4', 512 )

Because here we have: 0, +256, +256. Intervals of delay should be equal but it's not. Is that a bug?

Ok, I got it. It's just an offset from the last note.