grimmdude / MidiWriterJS

♬ A JavaScript library which provides an API for programmatically generating and creating expressive multi-track MIDI files and JSON.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why can not I set channel?

drumtj opened this issue · comments

I set the channel to 9 for percussion midi, but it is not set.

i try it
new MidiWriter.NoteEvent({pitch:"C1", duration: '16', velocity:100, channel: 9});
and export midi file.

---- FILE START ----
---- FILE HEADER ----
format: 0
tracks: 1
time division: 128
---- TRACK 1 (2187 bytes) ----
delta: 0
Set Tempo: 130 BPM
delta: 0
Note On (channel 0): C1 with velocity 127

Hi @drumtj,

Thanks for your message. It looks like that's something I haven't implemented yet, guess nobody has tried using it. I will work on adding this as soon as I get a chance, thanks.

-Garrett

Hi @drumtj,

I just released 1.7.1 which should fix this issue. Let me know if you have any issues,

-Garrett

Hi @drumtj,

I just released 1.7.1 which should fix this issue. Let me know if you have any issues,

-Garrett

hi
thank you for quick comment.
but i found a problem.

a decremented value of 1 is entered to channel,, ;)

Hi @drumtj,

Sorry, I don't fully understand. Sounds like it's not working as expected for you?

-Garrett

Hi @drumtj,

Sorry, I don't fully understand. Sounds like it's not working as expected for you?

-Garrett

hi
I set the channel to 9. However, in the midi file, I confirmed that the channel was set to 8.

---- TRACK 2 (2190 bytes) ----
delta: 0
Set Tempo: 130 BPM
delta: 0
Program Change (channel 0): Piano
delta: 0
Note On (channel 8): C1 with velocity 127
delta: 32
Note Off (channel 8): C1 with velocity 127

Hi @drumtj,

Seems to be working correctly on my end. Can you post the code you're using? Also what software are you using to read the file?

-Garrett

Hi @drumtj,

Seems to be working correctly on my end. Can you post the code you're using? Also what software are you using to read the file?

-Garrett

Hi
i understood it while creating a test project.
to use a percussion part in a MIDI file, i had to set the channel to 10.
when I analyzed the MIDI file, I was confused because the channel value was 0-based.

you'll see that, in this link.
my curiosity has been resolved.
thank you for your reply.

https://drumtj.github.io/midiWriteTest/dist/index.html