Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ProgrammingLife opened this issue Feb 4, 2018 · 0 comments
Open

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

ProgrammingLife opened this issue Feb 4, 2018 · 0 comments

Comments

@ProgrammingLife
Copy link

ProgrammingLife commented Feb 4, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant