Songwriting in Scala: Creating a DSL for writing Music with ADT's
summary
Claims that Scala can model and produce music using ADTs and a small DSL, implemented by compiling to Scala.js + tone.js and wrapping the JavaScript Web Audio API; velocity is discretized into 8 velocity buckets to avoid illegal states; models include Note, Melody, Harmony, Drum, Song and builder methods for readable one‑liner composition; a web audio app is live‑coded and a short multivoice song is played (with a few hiccups) demonstrating the DSL and live‑code and played a song approach.
AI-written summary · about
chapters (10)
- 0:00Songwriting in Scala
- 1:04Modeling music with ADTs
- 7:03What is an ADT?
- 10:12Evolving the musical model
- 14:13Safe note properties
- 18:28Type-safe velocity
- 20:56Readable musical DSL
- 27:13Structuring a song
- 28:59Live demo: composing
- 39:49Summary & Q&A
related talks
42mSounds of Structure - Music Modelling with ADT's
32mScala, Sound, and Structure - Composing Music through FP
27mScala Sampler for Functional Soundscapes
27mScala Sampler for Functional Soundscapes
40mThe Art of Concert Programming
49mMellite: An Integrated Development Environment for Sound
37mHow to code music?
19mComposing music with composed functions
