Gekkota is a piece of software which generates audio data using algorithms to determine the sound wave frames using linear algebra. It uses C/C++/HIP to harness the power of CPU's and GPU's to build and create electronic music from algorithms and patterns. The application features both a live performance interface and a recording/sequencing user interface.
The engine multiprocesses between foreground and background activities to create music. Incoming ui or midi events trigger algorithms. These algorithms influence the data used on the CPU and GPU to output sound to the ALSA driver. The application leverages platforms on Linux, such as Wayland, the compositor and window manager which is the successor to Xorg, ALSA which is the userland driver for the Linux kernel, Blend2D which is a high performace 2D vector graphics engine, and the AMD ROCM/HIP platform for processing the sound generation on the GPU.
The objective of Gekkota is to be a system that can synthesize transitions in sound shapes to create unuque mosaic effects for music. Further uses in synthesizing audio from 3D models, or generating analysis plugins is possible, though not in active development.
Gekkota is written in C/C++ using HIP for GPU processing in a Linux environment. The main application is broken up into subfolders to handling the inputs, outputs, and processing of the system. Within the Gekkota application, there are seperate threads for managing the ui/midi instruments or processing the sound data on the CPU/GPU. These threads call, listen, or call out to their respective devices and gather information.
The sound algorithms are packed into a packet structure so they can easily be shared as memory to the GPU for processing. Most of the arithmetic/vector calculations take place on the GPU in C code using the struct gka_entry arrays (see audio-segment.h for details). These segment arrays are configured to be navigated by both the CPU/GPU for ease of sharing in order to both compose sounds (CPU) and render them to frames (GPU).
sounds | frames | ||||
---|---|---|---|---|---|
melody1 | 0.12 | 0.13 | 0.14 | 0.15 | ... |
melody2 | 0.00 | 0.00 | 0.00 | 0.10 | ... |
kick | -0.01 | -0.00 | 0.01 | 0.02 | ... |
snare | 0.23 | 0.25 | 0.30 | 0.28 | ... |
final frame | 0.34 | 0.38 | 0.45 | 0.55 | ... |
The present state of Gekkota is that the calculation and memory architectures are in place along with most of the base ui infrastructure. The engine successfully processes sounds according to the algorithms for volume and frequency, using the GPU to expedite the calculations. Visualization of the data is in place, but utilization of the events to propogate information is limited. MIDI divices are used directly as binary packets for playing live.