Skip to content

Instantly share code, notes, and snippets.

@tbreuss
Last active January 1, 2021 16:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbreuss/cc8196c24276b01f3e8008ff32b5547a to your computer and use it in GitHub Desktop.
Save tbreuss/cc8196c24276b01f3e8008ff32b5547a to your computer and use it in GitHub Desktop.
Converting Encore files to LilyPond using Docker

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.

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.

Prerequisites

  • Docker Desktop

Instructions

1) Create the Dockerimage

Create a file Dockerimage with the following content.

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

Besides the created Dockerfile run the following command.

docker build --tag enc2ly .

3) Test the app

Run the enc2ly command without any options.

docker run -v enc2ly enc2ly

This should output the help with 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.

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
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

Note the shared Volume and the relative path to the Encore file.

Links

For more information see:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment