MidiWriterJS icon indicating copy to clipboard operation
MidiWriterJS copied to clipboard

Merge tracks in parallel

Open michaelmior opened this issue 6 years ago • 4 comments

I have tracks for several different notes on the same instrument that I'm constructing independently. I get the current sound when I export these tracks as an array. However, I want the output to have a single track. When I use mergeTracks, I the tracks end up appearing one after the other. Is there any easy way to do this?

michaelmior avatar Jul 13 '19 18:07 michaelmior

Hi @michaelmior,

Thanks for your message. mergeTracks should merge in parallel, but it's admittedly a bit experimental at the moment. Could you post your code so I can test it out and possibly figure out what's going on?

-Garrett

grimmdude avatar Jul 14 '19 16:07 grimmdude

Please excuse me for butting in :)

Hi @michaelmior I was intrigued so I had a quick look, and your app appears to export MIDI files just fine...

Have I missed something, or how can the problem be reproduced?

jpw avatar Jul 18 '19 19:07 jpw

The app does indeed export MIDI. However, each instrument is on a separate track where I would prefer them all to be on a single track.

michaelmior avatar Jul 18 '19 22:07 michaelmior

I am having the same issue too.

xp2-882030kgz010602 avatar Dec 18 '22 01:12 xp2-882030kgz010602

Hi @michaelmior, I'm not able to replicate this currently. I've added a test for Track.mergeTrack() with a very basic example which is currently passing, but please let me know if you're still having trouble.

@xp2-882030kgz010602, if you could post some example code that illustrates the problem you're seeing I can take a closer look.

In the meantime, closing this one out for now.

grimmdude avatar Oct 07 '23 19:10 grimmdude