How do I enter triplets programmatically?
Hello all,
I am trying to enter triplets programmatically. This is what the documentation (http://musescore.org/en/plugin-development/tick-length-values) says:
"Note and rest values are expressed in an internal unit (...)
triplet quaver (1/3 of crochet) 160"
So I added this code:
(...)
while (!cursor.eos()) {
var chord = new Chord ();
chord.tickLen = 160;
var note = new Note ();
note.pitch = pitch++;
chord.addNote (note);
cursor.add (chord);
cursor.next();
}
But the result is not what I expected (se attached image). What am I missing, or what am I supposed to do to be able to enter triplets from code?
Thank you,
Claudius
Attachment | Size |
---|---|
no_triplets.jpg | 11.3 KB |
Comments
I think you can't enter truplets from the plugin framework. In MuseScore code, triplets is an object and this object is not exposed by the plugin framework.
In reply to I think you can't enter by [DELETED] 5
I see.. Any plans to extend the current plugin framework? :)
I'm sorry... this may seem exceedingly dumb, but why are you trying to do this? I'm just curious what advantage it has and if it's a method I should look at trying out.
In reply to Why? by Calem Bendell_
Hello CalemBendell,
The short version: I need it for a very specific, personal project.
The long version: I'm a contemporary music composer and a programmer at the same time; I thought it would be interesting to attempt to "teach" a machine the basic rules of musical composition, as it applies in contemporary music. While certain progress can be done without "tuplets", their lack is a great loss, as it's common in nowadays' music to have triplets, sextuplets, etc.
In reply to Hello CalemBendell, The short by ciacob
Do you have a mailing list or anything to keep people updated on that?
In reply to Mailing List by Calem Bendell_
Not just yet, as the project is still in a "larval" state, but I'll start twitting about it as soon as things get organized. I'm "claudius_iacob" on Twitter and the project's code name is "stocasticvs" (that's a latin spelling).