
Show HN: Hacklily – sheet music editor - jnetterf
https://www.hacklily.org
======
trevordixon
Very cool! I run LilyBin ([http://lilybin.com](http://lilybin.com)), which
I've unfortunately let languish. I compile using AWS Lambda and stay within
the free tier. Did you consider using Lambda?

~~~
jnetterf
Very cool work -- I'm a fan.

I considered Lambda and similar, but keeping LilyPond running as a server
allows for lower latency, which is important given how long it takes for
LilyPond to start up.

I don't think I'd be able to have the kind of live reloading I implemented
here with Lambda.

~~~
trevordixon
The reason I switched to Lambda was to handle bursts. Occasionally some
teacher would have a classroom open LilyBin, and my one server couldn't
compile 30 scores at once. Lambda made it easy to handle.

Hacklily is great! Obviously doing fine with the HN burst! I may just point
people to yours at some point.

~~~
jazzyjackson
This sounds like a really interesting problem. What kind of transformation is
taking place during compilation, datatype wise, like are you rendering audio
serverside?

I wonder for a classroom setting, if many people compile similar scores, if
there's any opportunity to say "the first half of all these scores are the
same, compile it once and concatenate it with the unique pieces"...caching
composition...I'm sure I'll play with it someday.

~~~
jnetterf
For Hacklily, it turns out that the audio is rendered clientside via
[https://github.com/hacklily/hackmidi](https://github.com/hacklily/hackmidi)

Caching sheet music rendering is a hard problem. For example, a note later in
the score can affect the spacing of notes before it.

------
Mizza
Funnily enough, I spend the weekend making almost the exact opposite of this:

[https://github.com/Miserlou/chords2midi](https://github.com/Miserlou/chords2midi)

~~~
memset
Neat! Want to play with this. Does it also do voice leading?

~~~
Mizza
No, it's pretty crude so far, but that's a great idea!

How would you want that implemented?

~~~
mhh__
Short of a genuinely complicated ML system which having been fed a bunch of
(say) Jazz Pianists midi data for chord patterns etc, I think you could
probably do it with some kind of weighted (let's say by the user) Markov
chain/state machine with some kind of graph for which chord voicing should be
used relative to those around it: e.g. "This Dm7 has a F in it, the next chord
is a Cmaj7#11 so move the F up a semitone[Within the same octave]"

The above system should be able to come up with coherent movement of voicings
(and fingers...) although I can't imagien that it would sound very human.

------
ctruelson
This is so cool. Hadn't heard of LilyPond before this. I browsed
mutopiaproject.org for some .ly files and imported them. Works great. Thanks
for sharing!

~~~
odyssey7
Mutopiaproject and LilyPond are great. I used Mutopiaproject a lot when I was
a teenager who enjoyed playing piano. It and imslp changed how I explored
music, and helped me develop my interests. I always preferred the LilyPond
scores from Mutopiaproject when they were avaialable, because they were
usually higher quality. I actually decided to give back to the community by
typesetting some scores myself.

~~~
jnetterf
That's awesome! Do you have any suggestions on how Hacklily could help you
typeset & share music?

~~~
odyssey7
The thing that led me to stop contributing was ultimately seeing the progress
that was being made toward automated music transcription. I saw this
technology as something that would make the process a whole lot faster once it
was good enough, and so it wasn't a wise time investment to keep writing out
those intricate files by hand, but it also wasn't yet the right time for me to
start using that transcription software, either.

At the time, the software that caught my attention was mainly the kind that
helps users turn a scan of sheet music into something that could be
transformed (with a text editor and some scripts) into a LilyPond source file
with far less work than actually typing out all of the LilyPond input
yourself.

I can envision software that does this, but it seems like a big project with
very uncertain adoption outcomes.

Edit: I think software like this probably already exists, essentially, and
definitely if you consider running one of the LilyPond command line conversion
tools an acceptable step. The system's main differentiators would be being
web-based (which isn't that uncommon anymore for music engraving software),
and targeting LilyPond as the best-supported output.

------
arendtio
At first, I thought: 'Kinda cool Latex inspired markdown editor for notes, but
the play button is missing.'

Then I saw the play in the top bar :D

Pure awesomeness!

------
ocdtrekkie
This is quite cool! I do feel like the "code view" interface isn't the best
default, the "Insert Notes" interface should be more than just a tool hidden
in a menu, because that's more than likely the primary way people would prefer
to write music. I would keep the code view to more of a "view source" option.

~~~
jnetterf
Thanks! That's useful feedback. Hacklily's audience so far is primarily users
who are already Lilypond users, but I'd love to make it more broadly useful.

~~~
jay-anderson
Agreed. As a lilypond user, hiding some of the extra stuff would be confusing
to me. I don't think it would be simple to create a mode for more easy note-
only editing.

------
jedimastert
Is this an online editor for lilypond? What are you using to render?

~~~
jnetterf
Yes! It uses lilypond in docker.

[https://github.com/hacklily/hacklily](https://github.com/hacklily/hacklily)

~~~
teach
Very cool. I dug up an unfinished Lilypond arrangement that I'd been working
on in 2008 and pasted it in and everything worked perfectly the first time.

I think if this had existed back then, the much-faster feedback loop would
have helped me finish it. :)

~~~
jnetterf
That's super motivating, thanks for taking the time to comment!

~~~
pen2l
It would be really neat if I can export to a MIDI. Do you reckon that's easy
to do for you? Lilypond in the back is storing this data in abc format right?

Separately, a question, which you guys might know how to solve:

How can I convert a PDF music sheet to a MIDI? I.e., does there exist a music-
sheet to digital-music converter? The pdf in question I want to convert is not
a scanned copy, it's been digitally produced by some other program (I don't
know which program)

~~~
jnetterf
Someone requested MIDI and other exports at
[https://github.com/hacklily/hacklily/issues/2](https://github.com/hacklily/hacklily/issues/2)
and I'll try to tackle soon. Hacklily already makes MIDI available (for
playback), so it's a matter of actually exposing that.

There are solutions for converting sheet music images to MusicXML/Finale/etc.,
but I haven't had good results with any of them.

------
scriptedfate
I've been describing it as a code editor for sheet music, but I guess it's
just as much a sheet music editor for coders?

------
zeroxfe
Very cool! If you're a guitar player, you might like:
[http://public.vexflow.com/vextab/](http://public.vexflow.com/vextab/)

~~~
jnetterf
As someone who has tried making a sheet music renderer, VexFlow is extremely
impressive.

~~~
commandlinefan
Yeah, I got as far as rendering the tab and the notes - but then trying to tie
the “tied” notes together... that’ll drive you crazy.

------
tekkk
Pretty sweet, I'll just have to learn that LilyPond to make use of it. Is
there any good resources out there? It would be nice to include some tutorials
or example songs but well that's a minor issue.

To me learning through programming is very natural so I'm excited to try my
hands on composing using this language. Didn't ever occur to me that the
notation would be that simple. With same effort and time you put into learning
say C++ could you become a proficient composer with this?

~~~
jnetterf
I think the LilyPond documentation
([http://lilypond.org/doc/v2.18/Documentation/learning/index](http://lilypond.org/doc/v2.18/Documentation/learning/index))
is a pretty good way of learning LilyPond. It's linked to from "menu >
LilyPond manual" within Hacklily. Maybe I should be more aggressive about
highlighting that...

Making community features is a natural next step which might help with finding
examples.

LilyPond has a bit of a steep learning curve, but you can absolutely use it
professionally.
[http://www.mutopiaproject.org/](http://www.mutopiaproject.org/) shows what
LilyPond can do. Personally, I find that I can be more productive with
LilyPond than with Finale, and that the results look better.

~~~
gooseyard
I've been using Musescore for a lot of the stuff I used to use Lilypond for,
but one of the things I absolutely love about Lilypond is that its easy to
write scripts that emit lilypond format, it's killer for repetitive stuff like
examples, flash cards, etc.

I was never any good with Finale or Sibelius, so I feel like I'm unqualified
to say whether Musescore is worth learning, but have been curious what an
actual skilled Finale user thinks about it?

------
Klasiaster
I sometimes try to use Denemo but the UI is a bit complicated so that writing
LilyPond yourself maybe is easier? But I like that Hacklily hat some other
input methods as tools. I would like to click on a virtual piano.
[http://www.denemo.org/](http://www.denemo.org/)

~~~
jnetterf
[https://github.com/hacklily/makelily/issues/2](https://github.com/hacklily/makelily/issues/2)

------
anotheryou
Could really use a more complex example. Anything I could paste in?

~~~
jnetterf
Here's an arbitrary example from mutopiaproject.org:
[https://www.hacklily.org/?edit=jnetterf/sheet-
music/BWV857BW...](https://www.hacklily.org/?edit=jnetterf/sheet-
music/BWV857BWV857_Praeludium12BWV857_Praeludium12.ly)

------
dreeves
This looks beautiful! Here's a related tool my friends made:
[http://partifi.org](http://partifi.org)

------
scentoni
[https://en.wikipedia.org/wiki/ABC_notation](https://en.wikipedia.org/wiki/ABC_notation)

------
adjunctprof
[https://github.com/adjunct-professor/sheet-
music/blob/master...](https://github.com/adjunct-professor/sheet-
music/blob/master/adjunct-professor-cd.ly)

[https://github.com/adjunct-professor/sheet-
music/blob/master...](https://github.com/adjunct-professor/sheet-
music/blob/master/adjunct-professor-cd.pdf)

