Music layer (wauvio/ext)
Music layer overview
The music layer (wauvio/ext.hpp, directory wauvio/ext/) sits on top of the core. It adds a musical vocabulary — MIDI-numbered notes, dynamics, articulations, chords, scales — plus a polymorphic Instrument interface, a library of modeled instruments, sample playback, arrangements, genre styling and a configurable WAV renderer. Everything lives in wauvio::music, except the concrete instruments (wauvio::instruments) and the render options (wauvio).
See it in action: A melody · A small band
ext.hpp includes wauvio.hpp and then, in order: core types, sampling, modeled-instrument bases, render, the instrument families, and the genre system.
| Area | Header(s) | Page |
|---|---|---|
Musical types, Instrument, Track, Arrangement, scales | ext/core/core.hpp | Core types |
TimbreRecipe and instrument family base classes, DrumKit | ext/core/model_instruments.hpp | Modeled instruments |
WAV loading, SampleZone, MultiSample, SampledInstrument | ext/samples/sampling.hpp | Sampling |
RenderOptions, render() | ext/core/render.hpp | Rendering |
| Genre presets and styling | ext/genre/*.hpp | Genre system |
| Concrete instruments (≈300 classes) | ext/instruments/** | Instrument catalog |
Minimal example
#include "wauvio/ext.hpp"
using namespace wauvio;
music::Arrangement arr;
arr.tempo = music::Tempo(110);
instruments::Trumpet trumpet;
trumpet.reverb(); // per-instrument FX, chainable
music::Melody tune = {
{60, 0.5}, {64, 0.5}, {67, 0.5, music::Dynamics::f},
music::rest(0.5), {72, 1.0}
};
arr.add(trumpet, tune);
arr.limiter();
render(arr, "out.wav"); // RenderOptions defaults: 44.1 kHz, 16-bit stereo
Instruments are held by pointer inside tracks, so they must outlive any Track/Arrangement that references them.