1 Table of Contents
2 About
synergy_replay is the free and open-source (MIT license) standalone player for the Synergy sequencer (aka Syntracker) and Eureka DAW.
It can be integrated in video games and demos for playing music and sound effects.
Instrument data is stored in .syn files, sequencer data in .mid Standard MIDI files (SMF).
The replay uses a "C" API.
3 Demo
This demo tune is ~23kb in size (compressed), uses (up to) 194 stereo voices, and consists of 26 tracks and 24 procedurally generated samples (~4727kb in RAM). Some instruments use realtime phase modulation sound synthesis (bass, chords, some of the percussion), and there are 13 audio FX (eq, delay, chorus, reverb) and 42 output sends.
The procedural samples (including the bass and snare drums) are generated by Eureka's built-in
Cycle modular softsynth, and some are generated from procedural track MIDI sequences (e.g. the
rain effects). The opening sound uses a procedurally generated wavetable.
No pre-baked (static) samples were used in this demo tune.
The average CPU load is ~14% on a single M2pro CPU core, and the (multi-)sample precalculation takes a little under a second.
4 History
With the rise of arcade machines, home computers and video game consoles in the 1980ies, and their ever increasing audio capabilities due to synth chips like the Commodore 64's SID 6581/8580, Ricoh's 2A0x (NES), Atari's POKEY, General Instruments' AY-3-8912 (CPC, ZX Spectrum), Yamaha's YM (arcades and Sega Genesis) and OPL series (MS-DOS PCs and MSX), Hudson Soft's HuC6280 (PC-Engine), Commodore Amiga's Paula, and Sony's SPC700 (SNES), came a slew of music players and editors for producing sound effects and music for video games.
At the same time, aided by the popularity and affordability of the C64, Atari ST, and Amiga home computers in particular, people, mostly in Europe, began to form non-profit demoscene groups who produced (non-interactive) programs with stunning graphics and sound, often rivaling, or even exceeding the quality of commercial games .
While the music for video games, especially in Japan, was often composed using MIDI or MML (Music Macro Language), in Europe the preferred formats were Trackers, which originated in the demoscene, most notably 1987's Soundtracker (and its mod format) for the Commodore Amiga .
With the advent of CDROMs in the late 80ies (e.g. the PC-Engine CD-ROM2 in 1988), it became viable to produce music by all means necessary, including professional audio gear / synthesizers, or even full blown orchestras.
By the end of the millenium, the hardware capabilities of computers and game consoles skyrocketed. In 1999, the Playstation 2 for example came with 48 (mono) / 24 (stereo) hardware channels, and, not soon after, the original X-Box (in 2001) featured 256 hardware stereo voices (NVidia MCPX/SoundStorm APU).
For a while, (audio-)hardware limitations were still a challenge on mobile devices like the Gameboy Advance but later systems like the Nintendo 3DS or the Sony PSP came with dedicated DSPs (digital signal processors) for mixing audio and decoding MP3 streams (often not accessible directly on a low level but only via software APIs).
With virtually limitless sound capabilities, CD / DVD like sample rates and high audio channels counts, the data sizes for the voice sample data soon exceeded that of a mixed down and compressed stereo stream, making the latter the preferred and most common way of storing music for games today.
5 Realtime music and effects
With MP3s / compressed audio streams having a clear production workflow advantage over realtime sample / sound synthesis, what are the reasons for using non-standard editors and replay routines in this day and age ?
Here are some:
- small file sizes (music and sound effects can fit into a few kilobytes rather than (hundreds of) megabytes)
- music playback can have more or less subtle variations on each playback iteration (e.g. by randomizing instrument parameters)
- in interactive software like games, music can adapt to the gameplay (beyond mixing pre-rendered streams)
- same goes for sound effects (avoiding the machine gun effect)
Granted, if you are working on the next billion dollar AAA game, this is most likely not for you and you will want to stick to the standard workflows and tools.
However, for indie-games (and demos), this could be an interesting option that goes well beyond traditional tracker modules in terms of audio quality and replay features, while still retaining a low data / RAM / CPU footprint.
Last but not least: It's More Fun to Compute.
6 Supported features
synergy_replay supports a large subset of all the Synergy / Eureka editor features.
Here's a technical feature list summary:
- sampler
- up to 128 mono or stereo samples, up to 128 zones per sample (⇒ 16384 sample zones total)
- 16x modmatrix (log/exp curves, slew up/down, 208 sources, 213 destinations)
- 1d and 2d wavetables (gritty nearest neighbour or smooth interpolation)
- 4 A(D)SR envelopes per zone
- 4 LFOs per zone
- 4 mod sequencers per zone
- 8 voice calibration tables per zone
- 8 initial performance controllers per sample
- sample and bitrate reduction
- 26 built-in filter types
- anti-aliasing / anti-imaging filters
- linear, vsr, and sinc interpolation (or no interpolation)
- glide (8 types, glissando, configurable retrigs)
- SNES / SPC700-like sample compression
- up to 255 tracks / lanes
- up to 8 outputs per track
- up to 4 FX modules per track
- automatable track sends
- track note and velocity filters (+ automatic drumkit conversion in editor)
- up to 16 MIDI ports + 16 MIDI channels per port (⇒ 256 channels total)
- pitchbend, CC, RPN, program change, channel + poly pressure MIDI controllers
- procedural sample waveforms (Cycle softsynth)
- procedural sample sequences (interweaved with procedural waveforms)
- user defined STFX voice plugins (generators and effects)
- sequencer
- standard MIDI (multi-track) file format (SMF / .mid) (up to 256 channels)
- tempo / BPM changes
- external MIDI events (notes, modulation)
- built-in STFX plugins (customizable from 200+ stock plugins)
- e.g. amp, eq, chorus, delay, reverb, compression, wave shapers, resamplers, filters, ..
- user defined STFX voice and track effect / instrument plugins
6.1 Restrictions
The following features are currently not supported by the standalone replay (some may be added in future versions):
- audio timeline tracks
- drumkit tracks (can be auto-converted, though)
- additive synthesis wavetable mode
- MPE (MIDI polyphonic expression)
- sample-bank and sample-zone tuning tables
- non-sequential voice plugin routing
- audio input / live recording
The default configuration uses the following (configurable) limits:
- max. number of tracks: 48
- max. number of outputs per track: 8
- max. number of registered plugins: 32
- max. number of FX modules per track: 4
- max. number of samples: 128
6.2 MIDI
Even though, at its heart, Synergy is a tracker (but also has piano-roll, drum, and timeline editors), sequencer events are stored as MIDI streams.
This is
- much smaller than fixed-grid tracker module pattern data
- offers more artistic freedom in terms of microtiming, live recording and arrangements, and number of simultaneous events per tick.
It does support classic tracker effect commands via the bundled PTFX script, though.
7 Workflow
- compose your music / sound effects in Synergy (using the Tracker or any other sequencer node)
- in Synergy: export the sequencer data to a
.mid file using the Export Standard MIDI File dialog (see stop button menu)
- set
Multi-Track to mixed mode (DAW device per SMF track)
- set
Num.Bars to the song duation
- click
Export, then copy the .mid file to the synergy_replay/music/ folder
- in Eureka: export the instrument / sample data to a
.syn file (Export ⇒ Export SYN..)
- make sure that a MIDI program number is assigned to each sample (otherwise it will not be exported)
- do not use any VST / CLAP plugins (STFX plugins are allowed, though)
- do not use audio timeline tracks (this feature may be added later)
- when using drumkit tracks, convert them to regular lanes using the track context menu utility function
- if procedural waveforms are used, the export function will also write a
autogen_calc_<xyz>.c file to the autogen_cycle/ folder
- copy the
.syn file to the synergy_replay/music/ folder
- edit
synergy_replay/main.c and the (platform-specific) Makefile (e.g. makefile.linux)
- in case of procedural waveforms: add the
autogen_cycle/autogen_calc_<xyz>.o object file (replace the default one)
- add / remove voice plugin modules as required (or keep the default selection)
- change
SONGNAME as required
8 Building
First of all, check out the GIT repository at https://github.com/bsp2/tks.git.
8.1 macOS
% cd tks
% . ./setenv_macos.sh
% cd tksampler
% m bin_sr
% cd synergy_replay
% m clean
% m bin
% ./sr_replay
macOS build steps
|
tested in the homebrew environment (using Apple's CLANG-based XCode compiler) |
|
install portaudio via brew install portaudio |
8.2 Linux
% cd tks
% . ./setenv_linux.sh
% cd tksampler
% m bin_sr
% cd synergy_replay
% m clean
% m bin
% ./sr_replay
Linux build steps
|
on Debian / Ubuntu, install portaudio via sudo apt-get install portaudio19-dev |
9 API
The main functions (in chronological order) are:
void sr_init (void) - Initialize Synergy replay (e.g. init look-up tables)
void sr_set_mix_rate (float mixRate) - Set mix rate (def=48kHz)
void sr_set_volume (float volume) - Set master volume (def=0.94 = ~-0.5dB)
sr_bool_t sr_register_plugin (st_plugin_single_init_fxn_t initFxn) - Register an STFX plugin
sr_proj_t sr_proj_new (void) - Create new project instance (instruments, samples, audio tracks)
sr_song_t sr_song_new (void) - Create new song instance (MIDI tracks)
sr_bool_t sr_proj_load_file (sr_proj_t proj, const char *pathName) - Load project file (.syn)
sr_bool_t sr_song_load_file (sr_song_t song, const char *pathName) - Load song file (.mid)
sr_bool_t sr_proj_alloc_mix_buffers (sr_proj_t proj) - Allocate (track) mix buffers
void sr_calc_cycle_waveforms (sr_proj_t proj, sr_song_t song, sr_cycle_calc_waveform_fxn_t cycleCalcWaveformFxn) - Calculate procedural waveforms
void sr_process (sr_proj_t proj, sr_song_t song, float *mixBuf, unsigned int numFrames, sr_bool_t bClearMixBuf) - Play song / Render interleaved stereo buffer
void sr_song_delete (sr_song_t song) - Delete song instance
void sr_proj_delete (sr_proj_t proj) - Delete project instance
void sr_exit (void) - Shutdown Synergy replay
|
st_plugin_single_init_fxn_t is a pointer to the plugin init function, e.g. amp_init in amp.c |
|
sr_cycle_calc_waveform_fxn_t is a pointer to the auto-generated cycle_calc_waveform_<songname> function in autogen_calc_<songname>_float.c ( example) |
9.1 External MIDI events
The external MIDI API sr_midi_* functions can be used to trigger sound effects, pre-rendered sequences, and modulate synth parameters and effect / mixbus sends.
void sr_midi_program_change (sr_proj_t proj, u8 port, u8 ch, u8 program);
void sr_midi_note_on (sr_proj_t proj, u8 port, u8 ch, u8 note, u8 vel);
void sr_midi_note_off (sr_proj_t proj, u8 port, u8 ch, u8 note, u8 vel);
void sr_midi_midi_pitchbend (sr_proj_t proj, u8 port, u8 ch, u16 pb);
void sr_midi_channel_pressure (sr_proj_t proj, u8 port, u8 ch, u8 v);
void sr_midi_poly_pressure (sr_proj_t proj, u8 port, u8 ch, u8 note, u8 v);
void sr_midi_cc (sr_proj_t proj, u8 port, u8 ch, u8 cc, u8 v);
void sr_midi_rpn (sr_proj_t proj, u8 port, u8 ch, u16 rpn, u16 v);
external MIDI API
|
These functions must only be called from the same thread that calls sr_process(). |
10 Downloads
11 License
Distributed under terms of the MIT license (https://opensource.org/licenses/MIT)
Copyright 2006-2026 by bsp
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
MIT license
Document created in 4ms on 27-May-2026 14:48:19