3 **Amuse** is a real-time MIDI and SFX sequencer, with basic effects,
4 3D positional audio and surround-output capabilities.
6 The project is designed for compatibility with Audio Groups and Song data
7 found in PC/N64/GCN/GBA games using the *MusyX* audio engine; providing an
8 alternate runtime library to use for sequencing these games' audio libraries.
12 The Amuse API exposes full interactivity between a client application
13 (game engine) and the sequencer engine. Unlike the interrupt-driven nature
14 of the original console implementations (where the audio chip 'requests' more
15 audio as needed), Amuse is entirely synchronous. This means the client must
16 periodically *pump* the audio engine (typically once per video frame) to keep
17 the OS' audio system fed.
19 The client must provide the implementation for allocating and mixing audio
20 voices, since this may drastically differ from target to target.
21 `amuse::IBackendVoiceAllocator` is the pure-virtual interface to implement
22 for this. Alternatively, if [Boo](https://github.com/AxioDL/boo) is present
23 in the CMake project tree, Amuse will be compiled with a backend supporting
24 multiple popular low-level audio APIs. Windows, OS X, and Linux all have
25 excellent support this way.
27 Here's an example usage:
30 #include <amuse/amuse.hpp>
31 #include "MyVoiceAllocator.hpp"
32 #include "MyAudioGroupLoader.hpp"
34 int main(int argc, char* argv[])
36 /* Up to the client to implement voice allocation and mixing */
37 std::unique_ptr<amuse::IBackendVoiceAllocator> voxAlloc = MakeMyVoiceAllocator();
39 /* Application just needs one per audio output (not per channel) */
40 amuse::Engine snd(*voxAlloc);
42 /* An 'AudioGroup' is an atomically-loadable unit within Amuse.
43 * A client-assigned integer serves as the handle to the group once loaded
45 amuse::IntrusiveAudioGroupData data = LoadMyAudioGroup();
46 snd.addAudioGroup(data);
48 /* Starting a SoundMacro playing is accomplished like so: */
52 std::shared_ptr<Voice> voice = snd.fxStart(sfxId, vol, pan);
56 while (passedFrames < 300)
63 /* Stopping a SoundMacro is accomplished by sending a
64 * MIDI-style 'KeyOff' message for the voice
68 /* Play for 2 more seconds to allow the macro to gracefully fade-out */
70 while (passedFrames < 120)
77 /* Clean up and exit */
84 In addition to the library, a command-line tool for performing various pipeline
85 tasks is provided. Compilers for audio groups and song data, as well as basic
86 playback functionality is available via the tool.