https://github.com/thbar/demo-elixir-reloading-music
Demonstrating Elixir code reloading ability (with music events generation)
https://github.com/thbar/demo-elixir-reloading-music
Last synced: over 1 year ago
JSON representation
Demonstrating Elixir code reloading ability (with music events generation)
- Host: GitHub
- URL: https://github.com/thbar/demo-elixir-reloading-music
- Owner: thbar
- License: mit
- Created: 2017-05-03T08:48:00.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-09T12:51:10.000Z (over 7 years ago)
- Last Synced: 2025-03-18T05:51:18.874Z (over 1 year ago)
- Language: Elixir
- Size: 544 KB
- Stars: 54
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
The code in this repository demonstrates how to use Elixir "hot-reloading"
feature, together with MIDI events generation.
Youtube link:
* https://www.youtube.com/watch?v=_VgcUatTilU&feature=youtu.be&t=2m2s
Slides:
* https://speakerdeck.com/thbar/elixir-hot-reloading-and-midi-events-generation
In short:
* `reloading.exs` monitors the file system and hot-reloads `music.exs`
* `music.exs`:
* relies on `GenServer` to ensure the "midi player" will keep state between code reloads
* creates a "tick" every 50 milliseconds
* uses `portmidi` to send MIDI events to [Renoise](https://www.renoise.com)
### How to use?
* Install [Renoise](https://www.renoise.com) demo and load `Song.xrns`
* Run the code:
```
brew install portmidi
mix deps.get
mix run --no-halt reloading.exs
```
* Edit `music.exs` to play around