jsmidgen icon indicating copy to clipboard operation
jsmidgen copied to clipboard

Is that a bug with the durations in noteOn?

Open ProgrammingLife opened this issue 7 years ago • 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?

ProgrammingLife avatar Feb 05 '18 18:02 ProgrammingLife

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

ProgrammingLife avatar Feb 06 '18 05:02 ProgrammingLife