Skip to content

GorgeousMooseNipple/beep-boop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beep-boop

Toy synthesizer written in Rust.
I was just curious how to make this thing produce sounds. Also this was my first non "Hello, world!"-type project in Rust.
It works on Ubuntu 20 and its the one and only platform I truly tested it on.

Contents

Dependencies

  • Beep-boop uses Portaudio-rs to produce sounds
  • Druid for that magnificent look
  • Rand to generate random numbers for phase purposes
  • and Num-traits to define sample formats

Interface

Beep-boop UI

Beep-boop has two identical oscillators with five waveforms each:

  • Sine
  • Triangle
  • Saw
  • Square
  • Pulse with 25% width

Both oscillators have volume slider, transpose control which changes pitch in semitones and tune control to change pitch in cents.
There are up to 7 unison voices. If current unison count for oscillator is more than 1, tune control starts to act as a spread control, affecting fine tuning of each unison differently relative to base pitch.
So if you have 5 unisons with tune control at 10 and play middle C, 1 voice is going to be right on the middle C frequency (around 261.63 Hz), 2 unisons 5 cents apart from that (one 5 cents up and the other 5 cents down) and other 2 unisons 2.5 cents apart from middle C.

For each oscillator you can pick one of the two ADSR-envelopes.
Envelopes have log scale sliders for standard attack, decay, sustain and release controls. Values for sustain are in 0.0-1.0 range and for the other parameters it's from 1 ms to 3000 ms. With Ctrl+click those values can be reset to default.

Of course there is general output volume slider on top-right. And that's it.

Controls

It can be played only with keyboard and uses piano-like layout where 'z' key is binded to C piano key, 's' key is C#, 'x' is D and so on ending on 'm' key which represents B. It's range is only one octave, but you can switch octaves up and down using left and right arrow keys.

Application can be closed by pressing Escape.

Demo

Very unprofessional demo recorded on a microphone directly from my speakers. Sorry about quality.

beep-boop-demo.mp4

TODO:

  • Probably rework all the internals responsible for producing sounds and optimise it
  • Make limited pool of voices available
  • Switch between mono and poly modes
  • Some form of panning, maybe stereo spread for unisons
  • Would be great to implement basic LP/HP filters