g-raffy / pymusco

a python application to manage digitised orchestral musical scores
GNU General Public License v3.0
3 stars 1 forks source link
music music-score orchestra pdf sheet-music

musco-logo

Python application

pymusco

pymusco is a python application to manage digitised orchestral musical scores.

This tool is aimed at big orchestras, where it's sometimes difficult to deal with sheet music, especially the orchestras that don't give original copies to musicians

features

By making heavy use of digitized sheet music, pymusco provides a way to addresses the following problems:

disclaimer

Digitizing original sheet music can be illegal depending on countries and editors. pymusco encourages in no way to trespass the law. pymusco doesn't have to be used with material subject to copyright.

how to install

python ./setup.py install

how to use

make test provides a full example that generates a stub-pdf and a print-pdf from a scan-pdf

examples

build a stub from a scan

The following command builds the stub-pdf $PYMUSCO_WORKSPACE_ROOT/stubs/007-captain-future-galaxy-drift-1.pdf from the scan-pdf $PYMUSCO_WORKSPACE_ROOT/scans/007-captain-future-galaxy-drift-1.pdf and the piece description file $PYMUSCO_WORKSPACE_ROOT/scans/007-captain-future-galaxy-drift-1.desc:

PYTHONPATH=./src ./src/apps/pymusco \
   --orchestra-file-path samples/jazz.orchestra \
   build-stub \
   --scan-file-path samples/scans/007-captain-future-galaxy-drift-1.pdf \
   --scan-desc-file-path samples/scans/007-captain-future-galaxy-drift-1.desc \
   --stub-file-path samples/stubs/007-captain-future-galaxy-drift-1.pdf

build a print pdf from a scan

The following command builds the print-pdf $PYMUSCO_WORKSPACE_ROOT/prints/007-captain-future-galaxy-drift-1.pdf from the stub-pdf $PYMUSCO_WORKSPACE_ROOT/stubs/007-captain-future-galaxy-drift-1.pdf and the headcount file $PYMUSCO_WORKSPACE_ROOT/samples/jazz.headcount:

PYTHONPATH=./src ./src/apps/pymusco \
    --orchestra-file-path samples/jazz.orchestra \
    build-print \
    --stub-file-path samples/stubs/007-captain-future-galaxy-drift-1.pdf \
    --print-file-path samples/prints/007-captain-future-galaxy-drift-1.pdf \
    ts-auto --headcount-file-path samples/jazz.headcount

definitions

scan-pdf

A scan-pdf is just digitized version of the paper original. It is expected to contain exactly one copy of each track.

stub-pdf

A stub-pdf is a pdf file which contains a single sheet music for each track, but unlike the scan, also contains a table of contents listing all the tracks it contains.

print-pdf

A print-pdf is a pdf file for a musical piece that, as its name suggests, is ready to send for printing on real paper. It contains multiple copies of each track, enough to ensure that each musician has one track assigned.

The selection of tracks that pymusco includes in the print-pdf depends on the track-selector that the user chooses.

piece description file

This file (in JSON with comments format) describes the scan-pdf that it's related to. Here's an example :

{
    "format": "pymusco.piece_description.v1",
    "uid": 7,
    "title": "captain future galaxy drift 1",
    "stamp_descs": [
        {
            "stamp_image_path": "../../logo.pdf",
            "scale": 0.5,
            "tx": 19.5,  // position of the center of the stamp in cm from left of page
            "ty": 28.2   // position of the center of the stampin cm from bottom of page
        }
    ],
    "page_info_line_y_pos" : 1.0,  // from bottom of the page, in cm
    "scan_toc" : {
        "format": "pymusco.toc.v1",
        "track_id_to_page": {
            "bb soprano saxophone": 1,
            "c violin 1": 2,
            "c violin 2": 2,
            "c acoustic guitar": 3,
            "bass guitar": 5,
            "drum set": 6}   // snare drum & cymbal
    },
    "missing_tracks" : {
        "c violin 3": "lost",  // the sheet music for this track is lost
        "eb horn 1": "couldn_t_bother"  // additional parts for certain countries
    }
}

orchestra file

This file is a database of all possible instruments, and uses the format JSON with comments. For each instrument, it stores:

{
    "format": "pymusco.orchestra.v1",
    "instruments" : [
        { "uid": "bb soprano saxophone", "player": "saxophonist", "order": 5.000 },
        { "uid": "eb alto saxophone", "player": "saxophonist", "order": 5.001 },
        { "uid": "bb tenor saxophone", "player": "saxophonist", "order": 5.002 },
        { "uid": "eb baritone saxophone", "player": "saxophonist", "order": 5.003 },

        { "uid": "f horn", "player": "hornist", "order": 7.000, "is_rare": true },

        { "uid": "drum set", "player": "percussionist", "order": 11.001 },
        { "uid": "clash cymbals", "player": "percussionist", "order": 11.002 },  // aka concert cymbals, cymbales frappees : https://en.wikipedia.org/wiki/Clash_cymbals
        { "uid": "snare drum", "player": "percussionist", "order": 11.007 },

        { "uid": "bass guitar", "player": "bassist", "order": 12.001 },  // other names : Bass, electric bass guitar, electric bass

        { "uid": "electric guitar", "player": "guitarist", "order": 12.002 },
        { "uid": "c acoustic guitar", "player": "guitarist", "order": 12.003 },

        { "uid": "c violin", "player": "violinist", "order": 15.010}
    ]
}

track selectors

The role of a track selector is to choose which tracks to include in the print-pdf and how many copies of them.

ts-auto

The number of copies for each track is automatically computed and depends both on the existing tracks in the stub-pdf, and on the headcount of the orchestra.

As an example, in a scenario where there are three trumpet tracks in the stub-pdf (trumpet 1, trumpet 2 and trumpet 3) and there are 5 trumpettists in the orchestra, pymusco's automatic track selector would put 3 copies of each trumpet track in the print pdf. While 2 copie of each would be more than enough, one extra copy is added for each track for musicians that were given a copy but forgot to bring it on rehearsals (yes, this happens!).

ts-auto track selector requires the user to define a headcount (file format JSON with comments) file such as :

{
    "saxophonist": 1,  
    "violinist": 3,  
    "guitarist": 1,
    "bassist": 1,
    "percussionist": 1
}

ts-single

This simple track-selector allows the user to just include one copy of the track he chooses.