Skip to content

REST API for converting Lilypond file format to PDF and MIDI

License

Notifications You must be signed in to change notification settings

GGracieux/lilypond-api

Repository files navigation

lilypond-api

REST API (Docker, PHP, Slim, Lilypond) for converting Lilypond file format to PDF and MIDI

Prerequisite

Start

Installation

composer install

Build

docker image build -t lilypond-api .

Run

docker run -p 80:80 lilypond-api

API Usage

Endpoint http://[docker-machine]/info

Request

  • Verb : GET
  • No parameter

Response

  • Content-Type : Application/json
{
  "apiName": "lilypond",
  "version": {
    "api": "1.1",
    "lilypond": "GNU LilyPond 2.18.2"
  },
  "description": "Lilypond to midi & pdf convertion"
}

Endpoint http://[docker-machine]/convert

Request

  • Verb : POST
  • Content-Type : Application/json
  • Parameters : -- lpData : Lilypond format string
{
   "lpData": "\\score{ { c'4 d'4 e'4 f'4 } \\layout{} \\midi{} }"
}

Response

  • Content-Type : Application/json
{
  "statusCode": "OK|ERROR",
  "message": "Information complement on error",
  "base64PdfData": "JVBERi0xLjQKJcfsj6IKNSAwIG9iago8PC9MZW5n.......0YK",
  "base64MidiData": "TVRoZAAAAAYAAQACAYBNVHJrAAAAUwD/Aw1jb250......F0b",
  "logs": [
    {
      "title": "Lilypond : PDF & MIDI Generation",
      "content": "Processing 5a9d77d267c75/5a9d77d267c75.lp"
    }
  ]
}

Also read

About

REST API for converting Lilypond file format to PDF and MIDI

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages