You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Actually just any multi-track music would be great. You could do something like this:

    var track1 = "...";
    var track2 = "...";
    
    function note(ch) {  
      if (ch in pitches) {
        var f = 4000*pitches[ch]/1500;
        if (!w.running)
          w.startOutput(B0, f);
        else if (!w2.running)
          w2.startOutput(B0, f);
        else if (!w3.running)
          w3.startOutput(B0, f);
        else if (!w4.running)
          w4.startOutput(B0, f);
      }
    }
    
    function step() {
      var ch1 = track1[pos];
      var ch2 = track2[pos];
      if (ch1 !== undefined) pos++; else pos=0;
      note(ch1);
      note(ch2);
    }
    

    As you might have guessed by now I'm not very musical :)

About

Avatar for Gordon @Gordon started