P5.Score: Cannot read property 'start' of undefined

Hey thanks for the investigative work!

So yes, if I understand correctly my part in score = new p5.Score(preroll); is not loaded at all. Looking at the main Score function p5.Score = function() { it does not seem to take any parameters to fill the this.parts = []; array, so we might just need to add a parameter for parts right? Something like:

p5.Score = function (parts) {
    // for all of the arguments
    this.parts = parts;
    this.currentPart = 0;
    var thisScore = this;
    for (var i in arguments) {
      if (arguments[i] && this.parts[i]) {
        this.parts[i] = arguments[i];
        this.parts[i].nextPart = this.parts[i + 1];
        this.parts[i].onended = function () {
          thisScore.resetPart(i);
          playNextPart(thisScore);
        };
      }
    }
    this.looping = false;
  };

Do you know how to take this from here?

1 Like