Skip to content

Commit

Permalink
tutorial
Browse files Browse the repository at this point in the history
Update README.pdf
  • Loading branch information
porres committed Jul 31, 2024
1 parent 84cb893 commit 3925aba
Show file tree
Hide file tree
Showing 68 changed files with 869 additions and 1,543 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,39 @@
#X declare -path else;
#X obj 612 160 downsample~;
#X obj 938 47 initmess \; \$0-sr 44100;
#X obj 914 134 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
#dcdcdc #000000 #000000 0 256;
#X obj 914 134 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 974 133 Hertz;
#X obj 840 200 out~;
#X obj 840 160 sh~;
#X obj 914 158 impulse~;
#X obj 686 139 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
#dcdcdc #000000 #000000 0 256;
#X obj 689 116 hsl 100 15 400 44100 1 0 empty \$0-sr empty -2 -8 0
10 #dcdcdc #000000 #000000 0 1;
#X obj 686 139 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 689 116 hsl 100 15 400 44100 1 0 empty \$0-sr empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 744 138 Hertz;
#X obj 628 200 out~;
#X obj 598 73 send~ \$0-audio;
#X obj 840 109 receive~ \$0-audio, f 8;
#X obj 612 109 receive~ \$0-audio, f 8;
#X text 599 15 [play.file~] plays audio files;
#X obj 889 14 declare -path else;
#X obj 598 41 play.file~ bubul.wav 1 1;
#X text 17 17 The "decimator" is an audio processing technique that
consists in reducing the sample rate (also known as "downsampling").
, f 79;
#X text 17 134 The downsampling process collects an amplitude value
from the signal. In the upsampling process \, one option is to hold
this same value for all the new sample values. The [downsample~] object
from ELSE can do this and just needs a downsampling frequency value.
A more ellaborate way to implement this is with [sh~] \, from ELSE
\. This is a "sample and hold" unit that collects a sample value when
receiving impulses (given by [impulse~]) and holds such values until
the next trigger. The frequency at which it receives impulses is the
downsampled frequency., f 79;
#X text 17 53 Depending on what you do \, downsampling doesn't really
reduce the sample rate. One can \, for instance \, reduce the sample
rate but perform an upsampling to go back to the original sample rate.
This keeps the same sample rate but still counts as a "decimator" and
creates aliasing artifacts. This makes sense because you want other
things in your patch to run in the original sample rate., f 79;
#X text 17 17 The "decimator" is an audio processing technique that consists in reducing the sample rate (also known as "downsampling")., f 79;
#X text 17 134 The downsampling process collects an amplitude value from the signal. In the upsampling process \, one option is to hold this same value for all the new sample values. The [downsample~] object from ELSE can do this and just needs a downsampling frequency value. A more ellaborate way to implement this is with [sh~] \, from ELSE . This is a "sample and hold" unit that collects a sample value when receiving impulses (given by [impulse~]) and holds such values until the next trigger. The frequency at which it receives impulses is the downsampled frequency., f 79;
#X text 17 53 Depending on what you do \, downsampling doesn't really reduce the sample rate. One can \, for instance \, reduce the sample rate but perform an upsampling to go back to the original sample rate. This keeps the same sample rate but still counts as a "decimator" and creates aliasing artifacts. This makes sense because you want other things in your patch to run in the original sample rate., f 79;
#X text 901 265 [spectrograph~];
#X text 956 435 22.05 Khz;
#X text 608 434 0 hz;
#X obj 612 287 spectrograph~ 1024 1 0 400 140 100;
#X obj 917 111 hsl 100 15 400 44100 1 0 empty \$0-sr empty -2 -8 0
10 #dcdcdc #000000 #000000 0 1;
#X text 17 256 This example plays a recording of a "bubul tarang" \,
an indian string instrument (which sounds a bit like a guitar). You
can clearly hear that the frequency content is now bound to a new
Nyquist frequency according to the downsampling frequency (half of
it \, of course). In other words \, you hear aliasing in this process.
But since we still have the same sample rate (44.1 Khz in this case)
\, the nyquist frequency is still the same (22.05 Khz) and frequency
content up to it is still present even though it doesn't seem so.,
f 79;
#X text 17 363 Check the spectral graph in [spectrograph~] from ELSE
- the spectral energy is still present throughout the frequency range.
This graph shows frequencies in the horizontal axis and amplitude values
for the frequencies in the vertical axis. More details about this process
will be described in chapter 13 \, when presenting bandlimiting of
noise sources., f 79;
#X obj 917 111 hsl 100 15 400 44100 1 0 empty \$0-sr empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 17 256 This example plays a recording of a "bubul tarang" \, an indian string instrument (which sounds a bit like a guitar). You can clearly hear that the frequency content is now bound to a new Nyquist frequency according to the downsampling frequency (half of it \, of course). In other words \, you hear aliasing in this process. But since we still have the same sample rate (44.1 Khz in this case) \, the nyquist frequency is still the same (22.05 Khz) and frequency content up to it is still present even though it doesn't seem so., f 79;
#X text 17 363 Check the spectral graph in [spectrograph~] from ELSE - the spectral energy is still present throughout the frequency range. This graph shows frequencies in the horizontal axis and amplitude values for the frequencies in the vertical axis. More details about this process will be described in chapter 13 \, when presenting bandlimiting of noise sources., f 79;
#X obj 598 41 play.file~ bubul.mp3 1 1;
#X connect 0 0 10 0;
#X connect 0 0 23 0;
#X connect 0 0 22 0;
#X connect 2 0 6 0;
#X connect 5 0 4 0;
#X connect 6 0 5 1;
#X connect 7 0 0 1;
#X connect 8 0 7 0;
#X connect 12 0 5 0;
#X connect 13 0 0 0;
#X connect 16 0 11 0;
#X connect 24 0 2 0;
#X connect 23 0 2 0;
#X connect 26 0 11 0;
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,30 @@
#X obj 428 244 downsample~ 1000 1;
#X obj 409 435 downsample~ 1000;
#X obj 104 358 downsample~;
#X obj 178 335 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-228856 -1 -1 44100 256;
#X obj 181 312 hsl 100 15 400 44099 1 0 empty \$0-sr empty -2 -8 0
10 -228856 -1 -1 9900 1;
#X obj 178 335 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 181 312 hsl 100 15 400 44099 1 0 empty \$0-sr empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X text 236 336 Hertz;
#X obj 104 394 out~;
#X msg 28 296 interp \$1;
#X obj 28 269 tgl 16 0 empty empty empty 17 7 0 10 -228856 -1 -1 0
1;
#X obj 28 269 tgl 16 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 178 286 initmess 44100;
#N canvas 669 119 544 609 vanilla 0;
#X obj 110 242 vsnapshot~;
#X obj 110 294 vline~;
#X obj 151 341 graph~ 441 20;
#X obj 138 200 metro 1;
#X obj 138 180 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 138 180 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 110 270 pack f 1;
#X obj 61 193 osc~ 200;
#X floatatom 207 198 5 0 0 0 - - -;
#X obj 207 248 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-262144 -1 -1 1 256;
#X floatatom 207 198 5 0 0 0 - - - 0;
#X obj 207 248 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #fcfcfc #000000 #000000 0 256;
#X obj 207 224 expr 1000 / $f1;
#X obj 138 130 loadbang;
#X msg 207 176 1000;
#X obj 112 501 out~;
#X text 248 197 sample rate;
#X text 267 248 period in ms;
#X text 29 38 We use [vsnapshot~] to collect sample values and [vline~]
to generate an interpolated audio line from a list of numbers (the
first is the arrival point and the second is the time it takes to get
there).;
#X text 29 38 We use [vsnapshot~] to collect sample values and [vline~] to generate an interpolated audio line from a list of numbers (the first is the arrival point and the second is the time it takes to get there).;
#X text 371 412 <= [graph~];
#X connect 0 0 5 0;
#X connect 1 0 2 0;
Expand All @@ -57,19 +49,13 @@ there).;
#X connect 10 0 11 0;
#X connect 11 0 7 0;
#X restore 185 538 pd vanilla;
#X text 32 68 Besides just holding values \, another alternative when
upsampling is to interpolate between two sample values. The [downsample~]
object also performs a simple linear interpolation. Test it below and
check the difference., f 51;
#X text 32 68 Besides just holding values \, another alternative when upsampling is to interpolate between two sample values. The [downsample~] object also performs a simple linear interpolation. Test it below and check the difference., f 51;
#X text 636 324 Interpolated;
#X obj 600 16 declare -path else;
#X obj 102 228 play.file~ bubul.wav 1 1;
#X text 33 490 The subpatch below shows how to implement downsampling
with interpolation with just native Pd Vanilla objects., f 50;
#X text 33 490 The subpatch below shows how to implement downsampling with interpolation with just native Pd Vanilla objects., f 50;
#X text 592 54 [graph~];
#X text 32 146 To the right \, ELSE's [graph~] shows graphical representation
of the resulting waveforms in both interpolated and sample and hold
downsampling., f 51;
#X text 32 146 To the right \, ELSE's [graph~] shows graphical representation of the resulting waveforms in both interpolated and sample and hold downsampling., f 51;
#X obj 102 227 play.file~ bubul.mp3 1 1;
#X connect 0 0 1 0;
#X connect 0 0 6 0;
#X connect 0 0 7 0;
Expand All @@ -81,4 +67,4 @@ downsampling., f 51;
#X connect 13 0 8 0;
#X connect 14 0 13 0;
#X connect 15 0 10 0;
#X connect 20 0 8 0;
#X connect 23 0 8 0;
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
#X obj 298 234 db2lin;
#X obj 60 405 meter~;
#X obj 184 404 meter~;
#X obj 280 414 out~;
#X obj 280 424 out~;
#X text 180 547 adjusted;
#X text 45 60 This example shows how to adjust the gain of an incoming audio \, in this case from a sample. The adjustment is made with a dB input and using [db2lin] to convert it to a ratio., f 57;
#X text 359 261 Ratio;
#X text 312 321 gain adjustment;
#X obj 298 292 f2s~ 10 1;
#X text 44 162 Compare the VU meter of the original sound with the gain adjusted one.;
#X obj 303 26 declare -path else;
#X obj 61 256 play.file~ bubul.wav 1 1;
#X text 44 123 This way we can add gain (or boost it) with positive dB values or decrease its intensity with negative values., f 57;
#X obj 61 256 play.file~ bubul.mp3 1 1;
#X connect 0 0 13 0;
#X connect 1 0 7 0;
#X connect 1 0 8 0;
#X connect 2 0 5 0;
#X connect 5 0 0 0;
#X connect 13 0 1 1;
#X connect 16 0 1 0;
#X connect 16 0 6 0;
#X connect 17 0 1 0;
#X connect 17 0 6 0;
Original file line number Diff line number Diff line change
@@ -1,63 +1,42 @@
#N canvas 378 23 913 587 12;
#N canvas 378 38 913 587 12;
#X declare -path else;
#X obj 749 246 *~ -1;
#X obj 97 391 s~ \$0-sample;
#X obj 662 211 r~ \$0-sample;
#X obj 98 436 r~ \$0-sample;
#X obj 648 404 r~ \$0-sample;
#X obj 561 277 out~;
#X text 27 120 But first let's understand how we listen. We have two
ears pointed to opposite direction. Our brain can perceive when a sound
source reaches both of our ears \, and the delay from when it arrives
to one ear and the other gives us a cue on where the sound source is
located. A good stereo microphone recording places the microphones
in a way to achieve this imaging effect., f 61;
#X obj 262 403 hsl 128 15 7 21 0 0 empty empty empty -2 -8 0 10 -228856
-1 -1 0 1;
#X obj 259 425 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
-228856 -1 -1 0 256;
#X text 27 120 But first let's understand how we listen. We have two ears pointed to opposite direction. Our brain can perceive when a sound source reaches both of our ears \, and the delay from when it arrives to one ear and the other gives us a cue on where the sound source is located. A good stereo microphone recording places the microphones in a way to achieve this imaging effect., f 61;
#X obj 262 403 hsl 128 15 7 21 0 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 259 425 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X obj 185 470 ffdelay~ 21;
#X text 27 234 Hass effect:;
#X text 486 40 Polarity inversion:;
#X text 486 71 While we're on the subject \, if you have a stereo track
that you sum together into a mono source \, you can have cancelling
issues. One way out is to invert or flip the polarity of one of the
tracks. This is just multiplying by -1 and deals with cancelling issues.
, f 55;
#X text 485 148 Conversely \, we can also get one mono input and create
a widened stereo effect by inverting the polarity of one of the tracks.
See the difference below., f 55;
#X text 486 71 While we're on the subject \, if you have a stereo track that you sum together into a mono source \, you can have cancelling issues. One way out is to invert or flip the polarity of one of the tracks. This is just multiplying by -1 and deals with cancelling issues., f 55;
#X text 485 148 Conversely \, we can also get one mono input and create a widened stereo effect by inverting the polarity of one of the tracks. See the difference below., f 55;
#X obj 735 438 ffdelay~ 20;
#X text 496 351 Now \, this is Pd and the crazy world of live electronic
music \, why not do both? Have some fun!, f 39;
#X text 496 351 Now \, this is Pd and the crazy world of live electronic music \, why not do both? Have some fun!, f 39;
#X obj 735 465 *~ -1;
#X obj 259 445 f2s~ 10 7;
#X obj 713 26 declare -path else;
#X obj 97 365 play.file~ bubul.wav 1 1;
#X obj 648 494 out~;
#X obj 662 276 out~;
#X obj 98 498 out~;
#X text 27 42 Stereo widening is any technique that increases the perceived
stereo width or spread of a signal into the stereo field. Panning is
one such technique \, but this example shows you other cheap and dirty
tricks to create stereo images from mono sources., f 61;
#X text 27 258 This is a delay trick \, also known as the "Hass effect"
\, implemented by simply duplicating a mono signal but delaying one
of the outputs. Try delay values from 7 to 21 ms as in the example
below \, which is a good range for the haas effect (but you go wilder
if you want)., f 61;
#X connect 0 0 21 1;
#X text 27 42 Stereo widening is any technique that increases the perceived stereo width or spread of a signal into the stereo field. Panning is one such technique \, but this example shows you other cheap and dirty tricks to create stereo images from mono sources., f 61;
#X text 27 258 This is a delay trick \, also known as the "Hass effect" \, implemented by simply duplicating a mono signal but delaying one of the outputs. Try delay values from 7 to 21 ms as in the example below \, which is a good range for the haas effect (but you go wilder if you want)., f 61;
#X obj 97 365 play.file~ bubul.mp3 1 1;
#X connect 0 0 20 1;
#X connect 2 0 0 0;
#X connect 2 0 5 0;
#X connect 2 0 21 0;
#X connect 2 0 20 0;
#X connect 3 0 9 0;
#X connect 3 0 22 0;
#X connect 3 0 21 0;
#X connect 4 0 14 0;
#X connect 4 0 20 0;
#X connect 4 0 19 0;
#X connect 7 0 8 0;
#X connect 8 0 17 0;
#X connect 9 0 22 1;
#X connect 9 0 21 1;
#X connect 14 0 16 0;
#X connect 16 0 20 1;
#X connect 16 0 19 1;
#X connect 17 0 9 1;
#X connect 19 0 1 0;
#X connect 24 0 1 0;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#X text 81 445 original;
#X text 442 226 Compare the result of the original and the gated signals., f 65;
#X obj 733 22 declare -path else;
#X obj 79 34 play.file~ 1 MouthBow.wav 1 1;
#X obj 183 112 op~ >;
#X text 441 132 The comparison is done with [op~ >] \, where a higher value than the threshold will return "1" if true or "0" if false. These values are then used to open and close the gate with the [glide~] object. The [glide~] time here is set to 10 ms and can be thought of as the attack/release - [glide2~] can be used for different attack and release times., f 66;
#X obj 183 142 numbox~ 6 12 100 #C0C0C4 #440008 10 0 0 0;
Expand All @@ -25,21 +24,22 @@
#X obj 597 438 nbx 4 17 -100 0 0 0 empty empty empty 0 -8 0 13 #dcdcdc #000000 #000000 0 256;
#X obj 616 414 nbx 4 17 -100 0 0 0 empty empty empty 0 -8 0 13 #dcdcdc #000000 #000000 0 256;
#X obj 597 356 noisegate~ -30 -size 1024;
#X obj 597 328 play.file~ 1 MouthBow.wav 1 1;
#X text 462 262 the patch to the left is the basis of the implementation of the [noisgate~] abstraction from ELSE \, check it below \, open its help file.;
#X connect 0 0 17 1;
#X obj 79 34 play.file~ 1 MouthBow.flac 1 1;
#X obj 597 328 play.file~ 1 MouthBow.flac 1 1;
#X connect 0 0 16 1;
#X connect 2 0 4 0;
#X connect 3 0 5 0;
#X connect 4 0 6 0;
#X connect 8 0 0 0;
#X connect 10 0 2 1;
#X connect 16 0 3 0;
#X connect 16 0 2 0;
#X connect 16 0 20 0;
#X connect 17 0 19 0;
#X connect 19 0 10 0;
#X connect 20 0 17 0;
#X connect 21 0 22 0;
#X connect 21 1 23 0;
#X connect 24 0 21 0;
#X connect 25 0 24 0;
#X connect 16 0 18 0;
#X connect 18 0 10 0;
#X connect 19 0 16 0;
#X connect 20 0 21 0;
#X connect 20 1 22 0;
#X connect 23 0 20 0;
#X connect 25 0 3 0;
#X connect 25 0 2 0;
#X connect 25 0 19 0;
#X connect 26 0 23 0;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#N canvas 404 33 903 518 12;
#N canvas 404 38 903 518 12;
#X declare -path else;
#X obj 355 458 nbx 4 17 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 13 #dcdcdc #000000 #000000 0 256;
#X text 434 459 dBFS;
Expand All @@ -20,27 +20,27 @@
#X text 566 390 This process can be used in conjunction to a noise gate (in an earlier stage) to avoid that a noise floor is raised to the normalized value!, f 41;
#X text 445 100 This realtime normalizer patch continuously adjusts the gain to a fixed RMS value., f 61;
#X obj 697 59 declare -path else;
#X obj 494 299 play.file~ 1 MouthBow.wav 1 1;
#X obj 50 71 play.file~ 1 kantele.wav 1 1, f 15;
#X obj 256 208 numbox~ 6 12 100 #C0C0C4 #440008 10 0 0 0;
#X text 329 206 <-- ratio;
#X obj 294 173 numbox~ 6 12 100 #C0C0C4 #440008 10 0 0 0;
#X obj 294 147 mov.rms~ -lin 1024;
#X obj 256 110 db2lin;
#X obj 50 71 play.file~ kantele.flac 1 1, f 16;
#X obj 494 299 play.file~ MouthBow.flac 1 1;
#X connect 2 0 3 0;
#X connect 5 0 7 0;
#X connect 5 1 6 0;
#X connect 6 0 0 0;
#X connect 8 0 9 0;
#X connect 9 0 26 0;
#X connect 11 0 22 0;
#X connect 9 0 24 0;
#X connect 11 0 20 0;
#X connect 12 0 5 0;
#X connect 13 0 14 0;
#X connect 20 0 13 0;
#X connect 21 0 2 0;
#X connect 21 0 12 0;
#X connect 21 0 25 0;
#X connect 22 0 12 1;
#X connect 24 0 11 1;
#X connect 25 0 24 0;
#X connect 26 0 11 0;
#X connect 20 0 12 1;
#X connect 22 0 11 1;
#X connect 23 0 22 0;
#X connect 24 0 11 0;
#X connect 25 0 2 0;
#X connect 25 0 12 0;
#X connect 25 0 23 0;
#X connect 26 0 13 0;
Loading

0 comments on commit 3925aba

Please sign in to comment.