ObjectEditor -- Button2>>doAction
X

Menu
30
Length
7
Gap
Make
Play
    this.voice2 = Array.range(1, len + gap).map(function(i) {
        var note = noteProto.copy();
        if (i <= len) music.addMorph(note);
        note.time = i;
        always: { note.note.is in this.voice2Chords() }
        always: { note.length.is in [8,16,32,64,128] }
        return note;
    }.bind(this));
    this.voice1.each(function (note1, idx) {
        var note2 = this.voice2[idx],
            note2gap = this.voice2[idx + gap],
            self = this;
        always: { priority: 'strong'
            self.isValidBichord(note1.note, note2gap.note)
        }
        always: {
            note1.length === note2.length
        }
        note1.length = Math.pow(2, Math.round(Math.random() * 2 + 4))
        for (var i = idx + 1; (i < len && i <= idx + gap); i++) {
            var note1f = this.voice1[i],
                note2f = this.voice2[i];
            always: {
                note1.note !== note1f.note || note2.note !== note2f.note
            }
        }
    }.bind(this));
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
<lively.morphic.Box#D25BB... - NzakaraHarp>
Tag:
run
save
Tests

-- ALL --
constraints
isValidBichord
reset
setParameters
voice1Chords
voice2Chords
Scripts
-
+
-
Connections
+
-- ALL --
all
ObjectEditor -- NzakaraHarp>>constraints
X

Menu
saved source