jsmidgen icon indicating copy to clipboard operation
jsmidgen copied to clipboard

What's the max of duration and time of the note?

Open ProgrammingLife opened this issue 7 years ago • 0 comments

At the index page of this project I've read:

Time and duration are specified in "ticks", and there is a hardcoded value of 128 ticks per beat. This means that a quarter note has a duration of 128.

But I successfully used this code:

let track3 = new midi.Track();
track3.setTempo( 60 );
track3
	.instrument( 1, 3 )

	.addNote( 1, 'c2', 1024 )

	.noteOn( 1, 'c4', 0 )
	.noteOn( 1, 'c4', 128 )
	.noteOn( 1, 'c4', 128 )
	.noteOff( 1, 'c4', 128 )

it sustains a note for duration equals to 1024. Why does it works then if the main page says that 128 is max? It works properly as expected! But what the max of a duration then?

ProgrammingLife avatar Feb 04 '18 13:02 ProgrammingLife