Plays a catalog of retro sound effects generated by a small software "sound chip" (ADSR envelope + frequency
sweep) built on top of fabgl::SoundGenerator. By Carles Oriol.
The name of each effect is printed on screen while it plays: shot, boom, pong, pic, tuc, piu, fiu fiu whistle, fiu fiu serpentina, motor, then musical scales (escala, escala_inc with the three frequency sweep modes, escalax) and chords (sequential, overlapping and strummed). The sequence repeats forever. There are no controls.
Each effect is a playsounddata structure:
{ attack_ms, decay_ms, sustain (0-127), release_ms, wave, volume (0-127), duration_ms,
freq_start, freq_end, modfreq }wave:WAVE_SQUARE,WAVE_SINE,WAVE_TRIANGLE,WAVE_SAW,WAVE_NOISEmodfreq: how the frequency moves fromfreq_starttofreq_end:MODFREQ_NONE,MODFREQ_TO_END(whole duration),MODFREQ_TO_RELEASE(until the release phase),MODFREQ_TO_SUSTAIN(during attack and decay)
playSound() plays a sound asynchronously (in its own task, so several sounds can overlap); syncPlaySound()
waits until it ends. Copy these two functions to add the same effects to your games: they are used by
DirectVGA_ElMuro and ClassicRacer.
fabgl::SoundGeneratorwith waveform generators attached and detached at run time- Envelopes and frequency sweeps done by changing volume and frequency of a generator while it plays
- VGA output (default pins)
- Audio output on GPIO25
See Building the examples in the main README.