Opensheetmusicdisplay: [BUG] MusicPartManagerIterator currentTimeStamp Has Incorrect Timestamp For Initial Values

Created on 28 May 2020  路  3Comments  路  Source: opensheetmusicdisplay/opensheetmusicdisplay

Introduction

Hello everyone at Open Sheet Music Display!

You are all wonderful - and I love the work!

I'm not sure if this is a bug or a misunderstanding on my part, but when I get the initial currentTimestamp of the MusicPartManager its values don't make sense.

Problem

Explanation

When you get the MusicPartManagerIterator from the MusicPartManager its initial values are 0 for the numerator and 1 for the denominator. This doesn't make sense. I'm not sure what the correct value should be, but it's not that.

Additionally the real value is 0 which is also incorrect.

Example

Please see this attached image

image

Steps to Reproduce

  1. Clone repo
  2. npm init
  3. npm start
  4. Go to https://localhost:8000
  5. Open the developer console
  6. var manager = osmd.Sheet.MusicPartManager;
  7. var iterator = manager.getIterator();
  8. iterator.currentTimeStamp

The value you will get back is this

Fraction聽{numerator: 0, denominator: 1, wholeValue: 0, realValue: 0}denominator: 1numerator: 0realValue: 0wholeValue: 0Denominator: (...)Numerator: (...)RealValue: (...)WholeValue: (...)__proto__: Object

This doesn't make sense

Closing

It's possible I'm misunderstanding this, but I wanted to raise this issue in order to make sure that it either got noticed or someone could explain to me my incorrect understanding.

Most helpful comment

Hi @loganknecht and thanks very much for your appreciation on OSMD - we appreciate that a lot :-)
Thanks also for the detailed question.
This might really be a misunderstanding - it is totally fine that the first note starts at timestamp 0 which is of course a fraction of 0/1 = 0.
So in a 4/4 measure with 4 quarters you would have the following timestamps:
0/1 - 1/4 - 1/2 - 3/4
The next measure starts then with 4/4 = 1/1 on the first note.
So again for the very first quarter note:
it starts at 0/1 and ends on 1/4 (where already the second quarter is starting)

All 3 comments

Hi @loganknecht and thanks very much for your appreciation on OSMD - we appreciate that a lot :-)
Thanks also for the detailed question.
This might really be a misunderstanding - it is totally fine that the first note starts at timestamp 0 which is of course a fraction of 0/1 = 0.
So in a 4/4 measure with 4 quarters you would have the following timestamps:
0/1 - 1/4 - 1/2 - 3/4
The next measure starts then with 4/4 = 1/1 on the first note.
So again for the very first quarter note:
it starts at 0/1 and ends on 1/4 (where already the second quarter is starting)

@matt-uib thank you so much for the quick reply and fantastic explanation. I see where I had a misunderstanding. Please feel free to close this issue as it really isn't an issue!

Great that i could clarify this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

evanrmurphy picture evanrmurphy  路  4Comments

dlujan picture dlujan  路  6Comments

sschmidTU picture sschmidTU  路  3Comments

byebb picture byebb  路  5Comments

npmccallum picture npmccallum  路  5Comments