The Seystertron Digital Synthesizer
This is the comprehensive manual for the Seystertron. It is my hope that the information in this manual will also be useful to people trying to understand synthesizers in general. To that end, I also attempt to give simple explanations of how some of the modules described were implemented. If you don't want to read this whole document before trying out the synthesizer (I don't blame you), go to the
Try the Synthesizer section for a quick start.
Overview of the Seystertron
- The Seystertron has two oscillators that can put out either sine waves, square waves, triangle waves or sawtooth waves.
- The mixed signal can be filtered through a low-pass or high-pass filter.
- Simple chorus and digital delay effects are available. The digital delay has a full two seconds of delay.
- An oscilliscope view shows the audio signal visually.
- A pattern editor allows a two measure melody to be programmed for the synth to play
- The synth has a whole bunch of cool looking sliders and buttons. If you pretend you know what the all do, you may be able to look really smart in front of your friends. Sadly, this probably won't work on a date.
- The Seystertron is free software under the BSD license!
The Oscillators
The controls for each oscillator allow you to choose which waveform to output. The square wave is more accurately described as a pulse. When the square wave is selected, you can modify the pulse width with the slider marked PW. Oscillators are always tuned to the frequency of the notes being played. However, the tuning slider allows you to adjust them to be slightly higher or lower. Changing the tuning of just one oscillator has an interesting effect. A beat frequency is created that is equal to the difference in frequency between the two oscillators. You will hear the output get quieter and louder at this frequency. Try it!
The Mixer
The mixer's job is to take the output of the two oscillators and combine them. The most obvious thing to do is simply add them. That is exactly what the mixer's default behaviour is! The bottom slider allows you to make either of the oscillators louder or quiter than the other. You can also set the mixer to cross-modulation, which multiplies the oscillators' signals instead of adding them. This will usually double the frequency of the output (making it an octave higher). Finally, you can select just one oscillator that you want to be the output.
The Filter
This filter is implented as an Infinite Impulse filter (IIR). Specifically, it is a two-pole Chebyshev filter. The actual implementation of such a filter is relatively simple, but some of the math involved is fairly advanced (i.e., it hurts my head). If you're interested in it, I highly recommend
The Scientist and Engineer's Guide to Digital Signal Processing. It has a great deal of useful knowledge about digital signal processing and is available for free on the Internet (though you can buy a handy book version).
The first slider controls the cutoff frequency. For a low-pass filter, all frequencies higher than the cuttof will be filtered out. This means that a high cutoff frequency will leave the signal mostly unchanged, and a very low cutoff frequency will silence the signal. For a high-pass filter, signals below the cutoff are filtered out, and the opposite is true. For the high-pass filter, I recommend using low cutoff frequencies to get the best results.
The resonance slider is set to control the filter's pass-band ripple. You may want to play around with it, but it doesn't have any effect that I can hear, even while changing the cutoff frequency. Perhaps I'll fix this in a later version. Sorry.
The Chorus
The goal of a chorus effect is to make one instrument sound like it is two (or more) instruments being played together. This can be done by mixing the orignal signal with the same signal after a short delay. In order to make the effect more convincing, the delay time oscillates, which has the effect of slightly shifting the delayed signal's pitch.
You can turn the chorus on and off with the checkbox at the bottom of its control panel. The level slider adjusts how loud the delayed signal is compared to the dry (original) signal. The frequency slider adjusts the frequency of the delay time's change (i.e., how frequently the chorus cycles its delay time up and down). The depth effects how great the chorus' longest delay time is. When the depth is high, the chorus effect will cycle between a long delay and a short delay. When the depth is low, the difference between those two delay times will be much less.
The Digital Delay
Input into the delay effect is replayed after a short delay. The delay time can be controlled with a slider. At its maximum setting the delay is two seconds long, which is a fairly long time (try it). The level slider lets you set how loud the delayed signal is compared to the dry (original) signal. At the highest level, the delayed signal is as loud as the dry signal. The digital delay can also take its final output (i.e. the dry signal mixed with the delayed signal) and mix it into the buffer it uses to store the delayed signal. This causes sounds to echo several times. You can turn this on by increasing the feedback level.
Master Controls
The gain is fairly simple. At it's default setting it does nothing. Moving the slider up will amplify the signal up to three times, and moving it below the original position will make the signal quieter. If you see clipping on the oscillator (the signal goes off the chart and peaks get clipped off) you can lower the gain to fix this. You can also create a simple distortion effect by increasing the gain to intentionally drive the signal into clipping.
Hopefully, you won't need to play with the latency. Sound cards store audio in a buffer before it gets played. This means that, if the synthesizer is interrupted by another program (as happens with modern, preemptive multi-taksing operating systems) the sound card can play the buffered audio while it waits for the synthesizer to continue producing a signal and filling the buffer back up. If the program stops producing a signal long enough for the buffer to run out, then the sound card has nothing to do but play silence. There is a tradeoff here. This buffering introduces latency. That is, the audio gets delayed slightly. If you change a parameter on the synth, you will have to wait a short time before you hear the change because the buffer still has audio in it from before the change that has to be played. Lower latency (meaning a shorter buffer) will make the synth more responsive, but it will be more likely that the sound card will run out of audio in the buffer from time to time,
causing skipping. Higher latency (a longer buffer) prevents this, but makes the synth less responsive. The default setting causes about a tenth of a second latency, which seems to be the optimal setting. If it seems like the sound is skipping, increasing the latency might help. If you think you've got a really beafy system, you may want to see if you can lower the latency a bit, but you'll probably be dissapointed. I tested this on a 1.8MHz P4 and a 600MHz P3, and the lowest reasonable setting on both of them was the same (the default). I think that the optimal setting is not really dependant on hardware but is more a property of Java's sound API.
The Oscilliscope
The oscilliscope is the very last component in the signal path. It does not modify the signal in anyway. It just provides a simple display of the signal. This was mostly helpful for me during development, but it still has uses. Most importantly, it shows when a signal is clipping. If the amplitude of the signal (shown on the scope's vertical axis) goes off the top or bottom of the scope, this means that the signal is clipping and the gain needs to be reduced.
The scope display can be turned off for the sake of sparing processor power. Try this if the synth seems to run too slowly. The slider to the oscilliscope's right is for triggering. The signal is usually periodic, so the oscilliscope attempts to start at the same place in the signal every time it scans across. Trigerring affects where it it looks for the begining of each period. You can try to adjust this if the signal on the scope jumps around a lot, though it is not guaranteed to help. The trigerring setting will not affect the sound.
The Pattern Editor
Some computer synthesizers can be played using keyboard keys to play notes. Unfortunately, the Seystertron's latency makes this scheme impractical. Waiting a tenth of a second for a note to be played after pressing the key may not seem all that bad, but when trying to play a melody, it's agonizing. Besides, a computer keyboard is not well suited to acting like a piano.
Instead, I've provided an approach that I think is more fun. There is a pattern editor that allows you to program a two measure melody for the synthesizer to loop. If you don't want to write music and would rather just get into tweaking the synth parameters, feel free to simply press the play button and get to tweaking. When you start the synth, there is already a catchy melody programmed in. Otherwise, press the "Show Pattern" button to bring up the pattern window.
The pattern window is a grid. The horizontal axis is time. Each box represents one sixteenth note. You have two measures to write in. A red line seperates the two measures.
The vertical axis is the note. A handy piano graphic on the left shows you what note each space represents. The very bottom note is a rest (i.e., nothing is played).
Green bars represent notes to be played by the synth. When the synth gets to the beginning of a green bar, it begins playing that note. It continues to play it until the end of that bar. To place a note, simply click the square where you want it to begin. You can remove a note by clicking its left-most square. Note that you cannot remove the first note.
The Seystertron is a monophonic synthesizer. This means that it plays only one note at a time. This effects how the pattern editor works. If you add a note where a note is already being played, that note will end there. Each of the notes (green bars) ends at the sixteenth note before next note begins. To make a note longer, you need to remove the note after it. To make a note shorter, you need to put in another note to cut it off. If you want a note to end before the next note begins, place a rest note, which does not do anything but end a note.
That said, the best way to figure out the pattern editor is to click around in it for a few minutes. It's pretty simple, even if my long winded explanation made it seem more complicated than it is.
The Envelope Filter
The audio signal is actually processed through the envelope filter after the low-pass/high-pass filter and right before the chorus, but I've put its explanation here so that it's after the explanation for the pattern editor.
When you press a key on a piano, does it emit a continuous tone until you let go of it? More likely, it makes a loud noise when you hit the key, continues playing the note more softly if you are pressing the pedal, and then fades when you let go of the key. The kind of envelope filter the Seystertron uses (sometimes called an ADSR filter) approximately models this. When you press a key on a synth that uses such a filter, the note gradually rises to its maximum volume, then begins to fade to a lower "sustain" volume. It stays at this volume until you let go of the key, when it fades to nothing. The attack (A) setting for an ADSR filter changes how long it takes the note to fade from nothing to its maximum volume when you first press the key. The decay (D) setting changes how long it takes to fade from the maximum volume to the sustain volume. The sustain setting (S) changes the sustain volume, which is the volume reached after the key has been held down for some time
(depending on the attack and decay settings). If you set the sustain to its lowest setting, the note will fade to nothing even if you hold the key. Setting the sustain to its max will make the decay value irrelevant, as the note will stay at its maximum volume. Finally, the release (R) setting effects how the note fades when you let go of the key.
Of course, you can't actually press the keys when you are using the Seystertron. The attack (a key press) occurs when the pattern editor encounters a note. It acts as if that key is held for the duration of that note. A release (as if you let go of the key) only happens when the pattern editor encounters a rest note. Otherwise, only attacks occur.
As an aside, many synthesizers implement another ADSR envelope in addition to a filter that acts like this one. Instead of modifying the volume of the note, it affects the filter cutoff-frequency. The Seystertron does not have this kind of envelope.
The LFOs
The low-frequency oscillators (LFOs) do not modify the signal directly, but allow for some pretty cool sounds nonetheless. Instead, they modify the parameters of the synthesizer. In the Seystertron, each LFO can be set to modify oscillator puslewidth, oscillator tuning, or the filter cutoff. The frequency setting is how fast the chosen parameter is oscillated. If the waveform is set to a triangle wave, the parameter will rise and fall gradually. If the waveform is a sawtooth wave, it will rise gradually and then fall sharply. Finally, a square wave will cause the parameter to jump suddenly between two settings. The depth parameter sets how big the change is. Finally, the path is just tells the LFO what parameter it should change. Don't bother trying to set two LFO's to the same parameter, only one of them will do anything.
The Panic Button
Don't panic! The panic button is in case a bug causes a loud noise that you can't stop. It will stop the pattern if it is playing and clear all audio buffers in the program. In practice, it is very unlikely that you will need to use this. But I put it there because it's funny. If something does go wrong enough that you can't stop the synth, it's not particularly likely that the panic button will fix something, but you may want to give it a shot anyway.
Justin Seyster (2002)
JustinS at OptOnline dot Net
This document is valid HTML 4.01 strict.