Skip to content

Instantly share code, notes, and snippets.

@tbreuss
Last active January 1, 2021 16:14
Show Gist options
  • Select an option

  • Save tbreuss/cc8196c24276b01f3e8008ff32b5547a to your computer and use it in GitHub Desktop.

Select an option

Save tbreuss/cc8196c24276b01f3e8008ff32b5547a to your computer and use it in GitHub Desktop.

Revisions

  1. tbreuss revised this gist Dec 14, 2020. 1 changed file with 26 additions and 9 deletions.
    35 changes: 26 additions & 9 deletions docker-enc2ly.md
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,23 @@
    There are two CLI programms that convert Encore files to LilyPond files.
    **This is a solution to run the original `enc2ly` CLI program within a Docker container.**

    There are two CLI programs that convert Encore musical files to LilyPond.

    - https://github.com/hanwen/go-enc2ly
    - https://enc2ly.sourceforge.io/en/

    Unfortunately I wasn't able to run theses programms on my MacOS.
    Unfortunately I wasn't able to run these programs on my MacOS.

    So, here are the instructions for using the original `enc2ly` CLI programm within a Docker container.

    So, here is a solution using Docker and the original enc2ly.
    ## Prerequisites

    - Docker Desktop

    ## Instructions

    ### 1) Create the Dockerimage.
    ### 1) Create the Dockerimage

    Create a file `Dockerimage` with the following content.

    ~~~
    FROM ubuntu:18.04
    @@ -36,19 +44,21 @@ RUN curl -L https://downloads.sourceforge.net/project/enc2ly/enc2ly-0.6.tar.bz2

    ### 2) Build the Docker Image

    Besides the created `Dockerfile` run the following command.

    ~~~
    docker build --tag enc2ly .
    ~~~

    ### 3) Test the app

    Running the enc2ly command without any options.
    Run the enc2ly command without any options.

    ~~~
    docker run -v enc2ly enc2ly
    ~~~

    This should output something like this.
    This should output the help with something like this.

    ~~~
    Usage: enc2ly [OPTIONS...] FILES...
    @@ -86,6 +96,8 @@ Generic options:

    ### 4) Transform your Encore files

    Now, transform your Encore files like that.

    ~~~
    docker run -v $(pwd)/:/tmp/files/ enc2ly enc2ly /tmp/files/Template.enc
    ==> /tmp/files/Template.enc
    @@ -97,7 +109,12 @@ P(mez 0, lnar 1): 1
    Successfully processed files: 1
    ~~~

    More information see:
    Note the shared Volume and the relative path to the Encore file.

    ## Links

    For more information see:

    - Article: https://enc2ly.sourceforge.io/en/
    - Code: https://sourceforge.net/p/enc2ly/code/HEAD/tree/trunk/
    - Enc2ly Article: https://enc2ly.sourceforge.io/en/
    - Enc2ly Repo: https://sourceforge.net/p/enc2ly/code/HEAD/tree/trunk/
    - Go Enc2ly Repo: https://github.com/hanwen/go-enc2ly
  2. tbreuss renamed this gist Dec 14, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. tbreuss revised this gist Dec 14, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion enc2ly.md
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@ docker build --tag enc2ly .
    Running the enc2ly command without any options.

    ~~~
    docker run -v $(pwd)/:/tmp/files/ enc2ly enc2ly
    docker run -v enc2ly enc2ly
    ~~~

    This should output something like this.
  4. tbreuss revised this gist Dec 14, 2020. 1 changed file with 15 additions and 4 deletions.
    19 changes: 15 additions & 4 deletions enc2ly.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,15 @@
    1) Create the Docker Image first.
    There are two CLI programms that convert Encore files to LilyPond files.

    - https://github.com/hanwen/go-enc2ly
    - https://enc2ly.sourceforge.io/en/

    Unfortunately I wasn't able to run theses programms on my MacOS.

    So, here is a solution using Docker and the original enc2ly.

    ## Instructions

    ### 1) Create the Dockerimage.

    ~~~
    FROM ubuntu:18.04
    @@ -23,13 +34,13 @@ RUN curl -L https://downloads.sourceforge.net/project/enc2ly/enc2ly-0.6.tar.bz2
    make install
    ~~~

    2) Build the Docker Image
    ### 2) Build the Docker Image

    ~~~
    docker build --tag enc2ly .
    ~~~

    3) Test the app
    ### 3) Test the app

    Running the enc2ly command without any options.

    @@ -73,7 +84,7 @@ Generic options:
    Show the version and exit.
    ~~~

    3) Transform your Encore files
    ### 4) Transform your Encore files

    ~~~
    docker run -v $(pwd)/:/tmp/files/ enc2ly enc2ly /tmp/files/Template.enc
  5. tbreuss revised this gist Dec 13, 2020. 1 changed file with 55 additions and 1 deletion.
    56 changes: 55 additions & 1 deletion enc2ly.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,10 @@
    ~~~
    FROM ubuntu:18.04
    RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
    RUN apt-get update && \
    apt-get install -y locales && \
    rm -rf /var/lib/apt/lists/* && \
    localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
    ENV LANG en_US.utf8
    @@ -26,10 +29,61 @@ RUN curl -L https://downloads.sourceforge.net/project/enc2ly/enc2ly-0.6.tar.bz2
    docker build --tag enc2ly .
    ~~~

    3) Test the app

    Running the enc2ly command without any options.

    ~~~
    docker run -v $(pwd)/:/tmp/files/ enc2ly enc2ly
    ~~~

    This should output something like this.

    ~~~
    Usage: enc2ly [OPTIONS...] FILES...
    Convert musical Encore FILES (.enc) to Lilypond ones (.ly).
    The input files should have the extension '.enc' (or '.ENC'), and
    the outputs will have the same paths and basenames, but with extension '.ly'.
    Lilypond related options:
    -a, --absolute
    Apply absolute mode to notes, instead of relative.
    -l, --lingvo, --language LANG
    Name the notes according to LANG, which may be:
    nederlands, nl: Dutch
    catalan, ca: Catalan
    deutsch, de: Cerman
    english, en: English
    espanol, es: Spanish
    italiano, it: Italian
    norsk, no: Norwegian
    portugues, pt: Portuguese
    suomi, fi: Finnish
    svenska, sv: Swedish
    vlaams, vl: Flemish
    -s, --shuti, --dump
    Dump the data to a text file (.txt), instead of '.ly'.
    Generic options:
    -h, --helpo, --help
    Show this help and exit.
    -v, --versio, --version
    Show the version and exit.
    ~~~

    3) Transform your Encore files

    ~~~
    docker run -v $(pwd)/:/tmp/files/ enc2ly enc2ly /tmp/files/Template.enc
    ==> /tmp/files/Template.enc
    P(mez 0, lnar 1): 1
    P(mez 0, lnar 1): 1
    P(mez 0, lnar 1): 1
    P(mez 0, lnar 1): 1
    P(mez 0, lnar 1): 1
    Successfully processed files: 1
    ~~~

    More information see:
  6. tbreuss created this gist Dec 13, 2020.
    38 changes: 38 additions & 0 deletions enc2ly.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    1) Create the Docker Image first.

    ~~~
    FROM ubuntu:18.04
    RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
    ENV LANG en_US.utf8
    ENV DEBIAN_FRONTEND noninteractive
    RUN apt-get update && apt-get -y install curl bzip2 build-essential intltool
    RUN curl -L https://downloads.sourceforge.net/project/enc2ly/enc2ly-0.6.tar.bz2 > enc2ly-0.6.tar.bz2 && \
    tar -xf enc2ly-0.6.tar.bz2 && \
    cd enc2ly-0.6 && \
    pwd && \
    ./configure && \
    make && \
    make install
    ~~~

    2) Build the Docker Image

    ~~~
    docker build --tag enc2ly .
    ~~~

    3) Transform your Encore files

    ~~~
    docker run -v $(pwd)/:/tmp/files/ enc2ly enc2ly /tmp/files/Template.enc
    ~~~

    More information see:

    - Article: https://enc2ly.sourceforge.io/en/
    - Code: https://sourceforge.net/p/enc2ly/code/HEAD/tree/trunk/