alphaTab
alphaTab copied to clipboard
transpositionPitches doesn't work on the fly (dynamically)
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
In JS, after the initial render, if I run:
api.settings.notation.transpositionPitches = [7]; api.updateSettings(); api.render();
Nothing changes. All other things I tested work (e.g., api.settings.display.scale = 1.2;), but transpositionPitches and displayTranspositionPitches won't work, although they work fine in the initial render.
Expected Behavior
The notation should display the new pitch (different notes, in the case 7 semitones above from what is shown in the initial render).
Steps To Reproduce
- Initialise an alphaTab JS in HTML loading a GP file.
- Test in Firefox web developer tools via console, or by creating a function for transpositionPitches, updateSettings and Render.
Link to jsFiddle, CodePen, Project
No response
Found in Version
1.2
Platform
Web
Environment
- **OS**:
- **Browser**:
- **.net Version**:
Anything else?
The fix for me was to modify the library, adding inside the render function: ModelUtils.applyPitchOffsets(this.settings, this.score);
I don't know where is best to have this, but it fixed the issue for me.
👍 I also encountered this when trying to implement an on-the-fly transposition feature.
Reopening to ensure the new pitches are not only visually but also respected on audio.