Composing music with composed functions
summary
Functional techniques convert a human shorthand into playable notes using Ramda and Tone.js over the Web Audio API, composing small pure functions like parseShorthand to return objects {name, octave, length, time}. Examples show partial application and composition (pipeline / stage‑one TC39) and a detune demo mapping A4 440Hz to 444.4 Hz. Array tools (map/filter/reduce) compute total lengths — a sample melody reduces to 1.625s — and the parser produces working audio.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:06What is functional programming
- 3:45Immutability
- 5:01Higherorder functions
- 7:26Map functions
- 8:15Reduce functions
- 10:40Partial application
- 12:40Composition
- 18:40Conclusion
related talks
19mComposing music with composed functions
49mGoing Functional with JS
52mLive Musical Coding: You Code? Become a Composer with WebAudio and WebMIDI!
56mFunctional Programming with JavaScript
39mFreqi: Musical Tuning Systems with JavaScript
44mBeats in the Browser - Coding Music with JavaScript
25mThe Sound of Music
32mFunctional Programming:Learning
