music-notation-swift / music-notation-core

Music Notation Library in Swift (Deprecated. See `music-notation` instead)
MIT License
115 stars 16 forks source link

Debug Print Protocol #5

Closed moidx closed 8 years ago

moidx commented 8 years ago

Debug print functionality. Format options. Currently considering a scroll down format given that a measure can contain multiple notes and it may be easier to navigate the measure if there is one note/chord per row.

Option 1 Functional Style

repeat( <number>, measures:
            [
                   measure( time(top/bottom), key(noteLetter type), notes: 
                       note(tone:, duration:, rest:, ...),
                       note(tone:, duration:, rest:, ...)
            ]
)

Option 2 JSON

{ 
    repeat: {
        count: 1,
        measures: [
            {
                time: "3/4",
                key: "C Major",
                notes: [
                    note: {
                        tone: { note: "C", octave: "0" },
                        duration: "whole",
                        isRest: false
                    }
                ]
            }
        ]
}

Other options will need to be discussed.

drumnkyle commented 8 years ago

I'm thinking more of a debug only succinct format to easily visualize. Something like the following:

|4/4: 1/4C1, 1/8[A2#], 1/4R|

R being rest.

Let me know if you know what I mean and if you agree or disagree.

drumnkyle commented 8 years ago

After I thought about it some more I'm on the fence on whether it makes sense for my syntax to be the standard debug print string or if we should have a separate custom protocol for this shorter syntax. Let me know what you think.

moidx commented 8 years ago

Updated the PR with the format proposed by Kyle.