Page 2: Tutorial: creating a simple sound
What is sound?
In order to get even the slightest understanding of how MathSounds is used to create sound we need to go over a little bit of theory, so we will first answer the question: What is sound? Sound is actually quite simple to understand. Sound consists solely of vibrations in the air around you. It's molecules bumping into each other until they bump into your ears and your brain can then translate all that bumping into something you can understand: a sound.
So how is sound created when using electricity? In your loudspeaker you can find a membrane that can move backwards and forwards. If this membrane moves back and forth fast enough it will make the molecules near it start bumping into each other in such a way that your brain will interpret that as sound. And how does the membrane in the loudspeaker move back and forth then? Ofcourse by sending electric currents through it. If there is a lot of current running through the loudspeaker it's membrane will swing heavily to one side, and with no electricity going through it, it will swing all the way to the other side. So by changing the amount of current going through a loudspeaker we can make it produce the sounds we want to
There are two aspects of sound you should really understand if you want to work with MathSounds: frequency and amplitude.
The frequency of a sound is determined by how fast changes in the vibrations of the air around you follow each other. If the membrane in your loudspeaker moves back and forth quickly the air will also be pushed and pulled by it quickly. Your brain will then interpret this as a high pitched sound. If the vibrations go really slow your brain will tell you that this is a very low pitched base sound.
The amplitude of a sound tells your brain how loud it is. If a loudspeaker moves its membrane back and forth from one extreme to another, then the air will be moved heavily and you will experience this as a very loud sound. If the membrane in the loudspeaker moves back and forth just a little, then the air is moved just a little, and the sound will be soft.
If you understand this, then it becomes not so difficult to understand how a computer, or your cd player for that matter, produces sounds. All a computer understands are numbers, so in order for a computer to create sound it sends a sequence of numbers to what is called a Digital-to-Analog Converter (simply called DA-converter). Often such a converter works in such a way that when it gets a high number it will send a strong current through the loudspeaker, and when the computer sends it a low number it will send just a little bit of electricity.
This explains how numbers can be used to make a loudspeaker produce sound. Often the sound is stored as a sequence of numbers, on a cd for instance, that have been captured from real world sounds by using a microphone. Synthesizers often use stored sequences of numbers that have been crafted so that they sound pleasant to the human ear. MathSounds on the other hand uses mathematical equations to produce sequences of numbers in order to make the membrane in your loudspeaker move back and forth.
Your first sound
If you haven't already done so you should start up MathSounds now, so we can put something of what we have just learned into practice.
To the right in the MathSounds window you see this blue rounded rectangle. This is a wave generator, and it is the basic unit MathSounds uses to create sequences of numbers. To the right of it you can see a blue line that connects to the loudspeaker. Each setup in MathSounds requires that exactly one wave generator is connected to the loudspeaker. This generator usually is the last one in a line of interconnected generators.
![]()
Now you can click on this wave generator to open up a controller for this generator. MathSounds will then open another window that looks exactly like the one shown here. If ever you're looking for a controller you have already opened and not minimized, clicking on its generator will bring it to the foreground.
For now let's not look at the numbers at the bottom of the window just yet. First we focus on what is drawn in the middle of the window: the green curve and the two black lines. This part of the window is called the viewer. A viewer is an important part of MathSounds and it gives a graphical representation of the wave its generator is producing, hence of the sound it generates.
The two black lines are called the axes. The horizontal one is the X-axis, the vertical one is the Y-axis. You should think of the X-axis as a line along which time progresses, from left to right, starting at the point where it intersects with the Y-axis. The Y-axis on the other hand is a line along which the amount of current that goes through the loudspeaker is measured. So if you now look at the green curve, following it from its beginning to the left, you can see that this wave generator will at first cause the amount of electricity to increase, then it reaches a peak, after which it decreases, until it reaches its lowest point, and then it will increase again. Then the cycle repeats. If you've read the preceding paragraph, then you can now understand that this will result in the membrane in the loudspeaker to move back and forth at a very regular pace.
If ever, while reading through this tutorial, you find that a graph you see does not match the one shown here, you can press F5 to redraw the curve. That might occasionally solve the problem. If this doesn't work, then you have done something wrong and you should correct that before continuing.
If you now take a quick look at the bottom of the window you will see an input field called 'frequency', and that it is set to 440. Frequency is measured in Herz (abbreviated as Hz). Herz means how often per second the membrane moves back and forth: 1 Hz is once per second, 440 Hz is 440 times per second. So this generator is actually set to do this increasing and decreasing of the current 440 times per second. This corresponds to a pitch equal to the center A on a piano. You should try it. Hit the Play button in the main window and listen to how this very regular moving back and forth of the membrane in the loudspeaker sounds.
When you're done listening hit the Stop button and continue reading. Well that was not a very exciting sound, yet it is the basic sound MathSounds works with. We will create a more complex sound soon, using multiple generators, but first we need to take a quick look at some of the controls at the bottom of the controller window.
![]()
Let's first play a bit with the frequency. You could type in 880 in the input field (and hit Enter to confirm your setting). The viewer will then look like shown here: with four peaks in stead of two. As you can see you have effectively doubled the amount of cycles the generator has to go through each second. You should listen to this sound as well and hear that it is really a sound with a higher pitch.
You can play around a bit more with the frequency. In MathSounds the frequency can never be zero, but in order to create an audible sound you shouldn't go lower then somewhere between 20 and 30 Hz. This doesn't mean that lower frequencies are never used in MathSounds. You can very well use a frequency of, for instance, 0.05 Hz, but that only makes sense for generators that are used to modify the wave of another generator. And when it comes to the highest frequency that you can hear, that differs a lot between people, but it usually is somewhere between 10,000 and 20,000 Hz. Strangely enough, you might find higher frequencies that you can still hear, but that is because digitally created sounds have their own peculiarities, and in that case you're actually hearing a lower frequency than you have set the generator to create. But this is a rather difficult subject, well beyond the scope of this tutorial. However, if you want to test which frequency is the highest you can hear you can use this test setup, but you should then change the sample rate to 48,000 Hz.
![]()
Before moving on to the next paragraph, where your first sound will become more interesting, we're ofcourse going to take a look at the 'amplitude' input field. You have probably already noticed it, and after reading this page you undoubtedly understand what it is for. So let me point out the rules for the amplitude settings in MathSounds.
You can specify the amplitude as a number ranging from -100 to 100. When you set it to 100, that generator will produce the maximum output it can produce. If you set it to zero, then you will effectively shut it down, making it produce all zero's. If you specify a number lower than zero, it will invert the output of that generator. So when it comes to how loud a sound is, it doesn't matter whether you set it to 100 or -100, but at the -100 setting everything that used to be above the X-axis will now be below it, and everything that was below it will then be above it. Try this out. Set your generator to -100 and you will see the graph as shown here, all upside down, but if you listen to it, it sounds exactly the same. Does it ever make sense then to set the amplitude to a negative value? Yes, it does, mainly when the output of a generator is used as the input for another generator, which is actually the subject matter of the next paragraph, which you can find on the next page.
At this point some of you might wonder a bit what that means: a generator producing all zero's. If you have tested setting the amplitude to zero, you have noticed that this will result in a graph that is a straight line exactly on top of the X-axis. You might wonder that if this doesn't produce any sound, because it is logical to assume that all zero's means no electrical current, what a value below the X-axis then means: a negative current? This is a bit confusing. MathSounds produces negative numbers as well as positive numbers when calculating its sound streams, and you can see that from the curves in the viewer. All points above the X-axis are positive numbers, all below it negative, and all on the X-axis itself are zero's. But when translated to electrical currents, a zero is not no current. A zero means that the membrane in the loudspeaker is halfway. The membrane is in its one extreme position when the green line is at the top of the viewer display, and in its other extreme when the curve is at the bottom. So the most negative number means no electricity, the most positive number means the most electricity. So you might wonder: why is it then that all zero's, being the halfway position, produces no sound? The answer to that is actually quite simple: you don't hear a sound because there is electricity going through the loudspeaker, you hear a sound because this electricity changes all the time. You can sent a maximum current through a loudspeaker and hear nothing, but if the current is at a maximum one moment and at a minimum the next, then you hear a very loud sound. In order to hear sound the membrane has to move back and forth, not stay in one position. Only when it moves back and forth it will cause the molecules in the air to start bumping into each other.
Page 1: Introduction, news and installation
Page 3: Modulation: wave generators working together
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