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

Duration calculation is off when the lowest beat is less than 1 measure #15

Open
slurmulon opened this issue Dec 7, 2018 · 0 comments
Assignees
Labels

Comments

@slurmulon
Copy link
Owner

Problem

The resulting duration for each beat is not considering the lowest beat in the track, resulting in incorrect values.

This issue is also related to get-ms-per-beat, as it needs to be updated to consider the lowest-beat in a similar way (otherwise the duration values will not align properly).

Example

In this case, the duration of the :ED and :EP beats should be 8 instead of 4.

Once that is fixed, the ms-per-beat should be 4285.7144 instead of 2142.8572.

Bach

@Tempo = 56

:ED  = Scale('E3 dorian')
:EP  = Scale('E3 phrygian')
:DP  = Scale('D3 minorpentatonic')
:EbP = Scale('Eb3 minorpentatonic')
:EP  = Scale('E3 minorpentatonic')

!Play [
  4 -> :ED
  4 -> :EP
  1/2 -> :DP
  1/2 -> :EbP
  3 -> :EP
]

Bach.JSON

{
    "data": [
        [
            {
                "duration": 4,
                "notes": {
                    "atom": {
                        "init": {
                            "arguments": [
                                "E3 dorian"
                            ]
                        },
                        "keyword": "Scale"
                    }
                }
            },
            null
        ],
        [
            null,
            null
        ],
        [
            null,
            null
        ],
        [
            null,
            null
        ],
        [
            {
                "duration": 4,
                "notes": {
                    "atom": {
                        "init": {
                            "arguments": [
                                "E3 phrygian"
                            ]
                        },
                        "keyword": "Scale"
                    }
                }
            },
            null
        ],
        [
            null,
            null
        ],
        [
            null,
            null
        ],
        [
            null,
            null
        ],
        [
            {
                "duration": 0.5,
                "notes": {
                    "atom": {
                        "init": {
                            "arguments": [
                                "D3 minorpentatonic"
                            ]
                        },
                        "keyword": "Scale"
                    }
                }
            },
            {
                "duration": 0.5,
                "notes": {
                    "atom": {
                        "init": {
                            "arguments": [
                                "Eb3 minorpentatonic"
                            ]
                        },
                        "keyword": "Scale"
                    }
                }
            }
        ],
        [
            {
                "duration": 3,
                "notes": {
                    "atom": {
                        "init": {
                            "arguments": [
                                "E3 phrygian"
                            ]
                        },
                        "keyword": "Scale"
                    }
                }
            },
            null
        ],
        [
            null,
            null
        ],
        [
            null,
            null
        ]
    ],
    "headers": {
        "audio": "",
        "desc": "",
        "link": "",
        "lowest-beat": 0.5,
        "ms-per-beat": 2142.8572,
        "tags": [],
        "tempo": 56,
        "time": [
            4,
            4
        ],
        "title": "Cool Mellow SRV Style",
        "total-beats": 12
    }
}
@slurmulon slurmulon added the bug label Dec 7, 2018
@slurmulon slurmulon self-assigned this Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant