Bragi is a modular, real-time, sound synthesizer written in Java. It is still in progress and only has a rudimentary user interface. Following modules are provided:
- LFO: Low Frequency Oscillator
- VCO: Voltage Controlled Oscillator
- DCG: Direct Current Generator
- Keyboard: a basic keyboard based on computer keyboard (from F3 to E6)
- Theremin: some kind of theremin (with just pitch and volume, not the incredible timbre of the real instrument)
- Mp3Player: basic MP3 file player
- WavPlayer: basic WAV file player
- FlacPlayer: basic FLAC file player
- WhiteNoiseGenerator: white noise generator
- PinkNoiseGenerator: pink noise generator
- Microphone: a module connected to your microphone
- ADSR: envelope generator with Attack, Decay, Sustain and Release parameters
- VCA: Voltage Controlled Amplifier
- VCF: Voltage Controlled Filter (with low-pass or high-pass response)
- Mixer: Mixer with two inputs controlled with gain sliders
- Sampler: an experimentation to change the sample rate or sample size
- Ditherer: an experimentation with dithering
- Oscilloscope: basic oscilloscope
- SpectrumAnalyzer: basic spectrum analyzer
- Speaker: a module connected to your speakers
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Java 21+
- Maven 3.6.3+
- Git 2.34.1+
- Clone the repository from GitHub:
git clone git@github.com:Achaaab/Bragi.git
- Import the project Bragi in your IDE.
- Run the test class
com.github.achaaab.bragi.Test
.
var player = new Mp3Player(TEST_MP3_PATH);
var speaker = new Speaker();
player.connectOutputs(speaker);
// optional part: spectrogram with fancy effects
var spectrum = new SpectrumAnalyzer();
player.connect(spectrum);
var adsr = new ADSR();
var keyboard = new Keyboard();
var vco = new VCO();
var vcaEnvelope = new VCA("vca_envelope");
var speaker = new Speaker();
var lfo = new LFO();
var vcaTremolo = new VCA("vca_tremolo");
// main chain
keyboard.connect(vco);
vco.connect(vcaEnvelope);
vcaEnvelope.connect(vcaTremolo);
speaker.connectInputs(vcaTremolo, vcaTremolo);
// ADSR + tremolo
keyboard.getGate().connect(adsr.getGate());
adsr.connect(vcaEnvelope.getGain());
lfo.connect(vcaTremolo.getGain());
// some tuning
vco.setWaveform(SAWTOOTH_TRIANGULAR);
adsr.setAttack(1000.0);
adsr.setRelease(2.0);
// visualization
var oscilloscope = new Oscilloscope();
var spectrum = new SpectrumAnalyzer();
vcaTremolo.connect(oscilloscope, spectrum);
var noise = new WhiteNoiseGenerator();
var vca = new VCA();
var filter = new LowPassVCF();
var speaker = new Speaker();
// very low noise (-200 dB) is enough to trigger "self" oscillation of filter
vca.setInitialGain(-200);
// maximum emphasis
filter.setEmphasis(1.0f);
noise.connect(vca);
vca.connect(filter);
speaker.connectInputs(filter, filter);
// visualization
var oscilloscope = new Oscilloscope();
var spectrum = new SpectrumAnalyzer();
filter.connect(oscilloscope, spectrum);
- IntelliJ IDEA - Integrated Development Environment
- OpenJDK - Java Development Kit
- Maven - Dependency and build management
- OpenJFX - Application platform
- JLayer - MP3 decoder
- Log4j - Logging API
- git - Version control system
- GitHub - Project management
I am not developing Bragi at this moment, but any contribution is welcome.
- Jonathan Guéhenneux - Programmer - Achaaab
This project is licensed under the GNU General Public License (GPL) - see the LICENSE.md for the details.
I thank:
- Damien Di Fede for his FFT implementation,
- Ernest Yu for his range slider,
- Bram de Jong for his useful compilation of DSP resources musicdsp and the corresponding website,
- Project Nayuki for his demystifying one-file FLAC decoder. His website is also overflowing with interesting articles.