We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A custom method for Measure should be defined that uses attributes to fill note fields. aminya/AcuteML.jl#107
Measure
attributes
The text was updated successfully, but these errors were encountered:
blocked by aminya/AcuteML.jl#130, but the basic code is written:
@aml mutable struct Measure "measure" attributes::UN{Attributes} = nothing, "~" notes::Vector{Note}, "note" @creator begin notes = note_graphics(notes, attributes) end end """ Finds the graphical representation of a note based on attributes.divisions and note.duration # Examples notes = [ Note(pitch = Pitch(step = "G", alter = 0, octave = 5), duration = 1), Note(pitch = Pitch(step = "G", alter = +1, octave = 5), duration = 1), Note(pitch = Pitch(step = "B", alter = 0, octave = 5), duration = 1), Note(pitch = Pitch(step = "A", alter = +1, octave = 5), duration = 1), Note(rest = Rest(), duration = 4), # Rest Note(pitch = Pitch(step = "A", alter = 0, octave = 5), duration = 4), Note(pitch = Pitch(step = "B", alter = 0, octave = 5), duration = 4), ] MusicXML.note_graphics(notes, Attributes()) """ function note_graphics(notes, attributes) for inote=1:length(notes) actual_duration = notes[inote].duration//attributes.divisions type = note_graphics_map[actual_duration] notes[inote].type = type end return notes end const note_graphics_map = Dict( 1//256 => "1024th", 1//128 => "512th", 1//64 => "256th", 1//32 => "128th", 1//16 => "64th", 1//8 => "32nd", 1//4 => "16th", 1//2 => "eighth", 1 => "quarter", 2 => "half", 4 => "whole", # "breve" # "long" # "maxima" )
Sorry, something went wrong.
The blocking issue is merged now. It should be possible to fix this.
aminya
Successfully merging a pull request may close this issue.
A custom method for
Measure
should be defined that usesattributes
to fill note fields.aminya/AcuteML.jl#107
The text was updated successfully, but these errors were encountered: