MidiWriterJS icon indicating copy to clipboard operation
MidiWriterJS copied to clipboard

how to use different duration for each note in note array

Open drumtj opened this issue 6 years ago • 4 comments

hi How to add note event with different lengths at the same time?

[MidiWriterJS] new MidiWriter.NoteEvent({pitch:['C4', 'D4', 'E4'], duration: '4'});

[Tone js example] poly.triggerAttackRelease(["Eb3", "G4", "C5"], "2n"); poly.triggerAttackRelease(["Eb3", "G4", "C5"], ["2n", "4n", "4n"]); ---> i need like this

drumtj avatar Apr 26 '19 04:04 drumtj

Hi @drumtj,

Currently the best way to create concurrent note events with different durations is by using separate tracks.

-Garrett

grimmdude avatar Apr 28 '19 06:04 grimmdude

Hi..

I am already using multitrack for several instruments. Is it impossible to apply multiple notes of different lengths to a single note event?

drumtj avatar Apr 29 '19 05:04 drumtj

Hi @drumtj,

You can try using the Track.mergeTrack() method to combine two tracks with different event durations into one.

http://grimmdude.com/MidiWriterJS/docs/Track.html#mergeTrack

-Garrett

grimmdude avatar May 05 '19 17:05 grimmdude

Hi @drumtj,

One thing I just thought of; you can try using the Track.mergeTrack() method to combine two tracks with different event durations into one. It's sort of experimental currently but may work well enough.

http://grimmdude.com/MidiWriterJS/docs/Track.html#mergeTrack

-Garrett

grimmdude avatar May 06 '19 14:05 grimmdude