Skip to content

transpositionPitches doesn't work on the fly (dynamically) #896

@kinesphere

Description

@kinesphere

Is there an existing issue for this?

  • 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

  1. Initialise an alphaTab JS in HTML loading a GP file.
  2. 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.

Metadata

Metadata

Assignees

Labels

area-file-formatsRelated to supported file formatsplatform-allAffects all platformsstate-acceptedThis is a valid topic to work on.

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions