Hacker News new | past | comments | ask | show | jobs | submit login
Velato: A programming language where source code must be a valid MIDI music file (velato.net)
112 points by p4bl0 on March 4, 2024 | hide | past | favorite | 63 comments



Perhaps it is impossible but I'd love to see a Quine in this language


Hi, I'm the creator of Velato. I will be reworking the website to include more examples later this year. In the mean time, the latest version of the compiler is on github: https://github.com/rottytooth/Velato

No one has yet written a quine although I would love to see one -- perhaps outputting its representation in lilypond format.


Since you're the author I can ask you directly, what the purpose is of the language. Why did you choose MIDI as a form of representation? What kind of programs are you implementing with it? Where are these programs supposed to be executed, on MIDI instruments?


I first made the language (fifteen years ago!) out of curiosity about esolangs and as a first try at writing a compiler. And for fun, yes. Since then, I've written more about multicoding -- the way two readings of code impact each other -- and thought more about the music that results (some links in my comment below). This is the aspect of the language that interests me now.

I chose MIDI since it's a standard and leaves to the programmer the choice of tool to compose the program. There's an IDE in the works geared for live performance of the language (that will not be MIDI, but not ready to say yet how it will work; it has the same lexicon but is quite a different language in practice).


I see, thanks. But is Velato actually conceived to create music, or is the music just a "random" byproduct?


From the top of the original link:

> “Velato offers an unusual challenge to programmer-musicians: to compose a musical piece that, in addition to expressing their aims musically, fills the constraints necessary to compile to a working Velato program.”

It seems like Velato’s purpose is to provide an unusual and interesting creative constraint for people who can both code and write music.


> Velato’s purpose is to provide an unusual and interesting creative constraint for people who can both code and write music

I do both on a professional level and have no idea what this sentence means; that's why I'm asking.


Have you ever sat in front of your favorite DAW version XX and thought, oh wow so many things, what am I going to do?

How about Sonic Pi? Or any modern audio toolset. So much possibility, where to start?

Creative constraint is about opening up pathways by restricting options.


It means come up with a code goal and a music goal, and fulfill both with a Velato program. For example, can you write MIDI file which finds the nth Fibonnaci number and sounds good to your friend when played with a piano instrument (a real one or a sound sample)?


Constraints are not too crazy of a concept. It’s not much different than say, writing a traditional Schoenberg style 12-tone composition.

You would create your tone rows and then write your composition. If you follow the rules, then it is also 12-tone serialism.


Presumably you code and compose in separate contexts, unlike what the sentence describes


For fun I suppose? See: esoteric programming languages


Why shoud we suppose if the author himself can give us an authoritative answer?


It's very obvious.


Whenever I see questions like this I have to wonder: Do you really lack the creative spark that lets you imagine why something like this would be fun to create?


I guess not everyone can be a genius (like you?)


How did you manage to arrive at that interpretation?


Have you ever read Hermann Hesse's _The Glass Bead Game_? (also published as _Magister Audi_)

Every time I see alternative representations of knowledge/computer code/algorithms it comes to mind.

Would you expect a person to be able to achieve a mastery of this to the point where they could play and control something in an improvisation? Say something like to the character Agatha Heterodyne of Kaja and Phil Foglio's web comic _Girl Genius_ controlling an army of clanks (robots):

https://www.girlgeniusonline.com/comic.php?date=20061229


Funny you should ask; someone interviewed me about a few of my esolangs for their dissertation last year and referenced the Glass Bead Game.

It would take a lot of practice to improvise Velato, but that would be amazing!


There are times when I worry that the ubiquity of computers is crushing experimentation in computer interface concepts.


_Magister Ludi_ (stupid auto-correct)


Is there any reason why your website does not support HTTPS?


I wish more websites were still HTTP! I can't access most of the modern web from my vintage computers and I see no reason I need security on websites I'm not logging into.


Even for non-login sessions, HTTPS is key. It isn't just about credential protection. It guards against data tampering in transit and is therefore crucial for end-to-end data integrity. What you are saying is basically that you don't care about integrity, fair enough, but many people including me do.


It will move to https when I update it later this year


