Skip to content

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

Description

@ProgrammingLife

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions