DEV Community

Cover image for The PocketBand Synthesizer: A Journey Through Android, Flutter, and Compose Multiplatform
Nullgrad Apps
Nullgrad Apps

Posted on

The PocketBand Synthesizer: A Journey Through Android, Flutter, and Compose Multiplatform

Hey everyone! I'm excited to share my open-source software synthesizer app, a project I've been developing for the past three years. What began as an Android-only app has gone through two complete rewrites, bringing it to its current state as a cross-platform synthesizer built with Kotlin Multiplatform and Compose Multiplatform.

Why the Rewrites? My Development Path

I initially built this synthesizer natively for Android using Kotlin. It was a good start, but I soon looked into cross-platform development to reach a wider audience more efficiently.

My next step was Flutter. I invested significant time, exploring various state management solutions and building a large part of the app. While Flutter offers many advantages, I ultimately faced significant challenges with Dart's limitations, especially concerning multithreading for the demanding, real-time audio processing required by a synthesizer. I also found that Dart, in its core syntax, has come a long way but will ultimately never reach the finesse of newer languages such as Kotlin. While the development on Dart/Flutter has seen impressive improvements (null-safety!), it became clear Flutter wasn't the right fit for my needs and desires.

During this period, I also became increasingly uncertain about Flutter's long-term future, especially as Google began actively promoting Kotlin Multiplatform. This shift in focus made me reconsider my technology choice for a long-term open-source project.

This led me to Compose Multiplatform. Discovering KMP and CMP was a turning point. The ability to use Kotlin almost across the entire stack—from shared business logic to the UI on different platforms—was exactly what my project needed. Rewriting the app for a second time was a huge undertaking, but it allowed me to leverage Kotlin's strengths, including its robust concurrency features, for the audio engine. The results have been very positive.

Note that in all of the project's incarnations I had to find a way to attach the business-logic to the device's native audio and sensor interfaces. In particular, a real-time audio-output layer is needed which is written using C++. I can tell that attaching this to Android native, or Flutter, or KMP was a whole project in its own right, and it deserves another post. Along with the technical aspects of this came the question of the scope of that RT audio layer. Should it just provide input/output or should it host the entire processing chain? During each stage I changed my objectives here, too. In it's most recent incarnation, I have chosen a hybrid approach allowing to decide the method of low-level optimization on a per-effect basis.

Introducing PocketBand

PocketBand is a modular synthesizer containing various note generators, note effects, sound effects and a generic modulation system which allows to all effect parameters to be modulated and any of the available modulation sources.

In its current state, the app is mainly experimental and not really intended for production use. It can be built for Android and macOS targets.

Why I'm Looking for Contributors: Building a KMP/CMP Synthesizer Together

This project demonstrates the capabilities of Kotlin Multiplatform and Compose Multiplatform for complex applications, particularly in audio development. Now, I'm looking to expand the community around it.

If you're a Kotlin developer interested in:

  • Compose Multiplatform development
  • Audio programming and DSP (Digital Signal Processing)
  • Building robust cross-platform applications
  • Exploring advanced Kotlin features for performance

...then I'd love for you to check out the codebase! I've worked to make it accessible, and there are many exciting areas to contribute, from UI/UX improvements to extending the audio engine, adding new synthesis methods, or building more effects.

Get Involved!

You can find the project on GitHub here:
PocketBand on GitHub

Feel free to open issues, start discussions, or dive straight into the code. I'm actively seeking contributors and would be thrilled to collaborate with anyone interested in pushing the boundaries of what's possible with KMP and CMP in music technology.

What are your thoughts on building complex applications with KMP and CMP? Let me know in the comments!

Top comments (0)