Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Tuesday, June 14, 2011

Granular Synthesis Followup

I responded to the previous post with a more complex tutorial about granular synthesis, if any of you are interested:


Alright, Granular synthesis is much more modern (and complex!) than the other two synthesis types I mentioned...
Addative synthesis has been used in pipe organs for centuries, and Subtractive synthesis was what the first synthesizers (moogs in particular!) utilized (and it is also how we produce many sounds... Our lips act as primitive "filters" on the sound produced by our "oscillator", our vibrating vocal chords! Neat, huh?) :D
Granular Synthesis, however has only been around for 60 years, max. From what I understand, it was invented by a very talented composer named Iannis Xenakis.
He had this crazy idea that he could cut sounds into tiny little pieces called "grains", and then do things with them, to manipulate sound in ways that never had been before. Since this was early on, he had to record something (a violin, for example) with a tape recorder, cut the tape into teeny tiny little pieces, and reassemble them to form all new sounds. This, obviously, took a very very long time, and the results were not perfect, but very innovative.Here is a very early piece using granular synthesis, called Analogique A + B.
Anyways, back into the idea of what Granular synthesis is. Now-a-days, we have computers, much faster and larger than any back when granular synthesis was being developed, so we dont need to fumble around with tape recorders any longer, and we can even use this synthesis in real time, if we wish to do so. Unlike addative or subtractive synthesis, which are very consistent in concept, granular synthesis can be used in an almost infinite variety of ways, the main constant being that the sound is being methodically chopped into pieces called "grains". Past this, these grains can be manipulated, combined, edited, sliced into more grains, looped, effected, shifted in speed or pitch, or any combination of these or other methods... You can see why this is such an interesting field!
Because granular synthesis is so computation-heavy, most hardware synthesizers, even today, do not have it as a function (though some rather expensive ones do). However, granular synthesis can be easily done on a computer via software programs like Audiomulch, Kluppe, Reason, and so forth.
Ok, so that is neat and all, but what are some of the applications of granular synthesis? Well, before granulation existed, the only way to speed up a song would be to increase its "frequency", how fast the speaker plays the song through... The problem with this method is, it makes everything sound high pitched, like Alvin and The Chipmunks! The same goes for slowing down a sound, it could not be done without dropping the pitch to the point of sounding ridiculous. This would certainly not do for most serious modern day music producers, but luckily, granulation allows a simple method to speed up (or slow down) a song WITHOUT changing its pitch! How?
Well, lets say we wanted to make a 2 minute long song take up the space of one minute. The old way to do this would be to simply squish together the entire 2 minutes into the space of one minute, doubling the frequency of all the sounds in the song, and thus, doubling its pitch. However, what if we cut the 2 minute song into millions and millions of equal pieces, cut each of THOSE pieces in half. Half of the data of the song has been lost, resulting in a one minute long song becoming two minutes, but luckily, the pitch has stayed the same! Slowing down a song is the same method, in reverse: cut the song into millions of equally sized pieces, and then space them apart evenly over the time fame you want the song to fill. This allows the frequencies to stay intact throughout the stretch.
If you have ever used the "change tempo" function in the popular music editing program, Audacity, you are performing the exact type of granular synthesis that I just described!
The "change pitch" function works using granular synthesis as well, to change the pitch of a song/sound without changing its length... The millions of pieces the song are cut into are then sped up, the old fashion way, to create a higher pitch without effecting the song's length itself!
There are many other applications for Granulation as well, from small fixes on a damaged sound file, to creating beautiful sound textures and pad sounds out of completely different files, to just fucking with a song for the fun of it! There are nearly infinite applications of granular synthesis, many of which don't quite cover the scope of this tutorial, but if you want to learn more, I suggest checking out http://www.granularsynthesis.com/guide.php, which allows an in depth explanation of many concepts of granular synthesis, as well as links to software, publications, etc.
Let me know if I you have any questions, as it can be an very odd topic at times, but I hope I sufficiently explained the basic idea of it, and maybe stayed interesting throughout :)
Thanks again for reading! :D

Synthesis Tutorial!

I was on reddit, when I came across a post asking to explain the basics of digital audio synthesis... So I went a bit overboard and made a pretty nice introduction-to-synths post, and I thought I might want to post it here, in case it might be of use to any of my readers.


Note that it is only slightly edited, so if anything seems odd, keep in mind it was meant to be a response to a reddit users query.


Ok, now, Enjoy :)



