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

Explicit Accidentals in alphaTex #1719

Closed
Danielku15 opened this issue Oct 26, 2024 · 0 comments · Fixed by #1729
Closed

Explicit Accidentals in alphaTex #1719

Danielku15 opened this issue Oct 26, 2024 · 0 comments · Fixed by #1729
Assignees
Labels
area-file-formats Related to supported file formats platform-all Affects all platforms state-accepted This is a valid topic to work on.
Milestone

Comments

@Danielku15
Copy link
Member

Related Discussion: #1717

Current State

alphaTex doesn't allow expressing explicit accidentals for notes. When using pitched notes the note names are only used to describe what note "height" within the octave the note should have, but accidental information is fully ignored.

Feature Description

alphaTex is meant to be a language where you can fill the data model supported by alphaTab and the Note.accidentalMode is a missing part in the language. Therefore the alphaTab syntax needs to be extended to allow describing what accidentals you want on a note.

Note Effect

The accidental is described like note effects as annotation in the braces after the note. Syntax

acc ACCIDENTAL where ACCIDENTAL is one of:

  • Default -> AccidentalMode.Default
  • #, ForceSharp -> AccidentalMode.ForceSharp
  • ##, x, ForceDoubleSharp -> AccidentalMode.ForceDoubleSharp
  • b, 'ForceFlat' -> AccidentalMode.ForceFlat
  • bb, 'ForceDoubleFlat' -> AccidentalMode.ForceDoubleFlat

This way the accidentals can be described on any note:

Important: alphaTab will not try to detect combinations of note heights and accidentals which are not really possible and in worst case it might result in wrong notes. We expect notation to be written in a meaningful way and alphaTab places notes according to the known rules of music notation.

Percussion

For percussion tracks any descibed accidentals are ignored.

Pitched Notes

The parsing of pitched notes like 'C#4should respect the accidentals described in there. The syntax should beNoteName Accidental OctavewhereAccidental` can be:

  • # -> AccidentalMode.ForceSharp
  • ## or x -> AccidentalMode.ForceDoubleSharp
  • b -> AccidentalMode.ForceFlat
  • bb-> AccidentalMode.ForceDoubleFlat

Opt-Out on Forced Accidentals

Some authors might prefer to keep the AccidentalMode.Default but you are forced to write notes like C#3. Therefore alphaTex should allow an opt-out from the forced accidentals and fallback to the classical mode of just using the accidentals to describe the note height. The following syntax should be supported to change the mode how the accidentals are interpreted:

  • \accidentals auto - Indicates the accidentals are detected automatically (current behavior)
  • \accidentals explicit - Indicates the accidentals are expressed explicitly and should be respected (new behavior, new default)

This tag is then supported on following levels and changing the mode for next notes being parsed:

  • song level
  • track level
  • staff level
  • bar level

Further details

I noticed that there might be some bugs in alphaTab today. We should extend the test matrix to check accidental modes and key-signature combinations more widely.

@Danielku15 Danielku15 added type-feature 💡 area-file-formats Related to supported file formats state-accepted This is a valid topic to work on. platform-all Affects all platforms labels Oct 26, 2024
@Danielku15 Danielku15 self-assigned this Oct 26, 2024
@Danielku15 Danielku15 moved this to Todo in alphaTab 1.4-1.x Oct 26, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in alphaTab 1.4-1.x Nov 3, 2024
@Danielku15 Danielku15 added this to the 1.4.0 milestone Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-file-formats Related to supported file formats platform-all Affects all platforms state-accepted This is a valid topic to work on.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant