Skip to content

Commit

Permalink
Merge pull request #15 from wadeevans/wevproofread
Browse files Browse the repository at this point in the history
some more corrections to main.adoc 3.1.1
  • Loading branch information
hlolli committed Mar 21, 2019
2 parents c2b1d0e + 005222d commit 15d705e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/sources/main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ To most clearly hear what's going on here, let's try to play this line as an upw
(demo (sin-osc :freq (+ 200 (* 200 (env-gen env :action FREE))))))
```

This clearly didn't sound like glissando, so what's going on here? We did indeed specify a line from 0 to 1 and multiplied the line by 200 to glide 200Hz ending at 400Hz. By useing `:step` the envelope makes no attempt bridge the gap between the points we provided it. So as soon as the instrument started we heard 300Hz and halfway through it changed to 400Hz. So what happened to our first point of 200Hz? In those cases where the envelope loops, there's a chance of distorted hum if the envelope doesn't begin where it ends, so point 0 on x-axis works as a pivot point and will never be played.
This clearly didn't sound like glissando, so what's going on here? We did indeed specify a line from 0 to 1 and multiplied the line by 200 to glide 200Hz ending at 400Hz. Using `:step` the envelope makes no attempt bridge the gap between the points we provided it. So as soon as the instrument started we heard 300Hz and halfway through it changed to 400Hz. So what happened to our first point of 200Hz? In those cases where the envelope loops, there's a chance of distorted hum if the envelope doesn't begin where it ends, so point 0 on x-axis works as a pivot point and will never be played.

Let's try again, but this time let's try to bridge the gap by applying a linear function to the points using `:lin`.

Expand All @@ -336,7 +336,7 @@ Let's try again, but this time let's try to bridge the gap by applying a linear
(demo (sin-osc :freq (+ 200 (* 200 (env-gen env :action FREE))))))
```

This sounded much smoother, no jumps but a constantly gliding note for the duration of the two seconds. But to human ears, this linear glide doesn't sound very linear even though the computer did perfectly good job of executing it linearly. To produce a glissando that a human would sing or perform on a violin, we need to apply a non-linear function to the provided points. Keep in mind our auditory senses are non-linear both for the perception of amplitude and frequency. Where we usually control and measure amplitude on logarithmic scale in decibels, and frequency with note names, midi note number or pitch class sets, all of which are in in squared relationship to the Hz they represent. So for our last attempt glissando, we'll apply a squared function to points from 0 to 1 in 2 second interval.
This sounded much smoother, no jumps but a constantly gliding note for the duration of the two seconds. But to human ears, this linear glide doesn't sound very linear even though the computer did a perfectly good job of executing it linearly. To produce a glissando that a human would sing or perform on a violin, we need to apply a non-linear function to the provided points. Keep in mind our auditory senses are non-linear both for the perception of amplitude and frequency. Where we usually control and measure amplitude on logarithmic scale in decibels, and frequency with note names, midi note number or pitch class sets, all of which are in in squared relationship to the Hz they represent. So for our last attempt at glissando, we'll apply a squared function to points from 0 to 1 in 2 second interval.

```Clojure
(let [env (envelope [0 1] [2] :sqr)]
Expand Down Expand Up @@ -422,20 +422,20 @@ By providing negative `:iphase` value we can reverse the signal and get a linear
```

=== Extra
Here are some tutorial videos about envelopes, not related specifically to Overtone, but can give ideas.
Here are some tutorial videos about envelopes, not related specifically to Overtone, but they can give ideas.

- https://www.youtube.com/watch?v=A6pp6OMU5r8[ADSR envelope synth tutorial part A]
- https://www.youtube.com/watch?v=9niampRkFW0[ADSR envelope synth tutorial part B]
- https://www.youtube.com/watch?v=QXS1v2CQLOY[Modular Synth Basics #09: Linear & Exponential?]


== Oscillators
This section will cover oscillators in Overtone and more specifically wavetable oscillators; How we can create wavetable oscillators, how we can mix them and how we can use envelope to give a dull sound more liveness. First we will look at wavetables in depth educational purposes and then ever more practical application of wavetable synthesis in Overtone.
This section will cover oscillators in Overtone and more specifically wavetable oscillators; How we can create wavetable oscillators, how we can mix them and how we can use envelopes to give a dull sound more liveness. First we will look at wavetables in depth for educational purposes and then at ever more practical applications of wavetable synthesis in Overtone.

=== Wavetable
Wavetable synthesis with computers, explained at its essence, is the way of creating signal by reading phase values from a table and sending those values in sample-rate to a given audio source (also refered to as https://en.wikipedia.org/wiki/Pulse-code_modulation[Liner Pulse-Code Modulation]). In Overtone the phase values are stored between -1 and 1. As opposed to a 16-bit .wav file which stores its values as integers from 0 to 65,535 or −32,768 to 32,767 depending if it's unsigned or signed integers respectively. Same goes for the audio hardware in your computer, if it's set to 16-bits resolution, then supercollider will remap the floats between -1 and 1 to an integer range that the audio hardware expects to receive. When refering to phase in this context, can be misleading to newcomers. For oversimplification you can think of phase stored from samples and audio files purely as amplitude, since a signal going from -1 to 1 is playing audio on full amplitude strength. Whereas you may play your Overtone instruments with amplitudes that are in the range of 0 and 1 (there's no such thing as negative amplitude), supercollider enginge will create a signal that has phase values from -1 to 1 and the audio module will take the signal from Supercollider and remap it to −32,768 to 32,767 (for 16-bit).
Wavetable synthesis with computers, explained at its essence, is the way of creating a signal by reading phase values from a table and sending those values in sample-rate to a given audio source (also refered to as https://en.wikipedia.org/wiki/Pulse-code_modulation[Liner Pulse-Code Modulation]). In Overtone the phase values are stored between -1 and 1. As opposed to a 16-bit .wav file which stores its values as integers from 0 to 65,535 or −32,768 to 32,767 depending if it's unsigned or signed integers respectively. Same goes for the audio hardware in your computer, if it's set to 16-bits resolution, then supercollider will remap the floats between -1 and 1 to an integer range that the audio hardware expects to receive. When refering to phase in this context, can be misleading to newcomers. For oversimplification you can think of phase stored from samples and audio files purely as amplitude, since a signal going from -1 to 1 is playing audio on full amplitude strength. Whereas you may play your Overtone instruments with amplitudes that are in the range of 0 and 1 (there's no such thing as negative amplitude), the supercollider engine will create a signal that has phase values from -1 to 1 and the audio module will take the signal from Supercollider and remap it to −32,768 to 32,767 (for 16-bit).

TIP: As a possible source of terminology misunderstanding. The concept of "table" here refers to an indexed iterateable list of values. Clojure has no concept of "table", so when discussing tables in Clojure land, we would be a refering to a vector (or other sequenable list). If refering to a table in Supercollider land, we would be refering to a `Buffer`.
TIP: As a possible source of terminological misunderstanding. The concept of "table" here refers to an indexed iterateable list of values. Clojure has no concept of "table", so when discussing tables in Clojure land, we would be a refering to a vector (or some other sequenceable list). If refering to a table in Supercollider land, we would be refering to a `Buffer`.


That trivial knowledge above is quite irrelevant to our task of makeing wavetables in Overtone, but the connection of phase, amplitude, table and storage of audio is important to understand before we proceed. But let's create a sinewave table with the following formula stem:[sum_(n=0)^L=sin(frac{2pin}{L})**A]. Where `L` stands for table length (typically a number which is stem:[2^x]) and `A` stands for the amplitude.
Expand Down

0 comments on commit 15d705e

Please sign in to comment.