Skip to content

blund/cadence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cadence

A library for real-time audio processing and synthesis.

What and why

Cadence is a small C library that provides the building blocks for audio processing and synthesis. It is intended as a foundation for building digital instruments, audio plugins and audio for game engines. The library is written in portable C code, so that your program can be compiled for any platform, given that you also define the platform interface for it to interact with. So far, the only platform layers are for SDL2 and the Teensy microcontroller.

Cadence currently provides some basic oscillators, effects, midi-support, and a polyphony framework. More utilities will be implemented as I need them :)

The primary motivation for creating Cadence is exploratory programming and having great fun along the way. It is as a lightweight "alternative" to something like JUCE. The goal for Cadence is to have a library that can easily embedded into any project that requires sound.

Please note that this project is very much a work in progress, and is far from mature. Everything is subject to change.

Running on your PC (Using SDL2)

Dependencies

  • SDL2 installed (for audio and video)
  • ALSA libraries (for midi)

Note that the example program only works on Linux for now.

To run the example program, execute the following in the base folder to compile and execute it:

make example

This should open a window, where you can select between a polyphonic synthesizer, a sampler, and a granular synthesizer. To play, simply use your keyboard!

An example program built with SDL2, Nuklear, and Cadence

The example program. Built with SDL2, Nuklear and Cadence.

Running on Teensy

One of the goals of this project is to do sound synthesis on microcontrollers, specifically the Teensy. An example program is provided, which implements a simple platform layer for the teensy, as well as some example code.

Building for Teensy

A few things are required to run Cadence on the Teensy:

When these things are installed and sorted, the example program can be compiled and ran by running the following:

cd teensy
make
make run

Here is a video of my Teensy running the example program:

cadence-teensy.mp4

The example program for for the Teensy, featuring the scale from Ocaria of Time.

Further Work

  • Implement more effects (filters, reverb, distortion, etc)
  • Sample playback on the Teensy
  • Fix fft (currently broken)
  • Refine APIs
  • Lua scripting
  • Platform code for Bela

Credits

  • The base for the SDL platform audio code is borrowed from etscrivner
  • Audio files are handled through Sean T. Barret's stb library
  • UI in the example program is made with Nuklear