This is a very creative project, congratulations!

One obvious step is to try to make it bootstrapped. Have the velato compiler be a velato.mid file.


Extra meta-bonus points if the quine's MIDI notes are from a transcription of a Robert Quine guitar solo!

Fascinating project, xpointer!


I believe all but severely limited languages are forced to admit quines, see e.g. https://math.stackexchange.com/questions/3982278/the-fixed-p...


I'm a professional composer and amateur programmer. I've been trying to write a Quine in Velato, but seems impossible to me. Source code in Velato are MIDI files, but output is plain text. In order to create a Quine you must design a MIDI that outputs text pseudo code (in Guido, Lilypond, etc. notation) which, when converted back to MIDI will yield the original Midi file. However every print char command in Velato requires at least 8 notes (in MIDI). So there's not a 1 to 1 correspondence like in other programming languages Quines. I'm no computer scientist here but this seems impossible to me.


A game that is programmed by the music in the game. Something tells me such music would sound a little odd.


> Keep in mind that this set of notes is not the actual program; if a MIDI file is created from this progression of notes, the concurrent notes might be interpreted in a different order in the file, and create an invalid program.

Is the order of notes within a chord the _only_ extra info required on top of a musical score? If so, with some "tie-breaker" I think you could encode any Velato program unambiguously in sheet music.

For example, if notes in a chord were interpreted as commands from lowest to highest pitch, you could move notes up and down by octaves to determine the command order. Just a thought... I like the idea of piece-as-program.


I favored the flexibility of ordering concurrent notes differently in MIDI over having the sheet music uniquely define a program. It gives the programmer more choices in how notes can be combined.

But there could be a default ordering -- I would think reading a chord from bottom to top -- for a piece of music where the score came first and the MIDI representation or performance of that score second.


Interesting!

Similar note-based expression can be found on TidalCycles/Strudel. although it's not valid MIDI format anymore, you can use notation like c4, f3, and make them as "pattern". Samples are also supported in the same manner:

https://strudel.cc/

And in my project Glicol, I use only numbers in the seq node. So 60 means middle C. Underscore means rest.

https://glicol.org/


Strange: I submitted this more than 24 hours ago and it still says so on my list of submissions here: https://news.ycombinator.com/submitted?id=p4bl0

But it's the same submission as this one which says it was submitted by me 4 hours ago.

I've been contacted a few times by HN moderation and was asked to re-submit some interesting link that didn't get traction on the first try, but it's the first time that I see a link be re-submitted on my behalf. Is that common on HN now?

Anyway, concerning Velato, I stumbled on it yesterday. I find this kind of esoteric languages (like Piet [1]) quite fun, and thought that others here may enjoy it!

[1] https://www.dangermouse.net/esoteric/piet.html


It's funny you link to Piet; I began Velato by asking what would Piet be as music. Some programs are instantly recognizable as Piet while others are hardly recognizable as such; the language has its own aesthetic and yet programmers bring their own style to its set of visual constraints, all through fairly basic rules. In Velato, all notes are read in relation to a root note that can change between commands, even in the middle of a single chord. That was meant to allow for more choice in how a programmer constructs a piece of music.

Years later I interviewed David Morgan-Mar about Piet and his other languages https://esoteric.codes/blog/david-morgan-mar and wrote about the concept of multicoding, where a single text has readings in two systems that shape each other (an image and code, music and code etc) https://esoteric.codes/blog/chef-multicoding-esolang-aesthet...


> I've been contacted a few times by HN moderation and was asked to re-submit some interesting link that didn't get traction on the first try, but it's the first time that I see a link be re-submitted on my behalf. Is that common on HN now?

Not resubmitted but re-upped. That is, we rolled back the clock on it and added some points so that it would get a placement on HN's front page. You can see the stories that get picked this way here: https://news.ycombinator.com/pool, and the system is described at https://news.ycombinator.com/item?id=26998309 and the links back from there.

When a post is older, we email an invite link (as you described) but when it's only a day or two old, we re-up the current submission. That's what happened in the present case. The timestamp munging is an artifact of this re-upping system (https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...).

