LPE is a very simple Rails3 application that allows users to share Lilypond and MXML data.
Yeah, it is a yet another paste engine.
Lilypond is an awesome toolkit which includes a TeX-like music notation language and a set of tools. It allows one to quickly write down note sheets and generate PDFs or images for them.
There are tons of varios paste sites in the web nowdays, but no of them could deal with Lilypond and music nicely.
Is it a problem? Probably yes, if you need to quickly share the music notesheet with someone.
Generally, LPE is not very function-reach. Honestly speaking, it is something like a quick and dirty solution with very minimalist look and feel. Of course it is unstable, not really production-ready now, and requires much more work and lots of improvements to became really brilliant.
At the moment it allows one to paste Lilypond data as a plain text, or attach a MusicXML file. The input data is saved and processed in a separate thread, generating PNGs and PDFs for it. Convertation from Music XML to Lilypond is done via musicxml2ly
utility from the Lilypond distribution.
The successfully processed pastes will be hold for a 30 days after creation or for 30 days after last access if the hold
checkbox is set. Pastes, that are failed to process, will be deleted after 24 hours after their creation to prevent users paste non-music data.
The ids of pastes are hidden and a unique random string is used insted.
<img src=“scrn_index.png?raw=true” />
<img src=“scrn_paste.png?raw=true” />
Not available at the moment. Sorry.
-
Background convertation input from mxml to lilypond
-
Background generation of PDFs and PNGs for input data
-
Ajax
-
Administration with ActiveAdmin
All the insecure Lilypond features are disabled, so keep an eye on them.
A maximum size of a Music XML file or a Lilypond string to upload is limited to 2 megabytes (Yeah, a unicode string is limited to its byte size, not character number!).
LPE is configured, tested and deployed like any other regular rails3 application. If you are familiar with Rails, it must not have any difficulties for you.
Note, that you have to properly configure devise for active admin, for example create a default AdminUser.
The second important thing is that you will need a local lilypond distribution for LPE to work. Obtain it here, then set a path to it to a config variable lilypond_path
somewhere in your config/environments
directory like this:
config.lilypond_path = "path-to-lilypond"
To setup cleaning job type (when in project root):
$> clockwork config/clock.rb &
Testing is done via Rspec and FactoryGirl. Files in the spec/fixtures
are used for testing lilypond wrappers. They were found somewhere in the web as an examples of .mxml
files.
Module LilyHelpers is a thin wrapper over utilities at the original Lilypond distribution. It invokes them as subprocesses and uses open3
for dealing with standard input and output. It responds to two methods: mxml_to_lilypond
and process_lilypond
.
mxml_to_lilypond
-
accepts a single argument
mxml
, a file-like objectreturns a converted Lilypond as a
String
if convertation was successfulreturns
nil
if convertation failed process_lilypond
-
accepts three arguments:
- ly
-
a file-like object
- basename
-
a basename for converted files
- dir
-
a directory for converted files
returns a
Hash
where keys are file extensions as symbols and values are arrays of file paths if processing was successfulreturns nil if processing failed
app/jobs
-
Delayed jobs for background processing
lib/lily_helpers.rb
-
Lilypond wrapper
config/clock.rb
-
Clockwork
Anything remaining goes to config/initializers
.
-
Design (Including images and icons)
-
Social share links
-
Some static pages, contact form
-
Improvements to administration ui (specially for the delayed job part)
-
More complex devise and cancan configuration
-
Perhaps migration to resque if delayed_job becomes too heavy and less-scalable
-
LilyHelpers perhaps must be released as a standalone gem
-
Is it possible to use carrierwave processing and file versions for
lilypond
andmxml
instead of a number of carrierwave separate uploaders?
Copyright © 2013 ruthenium
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.