4 ms·
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 goa
by earlz 11y ago
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
- gnocchi 11y agoIt looks like they are planning on adding a MusicXML export from this issue https://github.com/alda-lang/alda/issues/44 https://github.com/alda-lang/alda/issues/44. Is there any tool which convert from MusicXML to MIDI?
- grimmdude 11y agoSpeaking of MIDI export, I recently wrote a MIDI generator in JS which works pretty nice https://github.com/grimmdude/MidiWriterJS https://github.com/grimmdude/MidiWriterJS Shameless plug of the day, check!
- earlz 11y agoI actually saw that when I was first researching making this project, but I like Ruby a lot more than Javascript so I went with Ruby
- ungzd 11y agoYou can try Overtone and Leipzig (https://github.com/ctford/leipzig https://github.com/ctford/leipzig). I don't know if it supports writing .midi files, but it can output MIDI events in real-time (https://github.com/overtone/overtone/wiki/MIDI https://github.com/overtone/overtone/wiki/MIDI), maybe it's possible to stream MIDI to DAW.
- pierrec 11y agoMIDI I/O is always a nice feature, and having programmed around MIDI quite a bit, I think you make it sound more difficult than it is. It's difficult if you need to write all the MIDI from scratch, but it's easy if you have access to a helper library that does all the low-level for you, which I believe is available for Clojure. It also lends itself well to progressive implementation, for example starting with simple exporting of notes and progressively adding more complete exporting features. (I know, you're gonna tell me "add it yourself"! Which is a good point, but wait, let me find an excuse... Clojure isn't exactly my cup of tea, and my current audio programming interests aren't really in line with the direction this project is taking.)
- rotexo 11y agoit's old, but if you are interested in algorithmic composition, you might check out athenaCL: http://www.flexatone.org/athena.html http://www.flexatone.org/athena.html athenaCL also supports working with nifty things like Xenakis sieves (https://en.wikipedia.org/wiki/Iannis_Xenakis https://en.wikipedia.org/wiki/Iannis_Xenakis) and Markov chains
- TheOtherHobbes 11y agoYou 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 11y agoIt 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.
- earlz 11y agoRegardless of the complications of real-time audio with Ruby, I wasn't intending that. I was talking about generating MIDI files (with very fine resolution timing) and then playing back the already generated MIDI files, so I had no worries about that. I was only trying to figure out an easier way than drawing on a piano roll