0

I'm trying to write a midi file by adding notes using a loop. This works fine when adding the first note from an array of notes:

 trk1.smfSeqName('Music')
            .ch(0) // all subsequent messahes will go to channel 0
            .program(0x1) // set channel 0 program to piano
           // .tick(100).note('E5', 127, 75) // clock: 100, MIDI channel: 0, note: E5, velocity: 127, duration: 50 clocks
           .tick(50).note(noteArray.at(0), 127, 100)   // can also use numerical values for the notes

but when I try and add multiple notes in for loop I get an error

for (i = 0; i < noteArray.length; i++) {
            .tick(50).note(noteArray.at(i), 127, 100)   // can also use numerical values for the notes
        }
TCP2000
  • 1
  • 1

0 Answers0