TerryCavanagh / boscaceoil

A simple music making program
http://boscaceoil.net/
578 stars 71 forks source link

Thoughts on making the file format more diff-friendly? #70

Open mtkennerly opened 5 years ago

mtkennerly commented 5 years ago

I really like how Bosca Ceoil uses a plain-text format since it works better for version control, but it's a bit unwieldy for diffing since it's all on one line and not annotated, Would you be open to making the format more diff-friendly?

A minimally invasive option could be to allow line breaks and comments, so then the program could generate something like:

4,

// general
0,0,0,110,16,4,

// instruments - first the count, then each one on its own line
2,
0,0,0,0,0,100,
5,0,0,0,0,100,

// patterns
so on...

A much more invasive option could be to annotate everything with JSON so that it's more self-documenting:

{
    "version": 4,
    "general": {
        "swing": 0,
        "effect": 0,
        "effectValue": 0,
        "bpm": 110,
        "patternLength": 16,
        "barLength": 4
    },
    "instruments": [
        {
            "number": 0,
            "type": 0,
            "palette": 0,
            "cutoff": 0,
            "resonance": 0,
            "volume": 100
        }
    ],
    "patterns": [
        {
            "key": 0,
            "scale": 0,
            "instrument": 0,
            "palette": 0,
            "notes": [
                {
                    "index": 0,
                    "length": 1,
                    "offset": 0
                }
            ],
            "recordFilter": 0,
            "recordFilterData": [
                {
                    "volume": 1,
                    "cutoff": 1,
                    "resonance": 1
                }
            ]
        }
    ],
    "arrangements": [
        {
            "loopStart": 0,
            "loopEnd": 0,
            "patterns": [
                []
            ]
        }
    ]
}

Either way, it would be much easier to see in source control what parts of the song were changed. What do you think?

TerryCavanagh commented 5 years ago

Hi! I think this is a really good idea, and will implement your pull request the next time I look at this project! Thank you <3

(I'm currently finishing up a commercial game, so 100% of my focus is on that right now.)