
A music programming language for musicians - gnocchi
https://github.com/alda-lang/alda
======
mutagen
Alda has been discussed previously on HN, including comparisons to other
musical languages and some of the advantages / disadvantages of each:

[https://news.ycombinator.com/item?id=10177716](https://news.ycombinator.com/item?id=10177716)

[https://news.ycombinator.com/item?id=10662598](https://news.ycombinator.com/item?id=10662598)

------
dyeje
If this interests you, definitely checkout Sonic Pi. It's a Ruby DSL for music
programming.

[http://sonic-pi.net/](http://sonic-pi.net/)

~~~
spdegabrielle
Sonic pi is amazing

Sébastien Rannou has published a tutorial on how he live coded his fabulous
cover of Aerodynaic by Daft Punk. [https://aimxhaisse.com/aerodynamic-
en.html](https://aimxhaisse.com/aerodynamic-en.html)

------
kaonashi
I'd much rather see a music notation where harmony is first-class, rather than
an emergent phenomenon.

More lead sheet, less orchestral score.

------
earlz
Sadly I don't see MIDI exporting support. I looked at making one of these
music generation programming languages before, but just ran out of time for
it. My goal was quite ambitious though:

1\. Support MIDI exporting (so you could get it into a DAW)

2\. Support timing nudges and randomization (ie, with drums it's common to
play slightly ahead or behind the beat, and somewhat random timing for
humanness factor)

3\. Be easier to write than it is to manually do on a piano roll

So far though, this is a pretty hard set of things to do all at once. I have a
design while using Ruby as a DSL, but it's just difficult to make it all come
together

edit:

To elaborate a bit more on timing nudges, I mean play on beat for measures
1-4, then on measures 5 and 6 play slightly ahead of beat (but using the same
actual playing pattern etc).. Most of my ideas were focused on drums rather
than general instruments because drums are the only thing I've had to use MIDI
for so far

~~~
TheOtherHobbes
You need an accurate timing resolution of less than 1ms for useful groove
nudging, and it's really tough to get PCs or Macs to be that precise on any
OS.

If you use a high level language like Ruby, js, or Python the actual timing
will be randomised anyway.

For maximum accuracy you need a low level scheduler written in C++ with a few
special tricks. Of you can farm out the timing to something like JUCE - which
isn't quite perfect, but is good enough for most applications.

~~~
pierrec
It seems you're forgetting that everything is buffered and all events are
timecoded. This is how pretty much all music software works, and it means the
final audio is synchronized down to sample precision, regardless of any
hardware latency. If the hardware is too slow and you're doing realtime, the
audio will stutter, but this doesn't affect timing precision within the audio
stream.

For example, when a VST plugin is asked to process a block of audio, it
receives a buffer and an array of events with their exact positions in the
buffer. All components are connected to each other in this manner. So even if
you're using a slow language, timing will definitely not be randomized, though
perhaps, as you add more code, you will reach the point where it's too slow
for realtime slightly earlier than if you were using a highly efficient
compiled language.

------
fdej
It would be useful if it had a tool to convert MIDI files to source code
(ideally with some sane automatic structuring). I've sequenced some 15
megabytes of MIDI files, and would love to have them in a form suited for
version control.

~~~
fit2rule
MidiXML?

[http://www.music-notation.info/en/formats/MidiXML.html](http://www.music-
notation.info/en/formats/MidiXML.html)

------
bane
I'm _really_ surprised at how many programming languages for music there are.

What I think is interesting is how few of them seem to be aware of tracking
style interfaces and how those might be better extended to do many of the
kinds of things these languages offer.

I remember showing some programming friends some examples of what trackers
look like and the response is usually something like "you have to _program_
the music?" or "oh! it's like asm for music!"[1]

It's a much nicer way of laying down notes quickly and has some pretty mature
ideas behind it as a music composition paradigm and offer a huge variety of
possibilities for music composition.[2][3]

Writing with trackers is also fast. When you get really good with these tools
it's possible to sketch out a 2-3 minute song in 30-60 minutes - softsynths
and all.

1 -
[https://www.youtube.com/watch?v=u3xHPIuX3s4](https://www.youtube.com/watch?v=u3xHPIuX3s4)
2 -
[https://www.youtube.com/watch?v=45BH12-O_94](https://www.youtube.com/watch?v=45BH12-O_94)
3 -
[https://www.youtube.com/watch?v=iUx8PrDqUiY](https://www.youtube.com/watch?v=iUx8PrDqUiY)

------
6stringmerc
Nice to see something like this - reminds me of my initial love of programming
in QBasic. My oh my the noise that was going on in the classroom that day.
Quite an impressive looking way to simplify and open up two worlds. Hope to
give it a try eventually.

~~~
0xdeadbeefbabe
Freebsd adopted the same API
[https://www.freebsd.org/cgi/man.cgi?query=speaker&sektion=4](https://www.freebsd.org/cgi/man.cgi?query=speaker&sektion=4)

------
TylerE
Looks like a dumbed down version of lilypond syntax?

~~~
shams93
Yeah with lilypond you have support for world music notation most of these
music frameworks assume you're only working with standard western music
styles, lilypond is really powerful.

~~~
vixen99
I've found Frescobaldi to be a terrific interface for Lilypond with some
useful shortcuts if you're not an experienced user. Lilypond is indeed a
marvellous piece of software.

------
yarou
This is really neat. Has anyone tried using machine learning to compose music
with this?

~~~
dasboth
That was my first thought when I saw this too! Definitely another addition to
my side project idea backlog.

Related: have you seen this? [https://maraoz.com/2016/02/02/abc-
rnn/](https://maraoz.com/2016/02/02/abc-rnn/)

------
iris-digital
Interesting, what is it implemented in? Seems to be Java related somehow. And
there's a client and server?

~~~
gnocchi
If you click on the red bar under the repository description you can see what
is the main programming language for the repository which is clojure.

