Tutorials#
A guided tour of libYSE, organised in five progressive phases that mirror the bundled demos in Demo.Windows.Native. Each tutorial corresponds to a real, compilable demo — the snippets shown here are pulled directly from those files, so they stay in sync as the demos evolve.
Work through them in order if you are new to libYSE; jump straight to the one you need if you are looking up a specific capability.
Phase 1 — Fundamentals#
The minimum you need to put a sound on the speakers.
Other demos in this phase:
Demo12_AudioTest— toggle the engine’s built-in sine-wave test tone viaYSE::System().AudioTest(true). Useful for diagnosing output routing problems.
Phase 2 — Spatial audio and mixing#
3D positioning, virtualisation, channels, and audio devices.
Other demos in this phase:
Demo03_Virtual— load 100 sounds and let the engine virtualise the ones too far from the listener. Set the audible cap withYSE::System().maxSounds(...).Demo06_Devices— enumerate audio output devices and switch between them at runtime viaYSE::System().getDevice(...)andopenDevice.
Phase 3 — Effects and streaming#
Reverb zones, large-file streaming, seeking.
Other demos in this phase:
Demo09_Streaming— stream a large audio file from disk by passingstreaming = truetoYSE::sound::create.Demo10_FilePosition— seek to arbitrary playback positions withYSE::sound::time(samples).
Phase 4 — Advanced DSP and integration#
Custom audio sources, occlusion, virtual file I/O.
Demo07_DspSource— feed audio from a custom subclass ofYSE::DSP::dspSourceObject(a Shepard-tone generator built from 11 sine oscillators).Demo08_Occlusion— register an occlusion callback withYSE::System().occlusionCallback(...)so the engine attenuates sounds by world geometry.Demo11_VirtualIO— load audio data from in-memory byte buffers viaYSE::BufferIOinstead of the file system. Useful for game-engine asset packs and Android.
Phase 5 — Synthesis and control#
Modular synthesis, presets, device resilience, MIDI.
Other demos in this phase:
Demo15_RestartAudio— pause / resume / handle device disconnection withYSE::System().pause()andautoReconnect(...).Demo16_Midi— enumerate MIDI output ports withYSE::System().getNumMidiOutDevices()and send note-on/off viaYSE::midiOut.Demo17_MidiPatcher— pipe MIDI messages into a patcher graph through.noteon/.noteoff/.controlchangeobjects.
How to follow along#
The demos compile alongside the engine — see
Install. Once built, run them from build/bin/ so the
hard-coded ../../TestResources/... paths resolve correctly:
cd build/bin
./Demo00 # play a sound
./Demo02 # 3D positioning