Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get correct value of parameters in automation curve #2

Open
kirliavc opened this issue Jul 15, 2020 · 1 comment
Open

Cannot get correct value of parameters in automation curve #2

kirliavc opened this issue Jul 15, 2020 · 1 comment

Comments

@kirliavc
Copy link

I'm developing a script to copy all parameters from one track to another, and the code is shown below.

function copyParams(sourceTrack, targetTrack){
  var sourceNoteGroup = SV.getProject().getTrack(sourceTrack).getGroupReference(0).getTarget();
  var targetNoteGroup = SV.getProject().getTrack(targetTrack).getGroupReference(0).getTarget();
  var paramNames = ["pitchDelta","vibratoEnv","loudness","tension","breathiness","voicing","gender"];
  for(var id in paramNames){
    var paramName = paramNames[id];
    targetNoteGroup.getParameter(paramName).removeAll();
    var params = sourceNoteGroup.getParameter(paramName).getAllPoints();
    SV.setHostClipboard(params.toString());
    for(var id2 in params){
      var item = params[id2];
      targetNoteGroup.getParameter(paramName).add(item[0], item[1]);
    }
  }
}

There are two problems:
When paramName is pitchDelta, the param value becomes extremely large(near 2^32) when the value is smaller than zero. So probably the unsigned/signed conversion fails.
When paramName is Tension, the param value always get zero. I think the problem is also about number conversion.

@Sleepwalking
Copy link
Contributor

Hello @kirliavc

Thank you for the report. We are able to confirm this bug and it will be fixed in version 1.0.5.
A workaround is to pass item[0] into Automation.get(). This should give a value identical to what item[1] should have been.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants