CoderLine / alphaTab

alphaTab is a cross platform music notation and guitar tablature rendering library.
http://www.alphatab.net
Mozilla Public License 2.0
1.27k stars 202 forks source link

The first track specified in alphaTex is being rendering up an octave #289

Closed dgriessler closed 4 years ago

dgriessler commented 5 years ago

Your environment

Expected Results

When d3 is specified as a note, it should be rendered and drawn at d3.

Observed Results

Only for the first track, the entire first track is being drawn up the octave. I had to make the alphaTex have the values down the octave so it would get drawn in the right spot. This is easily heard when you play it back, it is playing in the 3rd octave which is unexpected. The other tracks are drawn and playback correctly.

Steps to Reproduce (for bugs)

  1. Define some alphaTex:

    \title "Down by the Riverside"
    \subtitle "Arranged by: Brant Adams. B.M.I."
    \tempo 84
    .
    
    \track "Soprano"
    \staff {score} \tuning piano \instrument acousticgrandpiano \ks G
    r.1 |
    r.2 :4 d3 e3 |
    g3{d}.2 :8 g3{-} a3 |
    b3{d}.2 :8 b3{-} r |
    \ts 2 4 :4 b3 a3 |
    \ts 4 4 g3.1 |
    :8 e3 d3 d3{- d}.2 :8 d3{-} r |
    \ts 2 4 :4 d3 e3 |
    \ts 4 4 g3{d}.2 :8 g3 a3 |
    :2 b3 a3 |
    g3.1 |
    \tempo 88
    \ts 4 4 :2 g3{-} r |
  2. Render using alphaTab
  3. Observe that all the notes are being drawn up one octave but are being played back as their correct octave.

Possible Solution

I'm still debugging to try and track down the source of the problem. Since the midi is being generated correctly, I assume this is a rendering issue.

dgriessler commented 5 years ago

You can also view my project https://dgriessler.github.io/TestHost/ which shows this bug happening.

Danielku15 commented 4 years ago

I will need to double check this in detail. There are some rules that depending on the instrument rendering might appear to be 1 octave shifted, but this is actually expected as for various stringed instruments the standard notation is shifted by 1 octave.

dgriessler commented 4 years ago

You can actually see this happening in your documentation in the Staves example it says "c4 d4 e4 f4" but what is drawn is "c5 d5 e5 f5" https://docs.alphatab.net/develop/alphatex/tracks-staves

Danielku15 commented 4 years ago

With the adding of multistaff and track support some instrument detection got messed up. For the first staff the alphaTex importer thought it is a Guitar track which renders notes 1 octave higher compared to piano tabs. The problem is fixed in the latest build.