The waveform editor is a program that always you to create amplitude-time envelopes for any number of frequencies and play the combined tone to the soundcard. This Program is still in early development, and a number of the features from the menus aren't available, however all the basic features seem to work perfectly well.
An amplitude-time envelope is a graph that shows the volume of a sound on on the vertical axis and time on the horizontal axis. Synthesizer users maybe be familiar with these as ADSR envelopes. Each sound created by the waveform envelope is one or more of these envelopes mixed together. You pick the volume for the frequency you are working on by clicking on the graph.
The new menu option closes any existing set of envelopes and creates a new basic envelope at 1000 Hz. This is mostly useful for starting over from scratch.
This option opens a new window that lets you browse for a saved set of envelopes. Any envelope that is currently open will be closed before the new one is opened.
This is a feature to save the set of envelopes you're currently working on. If you've already saved this set, or have opened it from a previously saved file, this will save them under the same filename. If this is something you've started from scratch, this will launch a the Save As menu.
This option generates a sound by mixing all the envelopes together and playing it to the soundcard. This is the same as pressing the Play Waveform button on the lower panel. For simple tones of a few envelopes, the tone will play almost instantly, however for long, complicated sets this can take some time.
This is the preliminary version of this feature. This works exactly like the Play Waveform option, but instead of playing the generated sound to the soundcard, it launchs a popup window to select the name of the file to save the sound in as a Microsoft Wave file. If there is already a file called out.wav in the current directory, it is replaced. In the future, this function should ask the user for the name of the file.
This option opens a new window that lets you pick a file name to save the current set of envelopes as.
This option exits the program without saving and without confirmation.
This option is currently not implemented and may be removed in future versions.
This changes the method of interpolation when building a sound. Instead of using straight lines between nodes, the program uses the half-cosine method to smooth out the peaks. This creates a subtle difference in the final sound.
This option is currently not implemented. In future versions this should launch a menu to change various options in the program.
This creates an identical copy of the current waveform and adds it to the set of envelopes. This is useful for adding harmonic frequencies.
This option goes through each envelope and adjusts each node so that the peak amplitude is 80% of the maximum volume. All the other nodes are relatively lower. This is useful if you've designed a set of envelopes that are too quiet and need to be amplified.
This option currently doesn't do anything, but in the future it should launch a new window that contains this information.
This option currently doesn't do anything, but in the future it should launch a window about the developers.
This button switches the current envelope to the next higher frequency. If there are no higher frequencies, this option does nothing.
This button switches the current envelope to the next lower frequency. If there are no lower frequencies, this option does nothing.
If this toggle is checked the current waveform will be mixed into the final sound when it is played or saved to a wav. If it is not checked the current waveform is ignored.
This button takes the number typed into the Set sample length text box and sets the number of samples for this frequency to be it. There are two things to understand here: Each frequency has it's own length. If one has a lower length then the longest, when the sound is played this envelope will only have an effect on the part of the sound up to it's length. It's recommended to have the same length for all the envelopes. If you want a particular frequency to stop before the others, just have it's envelope designed to be at zero before the end of the window. Secondly, if envelopes have different lengths, each envelope will be graphed as to fill the entire window. In other words, on the graph, each envelope will be drawn so that it takes up the entire window.
This is a bit of a hack. If you want a particular envelope to be louder or quieter relative to the other envelopes when the sound is played, change the mixing coefficient. 0.5 will make that sound half as loud, 2 will make it twice as loud.
This button changes the frequency for the current envelope to the number currently in the text box to it's left. Generally, your soundcard probably can't get much below 50 Hz (even so, your ears can't hear anything below 50 Hz). At a sample rate of 44100 samples per second (this is the standard for CD quality music, and most modern soundcards), the highest perceivable frequency is 22050 Hz. There is a bug in the program that makes it impossible to create frequencies higher than 14000 Hz. This is mostly academic, because most people find frequencies that high irritating. For most tones, the frequencies between 100 Hz and 1000 Hz are the most important, frequencies between 1000 Hz and 6000 Hz add "richness" to the sound, but are typically not as loud as the lower frequencies and not as common. Frequencies between 6000 Hz and 12000 Hz are present and relevant, but not overly so.
This combines all the envelopes and plays the generated sound to the soundcard.
This button creates a new waveform. The default frequency is 1000 Hz and the default length is 44100 samples (1 second of sound). Initially there are no nodes on the waveform
This button deletes the current envelope and changes the current envelope to the previous waveform. If there is only one envelope, this button does nothing.
This button generates a sound based on only the current waveform and plays it to the soundcard. This is useful for working on a sound by listening to each frequency individually and adjusting the envelopes one by one.
The radio buttons Add Node, Delete Node and Drag node change the program does when you click on the graph. When the Add Node is selected, clicking on the graph will create a new node at that point. When Delete Node is selected, clicking near a node will delete it. The program is designed to delete the nearest node to where you clicked, even if there isn't a node anywhere near where you clicked. Drag Node is not currently implemented, but in the future it will let you drag a node by clicking on it and moving the mouse.
This is a brief introduction on how to use the program to make an interesting sound. You can create all sorts of sounds with this program, this is just an example of how to create a sound similar to what a digital synthesizer can create.
For sounds similar to traditional instruments, all your envelopes should have a similar shape that follows a basic template for all instruments. There are 4 components to a typical envelope: attack, decay, sustain, release. In the attack the amplitude jumps up to the peak level of the entire sound. Generally the amplitude reaches the peak in the first 25% of the sound. After that, the sound drops down to a level of roughly two thirds of it's peak volume. The slope of this line is usually the same as that of the attack, this is called the decay. Once the sound has decayed to a certain level, the volume is maintained for most of the rest of the sound, this is called the sustain. The amplitude should slowly decrease from the level it decayed to for most of the remaining part of the sound. The final portion is the release, this is more or less straight forward. Once the sustain is over, the amplitude quickly drops down to zero and the sound is over. These are generalities, different instruments have widely varying envelope shapes, although they typically follow some sort of ADSR pattern.
Once you've decided the general shape for your envelope you have to pick the fundamental frequency. The fundamental frequency is the lowest and loudest frequency of the set of envelopes. This is the frequency that musical notes refer to. (ie, the note A refers to a specific fundamental frequency). For our purposes we will use an fundamental frequency of 300 Hz.
Now we have to add the harmonic frequencies. These frequencies are integer multiples of the fundamental frequency. For a fundamental frequency of 300 Hz, the first five harmonic frequencies would be 600 Hz, 900 Hz, 1200 Hz, 1500 Hz, 2700 Hz. You can have as many harmonics as you want, up to the maximum frequency this program can generate, 14000 Hz. Typically you will only have 5 harmonic frequencies or at most 10. There are two major variants to this. Some instruments only produce odd harmonics, this means that the harmonics for an instrument like that would be 900 Hz, 1500 Hz, 2100 Hz and 2700 Hz. We will be using the former case for this example. Each harmonic should have a lower amplitude than the previous and have a shape similar to the fundamental frequency's envelope.The easy way to do this is to select the Add copy of Current Waveform option from the tools menu. This creates an envelope identical to fundamental frequency. Use th Next button to select the copy and change the frequency to the second harmonic frequency. Do this for each harmonic you are adding. Now go back and lower the mixing coefficient for each harmonic frequency. I recommend decreasing the mixing coefficient by a factor of two for each harmonic (ie, the fundamental frequency should have a mixing coefficient of 1.0, the 1st harmonic should have a mixing coefficient of 0.5, the 2nd should have a mixing coefficient of 0.25 and so on). Once you have added these harmonics, press the Play Waveform button to hear your new sound. You can go through and hear each envelope individually with the Play only current button. You can hear what the sound would be without any group of envelopes by unchecking the include waveform in output toggle and the press the Play Waveform button. It's worthwhile to experiment with a bunch of different envelope shapes using standard fundamental frequencies and harmonics before moving on to more complicated sounds.
The graph doesn't have enough grid lines, so you have to judge by your eye where points should go. This is mostly just a matter of having the program adding more lines to the graph before drawing on the lines and nodes.
The default sample length for new envelopes is always 44100 no matter what the other envelopes have for the length.
A number of menu options aren't implemented.
There is no simple way to have a vibrato effect (the frequencies oscillate between higher and lower frequencies). This is necessary to create sounds similar to stringed instruments.
The Drag Node function isn't implemented yet. It's kinda complicated to do, and you can get the same effect by deleting a node and adding it back in the place you want it, so I won't be fixing it soon.
Add more methods of interpolation.
Add a popup dialog to jump to a specific waveform rather than having to use the next and previous buttons.
Add some sort of 3D graphic display.
There's plenty of stuff that's not done properly. This is my first GTK program and I'm not an audio engineer. In fact, I've never formally taken Fourier analysis, acoustical physics and a whole bunch of other stuff that would be really useful for me to know. Therefore, there's a lot of stuff that doesn't work right. If you are knowledgeable in these areas and believe you can help, or have suggestions of features you'd like to see added, please contact me. I'd also like to put together a library of interesting sounds that have been produced by this program, so if you've come up with something interesting please email about that as well.
By Christopher Rowley