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

Export to .dez format [FEATURE] #47

Open
9 of 11 tasks
johentsch opened this issue Feb 23, 2023 · 5 comments · May be fixed by #102
Open
9 of 11 tasks

Export to .dez format [FEATURE] #47

johentsch opened this issue Feb 23, 2023 · 5 comments · May be fixed by #102
Assignees
Labels
enhancement New feature or request

Comments

@johentsch
Copy link
Owner

johentsch commented Feb 23, 2023

Describe the solution you'd like
ms3 transform command should have an option to export expanded harmony tables to the JSON format .dez of Algomus' Dezrann app. In addition, the converter should be a standalone script.

Concrete ToDos (Optional)

@johentsch johentsch added the enhancement New feature or request label Feb 23, 2023
@Pythouille2
Copy link
Collaborator

add layers key to .dez output, based on an argument with default value

Few changes to plan :

  • add a "layers: List[str]" key in DezrannLabel
    • it is an optional information so we may consider using DezrannLabel(TypedDict, total=False) ; otherwise, ["DCML"] would do a good default value
  • Hence, add a new argument origin: List[str] with default value ["DCML"] in the functions generate_dez convert_dcml_list_to_dezrann_list and finally make_dezrann_label
    • the "origin" will be the same for all the generated labels - but I think this is not a problem here

@Pythouille2
Copy link
Collaborator

add parameters for choosing which feature goes into which line (three above, three below)

  • If we only generate one line of labels (this is the case for the current version, with harmony only), we could specify a line: str argument
  • After adding phrases, local key and/or cadences labels, we need to specify multiple lines (a dictionary as argument ? {'<label_type>': '<line_id>'} ?) and/or a default line attribution in the global variables, according to their types.

What about a default :

LABEL_LINES = {
    "Harmony": "bot.1", # first line below
    "Phrase": "bot.2",     # second line
    "Localkey": "bot.3",
    "Cadence": "all", # vertical line
    #"Texture": "top.3", # first line above the score
    #"Structure": "top.2" # Warning : top level structure could also use "top.1" ?
}

?

@Pythouille2
Copy link
Collaborator

add parameters for choosing which feature goes into which line (three above, three below)

  • If we only generate one line of labels (this is the case for the current version, with harmony only), we could specify a line: str argument
  • After adding phrases, local key and/or cadences labels, we need to specify multiple lines (a dictionary as argument ? {'<label_type>': '<line_id>'} ?) and/or a default line attribution in the global variables, according to their types.

What about a default :

LABEL_LINES = {
    "Harmony": "bot.1", # first line below
    "Phrase": "bot.2",     # second line
    "Localkey": "bot.3",
    "Cadence": "all", # vertical line
    #"Texture": "top.3", # first line above the score
    #"Structure": "top.2" # Warning : top level structure could also use "top.1" ?
}

?

According to the .dez examples and specifications, the lines can be defined globally in the "layout". However, the local definition of "line" in a DezrannLabel overwrites the global line.

Thus, I suggest to remove the "line" key from DezrannLabels, and insert layout parameter with following default value, for example :

DEFAULT_LAYOUT = [
    {"filter" : { "type": "Harmony" }, "style" : {"line": "bot.1"}},
    {"filter" : { "type": "Phrase" }, "style" : {"line": "bot.2"}},
    {"filter" : { "type": "Localkey" }, "style" : {"line": "bot.3"}},
    {"filter" : { "type": "Cadence" }, "style" : {"line": "all"}},
    #{"filter" : { "type": "Texture" }, "style" : {"line": "top.3"}},
    #{"filter" : { "type": "Structure", "tag": "Exposition" }, "style" : {"line": "top.1"}}, # Optional : will ensure that these top level structure labels are on a separate line from other structure labels
    #{"filter" : { "type": "Structure", "tag": "Development" }, "style" : {"line": "top.1"}},
    #{"filter" : { "type": "Structure", "tag": "Recapitulation" }, "style" : {"line": "top.1"}},
    {"filter" : { "type": "Structure" }, "style" : {"line": "top.2"}}
]

In addition of the "line" in "style", we also can add a "color" for each category of labels.

@johentsch
Copy link
Owner Author

OK we've gotten pretty far already, @Pythouille2 ! Do you have any updates on the anacrusis question?

@magiraud
Copy link

Hi @johentsch ! I just talked with @Pythouille2, we're glad that this export is working. Anacrusis seems to work (on K283.1).

More elaborated cases are questions linked to the measure map, but that are separate issues. Louis showed me the DCML .tsv, we talk on that here for Dezrann.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants