|
@@ -95,6 +95,9 @@ The `HalfVolume` function in the following example illustrates how to read and m
|
95
|
95
|
|
96
|
96
|
|
97
|
97
|
```cpp
|
|
98
|
+// Given frames (an array of AudioBuffers) y N (its size)
|
|
99
|
+// divide each sample by two (both the left and right channels).
|
|
100
|
+
|
98
|
101
|
void HalfVolume(AudioBuffer frames[], int N){
|
99
|
102
|
|
100
|
103
|
// for each sample in the signal, reduce its value to half
|
|
@@ -145,7 +148,7 @@ A cheap (but many times ineffective) way to remove the vocals from a recording i
|
145
|
148
|
1. Load the project `SoundProcessing` into `QtCreator`. There are two ways to do this:
|
146
|
149
|
|
147
|
150
|
* Using the virtual machine: Double click the file `SoundProcessing.pro` located in the folder `/home/eip/labs/arrays-soundprocessing` of your virtual machine.
|
148
|
|
- * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/arrays-soundprocessing` to download the folder `arrays-soundprocessing` from `Bitbucket`. Double click the file `SoundProcessing.pro` located in the folder that you downloaded to your computer.
|
|
151
|
+ * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http://bitbucket.org/eip-uprrp/arrays-soundprocessing` to download the folder `arrays-soundprocessing` from `Bitbucket`. Double click the file `SoundProcessing.pro` located in the folder that you downloaded to your computer.
|
149
|
152
|
|
150
|
153
|
2. Compile and run the program. You will see a graphical interface to process sound and recordings.
|
151
|
154
|
|
|
@@ -171,14 +174,14 @@ A common sound effect is the gradual intensification of the recording's volume,
|
171
|
174
|
|
172
|
175
|
3. Reproduce the following recordings from the `WaveSamples` folder:
|
173
|
176
|
|
174
|
|
-* `rain-fi.wav`
|
175
|
|
-* `water-fi.wav`
|
|
177
|
+ * `rain-fi.wav`
|
|
178
|
+ * `water-fi.wav`
|
176
|
179
|
|
177
|
|
-The recordings were created using the fade in filter with `fade_length` set to `88200`. You should be able to listen how the water and the rain linearly fades in over the first two seconds, and then remains at the same volume throughout the recording. Notice that, since we are using sounds recorded at `44100` samples per second, `88200` corresponds to two seconds of the recording.
|
|
180
|
+ These two recordings were created using the fade in filter with `fade_length` set to `88200`. You should be able to listen how the water and the rain linearly fades in over the first two seconds, and then remains at the same volume throughout the recording. Notice that, since we are using sounds recorded at `44100` samples per second, `88200` corresponds to two seconds of the recording.
|
178
|
181
|
|
179
|
182
|
**Algorithm:**
|
180
|
183
|
|
181
|
|
-To apply a fade in to a sound, we multiply successive samples by constantly increasing fractional numbers between `0` and `1`. Multiplying samples by `0` silences them, and multiplying by `1` keeps them the same; multiplying by a factor between `0` and `1` scales their volume by that factor. It's important to mention that both channels of the samples should be multiplied by the same factor.
|
|
184
|
+To apply a fade-in to a sound, we multiply successive samples by constantly increasing fractional numbers between `0` and `1`. Multiplying samples by `0` silences them, and multiplying by `1` keeps them the same; multiplying by a factor between `0` and `1` scales their volume by that factor. It's important to mention that both channels of the samples should be multiplied by the same factor.
|
182
|
185
|
|
183
|
186
|
For instance, if `fade_length` is 4, the filter will be applied to the first 4 samples:
|
184
|
187
|
|
|
@@ -201,14 +204,14 @@ Another common sound effect is the gradual decrease of volume in a recording. Th
|
201
|
204
|
|
202
|
205
|
1. Load and play any of the wave files `rain.wav`, or `water.wav` just like in the previous exercises.
|
203
|
206
|
|
204
|
|
-2. Your task in this exercise is to complete the function `AudioFadeOut` in the file `audiomanip.cpp` so it will fade out the volume starting from a sample up to the end of the recording. The function receives an array of objects of the class `AudioBuffer`, the size of the array, and a fade out length that will be applied to the `AudioBuffer`. For example, if `fade_length` is `88200`, the fade-out should not affect any sample numbered `88200` or lower.
|
|
207
|
+2. Your task in this exercise is to complete the function `AudioFadeOut` in the file `audiomanip.cpp` so it will fade out the volume during the end of the recording. The function receives an array of objects of the class `AudioBuffer`, the size of the array, and a fade-out length that will be applied to the `AudioBuffer`. For example, if `fade_length` is `88200`, the fade-out will begin `88200` samples from the end of the recording .
|
205
|
208
|
|
206
|
209
|
3. Reproduce the following recordings from the `WaveSamples` folder:
|
207
|
210
|
|
208
|
|
-* `rain.fo.wav`
|
209
|
|
-* `water.fo.wav`
|
|
211
|
+ * `rain.fo.wav`
|
|
212
|
+ * `water.fo.wav`
|
210
|
213
|
|
211
|
|
-The recordings were created using the fade out filter with `fade_length` set to `88200`. You should be able to listen how the water and the rain is played at maximum volume and then in the last two seconds the sound starts to linearly fade out.
|
|
214
|
+ These two recordings were created using the fade out filter with `fade_length` set to `88200`. You should be able to listen how the water and the rain is played at maximum volume and then in the last two seconds the sound starts to linearly fade out.
|
212
|
215
|
|
213
|
216
|
**Algorithm:**
|
214
|
217
|
|