Thanks for posting great submissions to Hacker News! Btw, if anyone sees a great submission that could use a re-up or a repost, please let us know at hn@ycombinator.com. (It's best when the article isn't your own stuff, but rather something that you just think is interesting.)


How did you stumble on it?


I'm not really sure because it was one of the tab opened in my mobile browser. My best guess would be that I originally saw this link in a post on Mastodon.


This make me wonder why none of the most popular browsers keep browsing history. At least the track where I surfed


Meta: for some reason, dates on almost all comments in this submission have been reset minutes ago and the submission resurfaced back to the front page. Possibly an HN bug? (cc: dang)


alternatively, python files can be interpreted as music

https://github.com/vdwees/tone_trace


Glad to see it's written in C#.

Can we get a port in F# please?

https://github.com/rottytooth/Velato


That's called a modulation.


Way to B# !


[flagged]


Fun :) The point of esoteric languages isn't to be practical, another example of a "strange" language is https://en.wikipedia.org/wiki/Esoteric_programming_language#... / https://esolangs.org/wiki/Piet


I can't comment directly under the OC's thread anymore, but the music he makes on his website is legitimately cool http://rochus-keller.ch/?p=237


This music is forty years old now; if you wan't to hear something more recent, here it is: http://rochus-keller.ch/?p=1268


Maybe. But why should someone take the time to build a technolgoy intentionally without a practical use? With the same effort one can build a useful language, even adding new ideas that will advance development, which is also fun. But actually concluding from the article it seems the author was rather serious about his language; there is no indication he considered it not practical. But unfortunately there is no rationale or reference use case.

EDIT: I cannot believe my top comment was flagged. So have we already reached the point on HN where you are no longer even allowed to ask about the purpose of something or express an opinion?


Your definition of usefulness and mine differ. What you find useful, I find contrived. What I find useful, you find dull. The author was indeed serious about it, in the fact that it's a thing you can play with. Brainfuck doesn't need usefulness to exist. Typescript either. It doesn't always have to be advancing the art of programming. I'd say these fun projects advance the art of mankind.


> these fun projects advance the art of mankind

In which way?


Someone will attempt a Mozart-themed binary sort. It will cause them to either have profound insight into Mozart, or profound insight into programming. Possibly both. Paving the way for the next SoundCloud. You never know. Not everything seems as useless on the surface.


> Not everything seems as useless on the surface.

And vice versa.


> Maybe. but with the same effort one can build a useful language, even adding new ideas that will advance development, which is also fun.

So others must have fun the way you approve of? Otherwise they are having fun wrong?


For the same effort you put into any piece of art, you could always do something more economical, and yet lots of people take their art very seriously.


It's a piece of technology, and it has function. It just hasn't an obvious use case. If someone publishes a programming language, usually they provide examples and a descripton on the purpose of the language, or in which way it improves over other existing languages. It doesnt make any sence to publish a technology which has no obvious use case without any explanation of its intended purpose.


Do you think being a piece of technology means that it can't also be art?

(They could stand to put some examples on the front page, that's fair.)


Technology always includes aspects of art; but form follows function.


Nobody is obligated to "advance development". Also many innovative ideas come from projects that are done without the expectation to get value out of it.

> it seems the author was rather serious about his language

You kind of have to be serious about something in order to invest many hours into creating and finishing it. It can still be fun.


> You kind of have to be serious about something in order to invest many hours into creating and finishing it.

Well, then at least there must have been some vision or goal, thus my question.


Yes, other things can be fun, they can even be fun while being practically useful, but this was still created for fun.


> but this was still created for fun

Why/how do you know this was created for fun? Are you the author?


I'm not the author. I thought you were asking the people of HN since you asked here rather than emailing the author. I've been interested in the esoteric programming language scene since 2009 and in my experience most of the work is done for the joy of it, and the joy of exploring intellectual curiosity. It's true that the author here could be an exception but, as I say, you should contact them directly if it's very important that you understand their motivation.


Well, it's posted here by someone for some reason. I didn't search for it, but was curious what the purpuse is of this idea, since I have a lot to do with MIDI, algorithmic composition and programming languages.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: