Page 3: Modulation: wave generators working together
Creating a connection
![]()
In this part of the tutorial we will create a more complex sound by adding two more generators to our setup, so that these generators can create a more complex sequence of numbers. First of all you will need to add another generator. This is a very simple task. The work area of the main window of MathSounds is divided into cells, with each cell being identified with a letter followed by a number. If you look at the title bar of the controller you have been working with until now you can see that this generator is located in cell Z19. Now you should look at the cell that is to the bottom left of this generator. It is called Y20. This is the cell where we will add another generator. In order to do this you just click on it. After that the main window should look like shown here.
Let's take a closer look at a wave generator. You might have noticed that each generator has three little things attached to it. These are called connectors. The blue one is marked 'frequency', the red one is marked 'amplitude', and the green one 'output'. We've already been using the output connector, since the output connector in cell Z19 is connected to the speaker. This clarifies what the output connector is for: it is where the generator sends the signal it produces, and by connecting the output of a generator to the speaker we tell the program that this output is the one we want to hear. But each generator has an output connector, so their output should go somewhere too. The output of other generators than the one connected to the speaker always goes to the frequency or amplitude connector of another generator, or to both. The output of one generator can even go to as many wave generators as you like, but it can never go to their output connector, only to one or all of their input connectors.
Now we will make a connection between the output connector of the generator in cell Y20 and the amplitude connector of the one in cell Z19. To do this you click on the output connector. You'll notice that your mouse cursor changes into a crosshair cursor. This indicates that MathSounds now is in 'Creating a Connection Mode'. Many of the things you can usually do in MathSounds will now be disabled, that is, until you have finished creating a connection.
![]()
Creating a connection is easy. The light grey coloured lines tell you where your connection can be placed, and you place one by clicking on a point where two lines intersect, and that is connected by a visible straight horizontal or vertical line with the last point of your connection. The last point of your current connection is ofcourse the output connector you just clicked on. If you follow the grey line that starts at this connector you'll see that you have five points available to move this connection to. Click on one and see a green line appear.
Now we have to move this connection to one of the five points the amplitude connector of the generator in cell Z19 has available to it for establishing a connection. Just click on one and your connection will be moved to the one that can actually be used. Finally finish making the connection by clicking on the amplitude connector. You'll see the color of the line change to blue, and your cursor will return back to its normal shape, indicating that you have left the 'Creating a Connection Mode'. Your window should now look like shown here.
If you now listen to the sound by hitting the Play button you will notice that the sound has changed.
How does this work? This is done by a process called 'amplitude modulation', and it is explained in the next paragraph.
For completeness it is mentioned here that you can remove wave generators and connections by using the right mouse button. You shouldn't do that now, however, because we need all the things we have placed. But, in order to remove a generator right click on it. This will also remove all of its connections. If you right click on an input connector, the line attached to it will be deleted. Right clicking on an output connector will remove all the connections to that connector.
You can also start making a connection from the speaker, as well as deleting it from there. If you start creating a connection from the speaker or an input connector that already has a connection, then the existing one will first be deleted. Starting a new connection from an output connector will always add this connection to the already existing ones.
Amplitude modulation
![]()
Amplitude modulation is a way to use the output of one generator to modify the amplitude of another generator. It is typically done by connecting the output connector of the first generator to the amplitude connector of the other generator. Amplitude modulation works in such a way, that if the signal the first generator produces is at its maximum, the amplitude of the other generator will also be at its maximum, and ofcourse, if the signal the first generator produces is at its minimum, the amplitude of the other generator will be zero. However, in this definition, the maximum of the first generator should be considered as the absolute maximum value a wave generator can achieve, and also the minimum value is the absolute minimum value, regardless of its internal settings. In contrast, the maximum value of the other generator is its maximum value given its internal settings.
If you are new to this you will probably not understand this definition completely. Don't worry, you don't have to to continue with this tutorial and to use MathSounds to create great sounds. You will come to understand it over time. For now we will play around a bit with amplitude modulation in a simple way to make it clear how it works.
In order to continue you should now open up a controller for the newly created generator and change its settings for the frequency and the amplitude. Set the frequency to 1 and the amplitude to 100, and listen to the sound. We will go through this step by step to make you understand how this works.
![]()
First we're going to play around a bit with the viewer of the wave generator you've just changed its settings. After doing that it looked like shown above this. This doesn't seem to be very informative, so we're going to change that so that it shows something that is more meaningfull.
In the bottom left corner of each controller you'll find an input field marked 'time interval'. This is used to set how long a time period the viewer should show. By default, when opening a controller, it is set to such an interval that the viewer shows two cycles of its generator. This is why, when you opened up a controller each time, you saw a curve with two peaks. But when you change some setting for the wave generator, it is up to you to find a new time interval that produces a meaningful graph.
The time interval can be set in two ways. You can either just enter a number in seconds, in which case it will show you exactly that amount of time, or you can use 'Herz notation'. What does this mean? It seems a bit strange, since we know that Herz means how many cycles per second the generator has to go through, and that doesn't seem to be a time period. But in a way it does, and using Herz notation is actually a very convenient way of specifying meaningful time intervals in MathSounds. In order to enter a time interval in Herz notation you type a number followed by the abbreviation Hz, so for instance 220Hz. This means that the viewer should show you exactly the time period equal to one cycle of a generator that is set to a frequency of 220Hz. So, by default, a new wave generator is set to produce a wave of 440 Hz, and its viewer is set to show an interval of 220Hz, which will cause the viewer to show two cycles, because a wave at 220 Hz is half as fast as one at 440 Hz, so one cycle takes double the time to complete.
![]()
So now it becomes easy to find a time interval for our viewer that is meaningful. The frequency of this wave is 1 Hz, which means one cycle per second, so there are two ways to set the viewer so that it again shows two cycles of its generator. Either you specify 2, meaning two seconds, which will include two cycles of 1 Hz, or you specify 0.5Hz, which will show you the time interval a wave at 0.5 Hz takes to complete, which is ofcourse equal to two seconds. The resulting graph after this change is shown above this, and looks very familiar.
Now open up the other controller. Its viewer shows a somewhat familiar graph, but its amplitude seems to be reduced. The curve used to go up all the way to the top, and down all the way to the bottom. Now it just has a very small amplitude. This is because you only see a snapshot of the first few miliseconds of its cycle. Remember that we use a wave at 1 Hz to modify the amplitude of this wave. Such a wave takes one second to complete, and this viewer is set to a much smaller time interval of 220 Hz. So in order to see the effect the amplitude modulation has you should set this viewer to the same time interval as the other one, that being 2 seconds or 0.5Hz. Try it and you will see the graph as shown here. Now you can see why this sound sounds like it does, it's amplitude is changed all the time, making the sound go louder and go back to zero once per second, repeating this every second.
We will soon go into all the intricacies of frequency modulation, but first we make a little detour and deal with a special mode a wave generator can be switched to, the inverted mode, and we will discuss the interval of a wave. All of this starts on the next page.
Page 1: Introduction, news and installation
Page 2: Tutorial: creating a simple sound
Page 4: Inverted mode and the interval of a wave
Page 5: Frequency modulation, waves and inverted mode
Page 8: Manual: the main window
Page 13: Release notes, known bugs and issues
If you can't find a button to download MathSounds try
Please send your questions, comments or remarks to info@mathsounds.com