I am writing a midisequenser in javascript for my own use and joy, i have written midimessage parser eons ago, and i remember how tedious it was. So i though i look for parser on net, and i rather soon realised that i just do not get that object oriented code.
Well until i found.
https://tonejs.github.io/Midi/
But as i saw the tone.js example did actually parse out the content of the file to a text area above, i thought oh i could use that textstring and reparse it to fit my sequenser. Because i understood it, but looking closer upon the textoutput i realised i do not see/find the channel information for the notes and instruments?
So does the above hold channel information for instruments and notes???
Normally?? the instrument channel is the first byte in a message ranging 192-207. At least that is how i change the instrument on a midichannel on my hardware using javascript.
And the notemessages first byte also the channel, i use/save both ON 144-159 and OFF 128-143 " your program use duration here instead of "OFF" works fine with me".
Because then i only need to convert delta time for on notes to the absolute time my sequenser use.
***But i can't see these messages for channel*** in the textoutput where do they hide, could you give me direction howto read out tone.js "objects?"
I am simple man i will just list the messages in an array, but without midichannel information for instruments and notes, i am lost.
Here is my halfbaked javascript attempt so far, i do not use miditime "parts per quarter?", just absolute time.
But it could change i have a metronome that i removed in favour of prerendered absolute time.
https://midisequenser.000webhostapp.com/
Best regards Jonas Thörnvall
Well until i found.
https://tonejs.github.io/Midi/
But as i saw the tone.js example did actually parse out the content of the file to a text area above, i thought oh i could use that textstring and reparse it to fit my sequenser. Because i understood it, but looking closer upon the textoutput i realised i do not see/find the channel information for the notes and instruments?
So does the above hold channel information for instruments and notes???
Normally?? the instrument channel is the first byte in a message ranging 192-207. At least that is how i change the instrument on a midichannel on my hardware using javascript.
And the notemessages first byte also the channel, i use/save both ON 144-159 and OFF 128-143 " your program use duration here instead of "OFF" works fine with me".
Because then i only need to convert delta time for on notes to the absolute time my sequenser use.
***But i can't see these messages for channel*** in the textoutput where do they hide, could you give me direction howto read out tone.js "objects?"
I am simple man i will just list the messages in an array, but without midichannel information for instruments and notes, i am lost.
Here is my halfbaked javascript attempt so far, i do not use miditime "parts per quarter?", just absolute time.
But it could change i have a metronome that i removed in favour of prerendered absolute time.
https://midisequenser.000webhostapp.com/
Best regards Jonas Thörnvall