Waveform Editor v0.1.2 Documentation

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.

Menu Options

File menu

New

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.

Open

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.

Save

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.

Play waveform

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.

Output to wav

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.

Save As

This option opens a new window that lets you pick a file name to save the current set of envelopes as.

Exit

This option exits the program without saving and without confirmation.

Options menu

Change sound sample settings

This option is currently not implemented and may be removed in future versions.

Change sample length
This option is currently not implemented and may be removed from the menu in future versions. This is more appropriately used from the Set Sample Length button on the main panel.

Half-cosine interpolation

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.

Preferences

This option is currently not implemented. In future versions this should launch a menu to change various options in the program.

Tools menu

Add copy of current waveform

This creates an identical copy of the current waveform and adds it to the set of envelopes. This is useful for adding harmonic frequencies.

Normalize nodes

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.

Help menu

Manual

This option currently doesn't do anything, but in the future it should launch a new window that contains this information.

About

This option currently doesn't do anything, but in the future it should launch a window about the developers.

Main panel options

Previous Waveform button

This button switches the current envelope to the next higher frequency. If there are no higher frequencies, this option does nothing.

Next Waveform button

This button switches the current envelope to the next lower frequency. If there are no lower frequencies, this option does nothing.

Include this waveform in output toggle

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.

Set sample length

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.

Set mixing coefficient

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.

Set Frequency button

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.

Play Waveform button

This combines all the envelopes and plays the generated sound to the soundcard.

Add new waveform button

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

Delete current waveform button

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.

Play only current

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.

Radio Buttons

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.

Tutorial

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.

  • Figure 1. A Typical ADSR envelope.
  • Known problems

    To do

    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