Hiya, I am a synthesizer enthusiast and noise musician, and I would be happy to write you a basic tutorial on how audio synthesis works, since most of the answers here will probably be more about the musical aspect of things, and less technical then it should be. Synthesizers can be complicated, but they are really really fun, and I hope this tutorial can help you understand how a synth works! :D
Ok, so, you can think of a synthesizer as an instrument that you build while you play it (yes, seriously!). So, synthesizers can have many, many sounds, and unless I know exactly what you are looking for, I can't tell you exactly what to do, but I will tell you this:
EXPERIMENT, TRY DIFFERENT THINGS, AND DON'T BE AFRAID TO MESS UP!!!
Not only is it insanely fun, but it helps you become better at understanding how to mold sound into what you want it to be, even if you dont understand technically what you are doing. Many synth players don't even know music theory, they simply understand their synth like the back of their hand, and then do what sounds good.
Alright, that aside, I will give you a basic tour of a standard synthesizer... It may get a little wordy, but this understanding is important!
ANATOMY OF A SYNTHESIZER
The standard hardware (analog) synthesizer has a collection of "modules", interconnected, to synthesize. In it's most bare basic form, it would be:
Oscillator(s) > Filter(s) > Effects
This is nearly the most basic synth that you will find, though it still has almost infinite possibilities! Let me explain these components:
OSCILLATORS
If you have ever seen people talking about recordings, or music, or what have you, you have probably seen this as a representation of a wave:

This is basically instructions for the speaker, in graph form, on how to make a sound called a "Sine Wave", the simplest of all sounds, a pure tone. The X axis in this graph is time, and the Y axis is the position for the speaker's membrane to be in at that specific time. If this confuses you, don't worry, just keep moving on, you will get it in time!
Highly technical aspects aside, the "Oscillator" is the sound-making unit of the synthesizer. Without the Oscillator, there would be NO SOUND. No other part of the synth actually creates sounds, it merely processes and changes the existing sound, created by the Oscillator. So, as you can see, the Oscillator is EXTREMELY important! The Oscillator can create many different sounds, but they generally sound very constant and toned, like the sounds made by old video game consoles. Here are some pictures of waveforms, the shapes these waves make, and explanations of what they sound like:

These are the most common periodic (toned) waveforms that you will find on your average synthesizer, though there are many many more out there. As you can see, they are often named after their wave's shape, but let me give you a few side notes on the properties of these waves:
  • Sine waves, as I said earlier, are the purest a tone can possibly be. It has no "harmonics", or extra tones, which makes it sound very simple and smooth. It is used very much in additive synthesis, which will be explained later.
  • Square waves are very harsh, and contain many harmonics, making it a good canidate for subtractive synthesis, which will also be explained in a bit. Pure square waves are a bit loud sounding, but have been used very often in classic videogames, such as the NES, which had a build in dedicated Square Wave synthesizer, which was used for well known game themes like the theme song to Super Mario Bros!
  • Triangle waves are the least used of these 4, but they still certainly have their place! Several game consoles have used this as a substitution for a pure sine wave, because it is simpler to create, while still having a similar tone.
  • Sawtooth waves, like Square waves, also have lots of harmonics, perfect for subtractive synthesis and filters. Sawtooth waves have a sort of "buzzing" sound
There is one more thing that basic oscillators can produce that I would like would like to go over, and that is, "Noise". "White Noise" is the most common, though there are almost infinite varieties out there. Unlike all the previous waveforms, white noise has no constant shape, and thus, no constant tone, either. You most likely already know what white noise sounds like, too! If you have not heard of it by name, try changing your television to a channel with no input, and you will see black and white dots and hear a sound like "SHHHHHH". That is noise! Noise is really good for filtering, and filtered noise waves can make really good percussion sounds, like snare drums or high hats.
METHODS OF SYNTHESIS AND FILTERING
Alright, now we have our electric piano keyboard plugged into our oscillator, and we are making tones and noise with these basic waveforms, on their own or in combination with each other, but it sounds a bit boring! What can we do to change these sounds to make them more interesting? Lets try using some classic synthesis methods!
There are several methods of synthesis in popular use, and unless you are using some very odd and obscure experimental synth, it will probably use one of the following, or a combination of these methods:
  • Addative Synthesis
  • Subtractive Synthesis
  • Granular Synthesis
Granular Synthesis might be a bit too complicated for this explanation, but if I get a positive enough response, or you want me to explain it, I would be happy to put out the basics to you :)
So, what happens when we add two different waves or sounds together? We get additive synthesis!
Additive synthesis is done by adding very basic waves and sounds together to create more complex ones. This can be done with the oscillator, combining several, or many different waveforms, and playing them all at once, at different pitches and levels, or somewhere else on the synth, combining together hundreds of Sine waves to create entirely new shapes!
Here is a good visual representation of how additive synthesis works:

