Cannot write to voices 2, 3, or 4
Cannot create a drum groove with the base drum in a separate voice so as to appear with stem down. Changing the cursor voice to anything but 0 (i.e. voice 1) . Here is the code snippet:
eTempo = newElement(Element.TEMPO_TEXT);
eTempo.text = '\uECA5' + ' = ' + Math.round(60);
eTempo.visible = visible;
eCursor.add(eTempo);
eLineBreak = newElement (Element.LAYOUT_BREAK);
eLineBreak.layoutBreakType = LayoutBreak.LINE;
eCursor.setDuration(1,16);
for (lj=1;lj<3;lj++)
{
if (lj % 2 == 0)
{
eLineBreak.eScore = curScore;
eCursor.add (eLineBreak.clone ());
}
for (li=1;li<17;li++)
{
// voice 1 (=0) - upward stem
eCursor.voice = 0;
// HH stroke
var lelNote = eCursor.addNote(42);
if (li == 5 || li == 13) {lelNote = eCursor.addNote(38, true);} // Snare
// voice 2 (=1) for BD !!!!!!!!!!!!!!!!!!!!
eCursor.voice = 1;
if (li == 1 || li == 3 || li == 9)
{
lelNote = eCursor.addNote(35, true); // BD 1
// lelNote = eCursor.addNote(36, true); // BD 2 - also doesn't work
}
}
}
Attachment | Size |
---|---|
DrumPluginEx.png | 16.34 KB |
Comments
In reply to onRun: { var eCursor =… by sammik
Unfortunately setting the cursor track didn't work.
In reply to onRun: { var eCursor =… by sammik
Thanks! Correction - It did work if I rewind(0) and then add in the base drum.
I have now separated out the algorithms for the first track and and the second track.
In reply to Thanks! Correction - It did… by avronp
Or of you want to use only one loop, you can do this