Skip to main content

Livecoding soundscapes in Kotlin with Compose Multiplatform

UA2.220 (Guillissen) | Day 2 | 14:30 - 14:55 | Speakers: Merlin Pahic

Livecoding soundscapes in Kotlin with Compose Multiplatform
A picture of a devroom at FOSDEM 2024
Open in browser

Notes

Abstract

Kotlin's Compose Multiplatform allows for the creation of beautiful user interfaces in a declarative, functional paradigm. But the Compose compiler isn't limited to creating UI or even visuals.

In this talk, we explore using the Compose compiler to create soundscapes and other pieces of music. I will present a library and domain-specific language (DSL) for musical composition.

We'll start by looking at the building blocks of musical compositions and how Kotlin and Compose Multiplatform can be used to implement them in a declarative and functional way. This includes tone generators/synths, shaping the envelope of a sound, playing samples, expressing various timings and simultaneously playing multiple tracks, and creating a drum machine. We'll also see how a powerful DSL allows us to more conveniently express complex rhythms.

Following that, we'll look at how to implement the audio generation backend on multiple platforms, and some ways to optimise the Compose code – the precise timings required for music present a particular challenge. We'll also see how the audio generation integrates with existing Compose components, and how to create enlightening visualisations of the code and music.

Attachments


Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.