Time signature

Päivitetty 2 vuotta sitten

Working:
creation example snippet
See Time Signature Enforcer for a plugin that uses the cmd interface to manipulate the timesigActual of a measure.

Seems not working:
the setFraction() function, cannot set measure's "timesigNominal","timesigActual","timesig","timesigGlobal","timesigStretch"

import MuseScore 3.0
import QtQuick 2.9
MuseScore {
  menuPath: "Plugins.debug"
  onRun: {
  var c=curScore.newCursor()
  c.inputStateMode=Cursor.INPUT_STATE_SYNC_WITH_SCORE
  ;["timesigNominal"
  ,"timesigActual"
  ,"timesig"
  ,"timesigGlobal"
  ,"timesigStretch"
  ].map(function _(n){
    console.log('___'+n)
    var p=c.measure[n]    //eg c.measure.timesigNominal
    for (var x in p) console.log(x,": ",p[x]) 
    curScore.startCmd()
    c.measure[n].setFraction( fraction(2,2) )
    curScore.endCmd()
    for (var x in p) console.log(x,": ",p[x])
  })
}