Scala Sampler for Functional Soundscapes
summary
A browser-based sampler built for the Sounds of Scala library maps recorded samples to note keys, repitches by adjusting playback rate, and avoids extreme length by supplying octave-spanning samples and choosing the nearest sample with binary search. Audio I/O and loading are wrapped in monadic effects so only two impure methods touch the Web Audio API. Implementation uses Scala 3, Scala.js, Typelevel Cats and demonstrates a working Pascal's triangle arpeggiator plus a Mobius-strip inspired canon that runs in the browser.
AI-written summary · about
chapters (13)
- 0:00Functional programming & music
- 2:10Sampling as tool
- 5:02Sounds of Scala library
- 7:14Sampler design & pitch
- 11:27Mapping samples to notes
- 13:37Pitch with binary search
- 15:21Impure effects in functional code
- 16:03Melodies via composition
- 18:52Arpeggiating with Pascal’s triangle
- 20:25Building musical sketch
- 21:33Bach’s math in music
- 22:16Möbius strip composition
- 25:50Closing thoughts
related talks
27mScala Sampler for Functional Soundscapes
32mScala, Sound, and Structure - Composing Music through FP
42mSounds of Structure - Music Modelling with ADT's
40mScala and Arpeggio - Audio processing with Scala Native and FS2
45mSongwriting in Scala: Creating a DSL for writing Music with ADT's
46mScala on the Move!
17mParticipatory musical improvisations with Playsound.space
16mDemo: Functional Sound Design