As you can see, three different sine waves, playing at different speeds, or pitches, are put together to create a whole new shape! Neat, huh? :)
What about subtractive synthesis? Well, I said something earlier about these things called "Harmonics". Harmonics are, basically, extra tones that add to the complexity of the sound of the waveform. Square Waves and Sawtooth Waves have lots of harmonics, Triangle waves have a few, and Sine waves have none at all! So, subtractive synthesis is using things called "filters" to manipulate the harmonics of a sound to create new tones.
We generally have several types of filters, and each of these have several parameters, or settings, that you can change. Don't get overwhelmed at how many there are, just absorb what you can, and play around with your own synth until you begin to understand them.
  • Low-Pass Filter (LPF)
LPF's are filters that let only the harmonics lower than a certain point (the "cutoff" point) play, and reduces or eliminates all the harmonics higher than that point. LPF's can be used to make something sound "softer" or more "bass-y", and they are often used by dubstep producers to create a "wub-wub" sound, by moving the "cutoff" point back and forth very quickly (a process known as "modulation")
  • High-Pass Filter (HPF)
HPF's are the exact opposite of LPF's, they work by keeping all the harmonics ABOVE a certain point, and quieting or eliminating the rest. They also have a cutoff point, just like low-pass filters, which is the point at which this cutting occurs. High pass filters can make things sound more tin-y, or they can be used to remove the bass frequencies from a sound
  • Band-Pass Filter (BPF)
BPF's are like a combination of the two previous filters. They work by only letting a "band", a specific range of harmonics, through, and cutting off all the ones lower or higher than the this range. They have a wide variety of uses, experiment with it to see what you can use it for :)
  • Equalizers
While not exactly a filter, per-say, Equalizers gives a synthesizer finer control over which harmonics you wish to emphasize, and which you want to quiet. Generally it gives you a variety of ranges, like "bass", "mid", and "high", and allows you to control each of them individually, enhancing or removing frequencies as you see fit.
These filters can be used to simply change the shape your oscillators can produce, or they can be "modulated", or have their parameters and settings (like "cutoff") changed over time, to create a more dynamic sound. This modulation can be done with an "envelope", a graph with an x axis of time and a y axis of value. Here is a visual example of a common envelope split into four sections, "attack", "decay", "sustain", and "release", also known as ADSR:


Envelopes can modulate other things, like how loud an oscillator is, or what it's pitch is, to create all sorts of neat possibilities. Fast envelopes can create percussive noises and hits, and long envelopes can create slowly morphing sonic textures, often known as "pads".
Parameters can also be modulated, believe it or not, with another oscillator! Dubstep producers, as I said earlier, create a "wub-wub" sound by modulating a low-pass filter's cutoff. This modulation is done via a very slow sine wave, moving the cutoff back and forth at a constant speed, in the same motion that the sine wave makes, up and down. This is usually called an "LFO", Low Frequency Oscillator.
Sorry if this is getting a bit complicated, like I said, just take in what you can, and experiment later on to see how different changes can effect the sound produced.
EFFECTS
There are thousands of different effects out there, and they can be very overwhelming, but just relax and try to wrap your head around a few of the most common (and most useful!) ones you will see, and their parameters (yep, effects have parameters too!):
  • Delay/Echo
Delays take a sound created by your synth, play it, and then play it again at a later time, slightly quieter, and then repeat. This creates an echo effect. Some basic delay parameters would be "delay time" (how long it takes for the sound to be repeated) and "feedback" (how many times the sound is repeated, and how much quieter it gets on each repeat).
  • Reverb
Reverbs create a spacious feeling, like making a noise or speaking in a large room or hallway. It gives the sound a more "live" atmosphere, and long reverbs can make a sound take much longer to fade than it would without the reverb. The most common reverb paramter would be "reverb time" (how long the sound is reverberating for)
  • Flanger/Phaser/Chorus
These all work a bit similarly, but sound different. Without going into the highly technical features of these effects, they work by playing several copies of the same sound, all next to each other, at different speeds, to create different auditory effects. Flangers create an up-and-down wah type effect, phasers create a phasing sound often heard in alternative rock, and choruses make things sound more "wide", like a choir all singing the same note at different octaves. These effects generally have paramaters like "Delay time" and "Flange/Phase/Chorus Speed".
  • Distortion
Many different types of distortion exist, but generally it makes the input sound harsher, noisier, and more intense. This effect is commonly used on guitars in rock music. Paramaters are generally simple, like "Distortion amount" and "Tone" (a built in equalizer that equalizes at the same time the distortion is performed).
  • Equalizer
Remember this? Yep, some synthesizers consider this an effect, and not a filter. Weird, huh? It works well as both, though :)
END
Alright, at this point, your sound is sent from the effect to the speaker, and you have officially synthesized something! Yay!
I understand that audio synthesis can be tough to wrap your brain around, but if you managed to get your way through to the end of this tutorial, you already understand more about technical side of synthesis than many club DJs do! Cool!
Let me know if you have any questions at all about audio synthesis, and I would be happy to explain further, sorry if my explanations aren't perfect, I am not a teacher :s
Now, on the subject of buying synths, which I am sure many others have already covered... You have several options available, depending on your budget. There are hardware synths, which are special computers specially dedicated to synthesizing, which can range from 50 dollars for an old used casiotone, to hundreds of thousands for high quality moogs. You will have to look around, but I can vouch for the quality of Korg and Casiotone synths, if you'd like my opinion :p
Your other option would be software synthesis, which is using an existing computer (maybe the one you are on right now!) to synthesize things. There are many free software synths, one that I like would be ZynAddSubFX, which almost perfectly fits the scope of this tutorial, and has a build in virtual keyboard so you can use your normal computer keyboard like piano keys! You will have to explore to find other options, there are tons out there, have fun and look around!
Again, sorry if this didn't cover anything well enough, I hope it managed to help, though! :D
edit: added "distortion" to the effects list!

Monday, February 14, 2011

Human Computation: Compression

Since I have been so interested in Compression lately, I decided to do something a little different for this post, just for the heck of it (no, sorry, this isn't really glitch/noise related, don't worry, I have stuff coming up!)... I am going to try to compress an English sentence down to the SMALLEST possible size I can get it, while retaining the original idea. I wonder how small it can get before it is impossible to understand? Smaller is better, right?

For the text involved, I chose the somewhat-wordy sentence that is quite well known here in the USA, the opening line to the Gettysburg Address:

"Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal"


This sentence happens to measure exactly 146 characters long (not including spaces). Let us see how much we can reduce this file size with simple steps.


First, we can see several numbers present in the opening of the sentence. Let us run a simple process, replacing all worded digits with their numeral symbol equivalent:


"4 score and 7 years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal"


139 Characters. Could be better, but it's a start. Lets continue by striping down all words to their shortest possible synonym.


"4 score and 7 years ago our dads made on this land, a new state, made free, and loyal to the idea that all men are made same"


The idea is still clearly understandable, and the length has been reduced from 139 Characters to 97. Now, we correct the (quite outdated) unit of time in the beginning of the sentence, by finding an equal value in ordinary years.


"87 years ago our dads made on this land, a new state, made free, and loyal to the idea that all men are made same"


89 Characters.


Next, I correct the unnecessary complications in syntax.


"87 years ago our dads made here, a new state, made free, and loyal to the idea that all are made same"

Is it just me, or did I hear the sound of feminists cheering?

Anyways, that edit brought our number down 9 characters, bringing our grand total to 80, overall.

Now it is starting to get tricky! Lets try adding some abbreviations, texting style:

"87 yrs ago r dads made here, a nw state, made free, n loyal t th idea tht ll r made same"

67 Characters!

Starting to look like it was written by a 13 year old girl, but still understandable. Now, lets remove direct and indirect objects. Any linguist will know that this WILL remove some clarity, but hopefully not enough to obscure the original intended idea.

"87 yrs ago r dads made here, nw state, made free, n loyal t idea tht ll r made same"

64 Characters now. Getting a bit harder to understand now, but most twitter users should be able to understand it without trouble.

Now, lets try replacing a few of the extra with, admittedly less common abbreviations (that "made" was killing us!):

"87 yrs ago r dds md here, nw state, md fre, n lyl t idea tht ll r md sm"

52 Characters

I suppose it wouldn't hurt to cut out the bit in the middle, since it doesn't necessarily contribute to the overall idea...

"87 yrs ago r dds md here a fre state lyl t idea tht ll r md sm"

45 Characters

Well... Does the amount of years really matter?

"R dds md here a fre state lyl t idea tht ll r md sm"

37 Characters!

A bit of rephrasing...

"R dds md us fre state where ll r md sm"

28 Characters

Does it matter who made it? I guess not...

"A fre state where ll r md sm"

21 Characters

Since all are the same, I guess the free is a little redundant, right? And the made doesn't really need to be in there either.

"A state where ll r sm"

16 Characters

State doesn't really add much to the meaning here....

"place where ll r sm"

15 Characters

I guess just a description might suffice?

"whr ll r sm"

8 Characters

A statement?

"equality"

8 Characters Again

uhh, could we maybe make that an adjective?

"equal"

5 Characters!

abbreviate!

"eql"

3 Characters.

...

"eql"... The opening sentence to one of the most famous speeches of all time, brought down to three simple letters... I wonder if people will recognize it?

(and this concludes todays special on why over-compression is usually bad)