|
| 1 | +# Tune Shark V3 |
| 2 | +Tune Shark V3 is a powerful audio engine that is built to give you full control over your sounds. It allows you to apply numerous audio effects, precisely measure sound outputs, and more! |
| 3 | +This is a remaster of the now deprecated Tune Shark extension by SharkPool. |
| 4 | + |
| 5 | +## General Setup |
| 6 | + |
| 7 | +### Note: All Tune Shark sounds are globally accessible in your project. This means all sprites will be able to access a loaded sound. |
| 8 | + |
| 9 | +```scratch |
| 10 | +⚙️ import sound from URL [https://...] named [MySound] ::#666666 |
| 11 | +``` |
| 12 | + |
| 13 | +You can import "Tune Shark" sounds via URL/URI using this block. It is important to note that URLs *must* be a **direct** link to an audio file |
| 14 | + |
| 15 | +```scratch |
| 16 | +⚙️ import sound (Meow v) named [MySound] ::#666666 |
| 17 | +``` |
| 18 | + |
| 19 | +Alternatively, you can import "Tune Shark" sounds from pre-existing sounds from the "Sounds" tab in the editor. |
| 20 | + |
| 21 | +```scratch |
| 22 | +⚙️ duplicate sound [MySound] as [MySound2] ::#666666 |
| 23 | +``` |
| 24 | + |
| 25 | +This block simply creates a copy of the first inputted sound and gives it the name of the second inputted sound. |
| 26 | +Granted, you could just use the `import sound from url` block, but this block removes the wait time to import. |
| 27 | + |
| 28 | +```scratch |
| 29 | +⚙️ [bind v] sound [MySound] and sound [MySound2] ::#666666 |
| 30 | +``` |
| 31 | + |
| 32 | +This block allows you to bind or unbind the first inputted sound to the second. This means when you play "MySound2", "MySound" will play as well. |
| 33 | +This **does not** go the same way in reverse. |
| 34 | + |
| 35 | +## Audio Playback |
| 36 | + |
| 37 | +```scratch |
| 38 | +🎵 start sound [MySound] ::#666666 |
| 39 | +``` |
| 40 | +Similar to Scratch, this will start a sound from the beginning. |
| 41 | + |
| 42 | +```scratch |
| 43 | +🎵 start sound [MySound] at time (5) ::#666666 |
| 44 | +``` |
| 45 | + |
| 46 | +You can also start sounds at certain times (in seconds) in the track using this block. |
| 47 | + |
| 48 | +```scratch |
| 49 | +🎵 start sound [MySound] at time (0) and stop at (2) ::#666666 |
| 50 | +``` |
| 51 | + |
| 52 | +Similar to the above block, this block will start a sound at a certain point, then **waits** until the sound reaches the stopping point. |
| 53 | + |
| 54 | +```scratch |
| 55 | +🎵 stop sound [MySound] ::#666666 |
| 56 | +``` |
| 57 | + |
| 58 | +This block will stop the inputted sound. |
| 59 | + |
| 60 | +```scratch |
| 61 | +🎵 [pause v] sound [MySound] ::#666666 |
| 62 | +``` |
| 63 | + |
| 64 | +This block will pause/unpause the inputted sound. |
| 65 | + |
| 66 | +```scratch |
| 67 | +🎵 [start v] all sounds ::#666666 |
| 68 | +``` |
| 69 | + |
| 70 | +This block controls all loaded sounds. You can: |
| 71 | +- start all sounds |
| 72 | +- stop all sounds |
| 73 | +- pause all sounds |
| 74 | +- unpause all sounds |
| 75 | + |
| 76 | +## Operations |
| 77 | + |
| 78 | +```scratch |
| 79 | +⚙️ toggle sound link to @greenFlag @stopSign [on v] ::#666666 |
| 80 | +``` |
| 81 | + |
| 82 | +Toggling this operator on will cause Tune Shark sounds to stop when the green flag or stop sign is clicked. |
| 83 | + |
| 84 | +```scratch |
| 85 | +⚙️ toggle sound [MySound] overlapping [on v] ::#666666 |
| 86 | +``` |
| 87 | + |
| 88 | +Toggling this operator on will allow multiple instances of a sound to play at once. |
| 89 | +Normally, you can only play one instance of a sound at a time. |
| 90 | + |
| 91 | +```scratch |
| 92 | +⚙️ toggle sound [MySound] reverse mode [on v] ::#666666 |
| 93 | +``` |
| 94 | + |
| 95 | +Toggling this operator on will make the inputted ound play in reverse. Toggling it off will return it back to normal. |
| 96 | + |
| 97 | +```scratch |
| 98 | +⚙️ toggle sound [MySound] looping [on v] ::#666666 |
| 99 | +``` |
| 100 | + |
| 101 | +Toggling this operator on will allow the inputted sound to loop. |
| 102 | + |
| 103 | +```scratch |
| 104 | +⚙️ sound [MySound] loop start (0) end (2) ::#666666 |
| 105 | +``` |
| 106 | + |
| 107 | +You can mess around with the loop starting point and ending point with this block. |
| 108 | + |
| 109 | +```scratch |
| 110 | +⚙️ delete sound [MySound] ::#666666 |
| 111 | +``` |
| 112 | + |
| 113 | +This block will delete the inputted sound. |
| 114 | + |
| 115 | +```scratch |
| 116 | +⚙️ delete all sounds ::#666666 |
| 117 | +``` |
| 118 | + |
| 119 | +This block will delete all loaded sounds. |
| 120 | + |
| 121 | +```scratch |
| 122 | +(⚙️ all sounds ::#666666) |
| 123 | +``` |
| 124 | + |
| 125 | +This block will return an array of the names of all loaded Tune Shark sounds. |
| 126 | + |
| 127 | +```scratch |
| 128 | +(⚙️ all playing sounds ::#666666) |
| 129 | +``` |
| 130 | + |
| 131 | +Similarly, this block returns an array of the names of all loaded Tune Shark sounds that are currently playing. |
| 132 | + |
| 133 | +```scratch |
| 134 | +⚙️ when sound [MySound] [starts v] ::#666666 hat |
| 135 | +``` |
| 136 | + |
| 137 | +This event block runs whenever the inputted sound starts or ends. |
| 138 | + |
| 139 | +```scratch |
| 140 | +<⚙️ sound [MySound] (exists v)? ::#666666> |
| 141 | +``` |
| 142 | + |
| 143 | +Returns various information of a sound: |
| 144 | +Options | What they Check for |
| 145 | +--- | --- |
| 146 | +exists | if the sound exists |
| 147 | +playing | if the sound is playing |
| 148 | +paused | if the sound is paused |
| 149 | +looped | if the sound is looping |
| 150 | +overlaped | if the sound allows instancing |
| 151 | +reversed | if the sound is reversed |
| 152 | +binded | if the sound is binded to another |
| 153 | + |
| 154 | +```scratch |
| 155 | +(⚙️ (length v) of sound [MySound] ::#666666) |
| 156 | +``` |
| 157 | + |
| 158 | +Returns various information of a sound: |
| 159 | +Options | What they Do |
| 160 | +--- | --- |
| 161 | +length | sound length (in seconds) |
| 162 | +current time | current position in a sound |
| 163 | +source | source URL/URI of a sound |
| 164 | +estimated bpm | estimated beats-per-minute |
| 165 | +channels | the number of [channels](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_concepts) in a sound |
| 166 | +sample rate | sample rate of a sound |
| 167 | +fft data | a live Array of loudness values across all frequencies |
| 168 | +binds | an array of sound names binded to this sound |
| 169 | +*...various audio effects* | returns the inputted parameters for the effect |
| 170 | + |
| 171 | +```scratch |
| 172 | +(⚙️ [loudness v] of sound [MySound] at time (0) in channel (1) ::#666666) |
| 173 | +``` |
| 174 | + |
| 175 | +You can read sound outputs using this block. |
| 176 | + |
| 177 | +If you select **"loudness"**, it returns a normalized volume of the outputted noise at a specific point in the sound. |
| 178 | + |
| 179 | +Similarly, **"raw noise"** returns the outputted volume, but its *not normalized* |
| 180 | + |
| 181 | +Selecting **"tone"** will return the outputted pitch of a sound at a specific point. |
| 182 | + |
| 183 | + |
| 184 | +The channel input selects which [sound channel](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_concepts) to extract the output data from. |
| 185 | +Typically, if there are 2 channels, channel 1 is "Left Ear" and channel 2 is "Right Ear". |
| 186 | + |
| 187 | +```scratch |
| 188 | +(⚙️ crop sound [MySound] at time (0) to (1) ::#666666) |
| 189 | +``` |
| 190 | + |
| 191 | +This block will crop the inputted sound at the selected time parameters (in seconds). It returns a new WAV file data.uri. |
| 192 | + |
| 193 | +```scratch |
| 194 | +(⚙️ join sound [MySound] and [MySound2] ::#666666) |
| 195 | +``` |
| 196 | + |
| 197 | +This block will concatenate 2 loaded sounds and return a WAV file data.uri. |
| 198 | + |
| 199 | +## Audio Effects |
| 200 | + |
| 201 | +```scratch |
| 202 | +🎛️ set volume of sound [MySound] to (100) ::#666666 |
| 203 | +``` |
| 204 | + |
| 205 | +This block simply sets the volume of the inputted sound. |
| 206 | + |
| 207 | +```scratch |
| 208 | +🎛️ reset (all effects v) of sound [MySound] ::#666666 |
| 209 | +``` |
| 210 | + |
| 211 | +This block resets the values of each audio effect in a sound to the default (not including volume). |
| 212 | + |
| 213 | +```scratch |
| 214 | +🎛️ set (pitch v) of sound [MySound] to (0) ::#666666 |
| 215 | +``` |
| 216 | + |
| 217 | +Sets the effect of a selected sound to a inputted value. |
| 218 | +Effect List | What they Do |
| 219 | +--- | --- |
| 220 | +pitch | changes the speed and tone of the sound |
| 221 | +detune | changes the speed and semitone of the sound |
| 222 | +speed | changes the speed of the sound without affecting pitch |
| 223 | +pan | shifts sound to the left (negative) or right (positive) ear |
| 224 | +gain | boosts the sounds volume beyond 100 |
| 225 | +distortion | distorts/crushes sound |
| 226 | +attack | fade-in time when sound starts |
| 227 | +release | fade-out time when sound stops |
| 228 | + |
| 229 | +```scratch |
| 230 | +🎛️ set reverb of sound [MySound] to time (100) decay (100) mix (50) ::#666666 |
| 231 | +``` |
| 232 | + |
| 233 | +Adds reverb to an inputted sound. |
| 234 | + |
| 235 | +**Warning:** Initializing reverb can cause framerate drops as its heavy to setup. For dynamic on/off use, you can use the Delay effect |
| 236 | +Parameters | What they Do |
| 237 | +--- | --- |
| 238 | +time | the length (or room space) of the reverb effect |
| 239 | +decay | the rate of how long the reverb fades over time |
| 240 | +mix | percentage of how dry or wet the sound is |
| 241 | + |
| 242 | +```scratch |
| 243 | +🎛️ set delay of sound [MySound] to time (50) feedback (60) mix (50) ::#666666 |
| 244 | +``` |
| 245 | + |
| 246 | +Adds an echoing delay effect to a sound. |
| 247 | + |
| 248 | +Parameters | What they Do |
| 249 | +--- | --- |
| 250 | +time | interval between each echo |
| 251 | +feedback | intensity of each subsequent echo |
| 252 | +mix | percentage of the original sound and the delayed sound |
| 253 | + |
| 254 | +```scratch |
| 255 | +🎛️ set pan 3D of sound [MySound] to x (0) y (50) z (50) ::#666666 |
| 256 | +``` |
| 257 | + |
| 258 | +Modulates the pan of a sound in a 3D space. |
| 259 | + |
| 260 | +Parameters | What they Do |
| 261 | +--- | --- |
| 262 | +x | pan left/right |
| 263 | +y | pan top/bottom |
| 264 | +z | pan close/far |
| 265 | + |
| 266 | +```scratch |
| 267 | +🎛️ set tremolo of sound [MySound] to speed (35) depth (80) mix (100) ::#666666 |
| 268 | +``` |
| 269 | + |
| 270 | +Modulates the volume of a sound periodically, creating a tremolo effect. |
| 271 | + |
| 272 | +Parameters | What they Do |
| 273 | +--- | --- |
| 274 | +speed | how fast the volume fluctuates |
| 275 | +depth | intensity of the volume variation. A higher depth means more dramatic volume changes |
| 276 | +mix | amount of the tremolo effect applied |
| 277 | + |
| 278 | +```scratch |
| 279 | +🎛️ set fuzz of sound [MySound] to low (60) med-low (50) med-high (80) high (60) mix (50) ::#666666 |
| 280 | +``` |
| 281 | + |
| 282 | +Applies a fuzzy distortion to a sound. |
| 283 | + |
| 284 | +Parameters | What they Do |
| 285 | +--- | --- |
| 286 | +low | amount of distortion applied to low frequencies |
| 287 | +med-low | amount of distortion applied to mid-low frequencies |
| 288 | +med-high | amount of distortion applied to mid-high frequencies |
| 289 | +high | amount of distortion applied to high frequencies |
| 290 | +mix | proportion of unfuzzed sound and fuzzed sound |
| 291 | + |
| 292 | +```scratch |
| 293 | +🎛️ set bitcrush of sound [MySound] to bits (65) freq (60000) ::#666666 |
| 294 | +``` |
| 295 | + |
| 296 | +Reduces a sound's resolution and frequency, creating a chiptune-like, retro effect. |
| 297 | + |
| 298 | +Parameters | What they Do |
| 299 | +--- | --- |
| 300 | +bits | bit depth. Lower values result in more distortion |
| 301 | +freq | sampling frequency. Lower values create a grittier effect |
| 302 | + |
| 303 | +```scratch |
| 304 | +🎛️ set [highpass v] of sound [MySound] to frequency (400) peak (10) ::#666666 |
| 305 | +``` |
| 306 | + |
| 307 | +Highpass: Filters out lower frequencies below the specified cutoff, allowing higher frequencies to pass through. |
| 308 | + |
| 309 | +Lowpass: Filters out higher frequencies above the specified cutoff, allowing lower frequencies to pass through. |
| 310 | + |
| 311 | +Parameters | What they Do |
| 312 | +--- | --- |
| 313 | +frequency | cutoff frequency for the filter |
| 314 | +peak | resonance at the cutoff frequency |
| 315 | + |
| 316 | +```scratch |
| 317 | +🎛️ set flanger of sound [MySound] to time (45) speed (20) depth (10) feed (10) mix (50) ::#666666 |
| 318 | +``` |
| 319 | + |
| 320 | +Combines the original sound with a delayed version, creating a sweeping, "jet-like" sound. |
| 321 | + |
| 322 | +Parameters | What they Do |
| 323 | +--- | --- |
| 324 | +time | delay time for the effect |
| 325 | +speed | modulation controlling how quickly it oscillates |
| 326 | +depth | intensity of the effect |
| 327 | +feed | feedback level, controlling how much flanged sound enters |
| 328 | +mix | proportion of the original and flanged sound |
| 329 | + |
| 330 | +```scratch |
| 331 | +🎛️ set compressor of sound [MySound] to threshold (15) knee (50) attack (50) release (50) ratio (50) ::#666666 |
| 332 | +``` |
| 333 | + |
| 334 | +Compresses the dynamic range of a sound, making quiet sounds louder and loud sounds quieter. |
| 335 | + |
| 336 | +Parameters | What they Do |
| 337 | +--- | --- |
| 338 | +threshold | volume level at which compression begins |
| 339 | +knee | smoothness of the transition into compression |
| 340 | +attack | how quickly the compressor responds to volume changes |
| 341 | +release | how quickly the compression effect fades after the volume decreases |
| 342 | +ratio | amount of compression applied |
| 343 | + |
| 344 | +```scratch |
| 345 | +🎛️ set equalizer of sound [MySound] to gain low (100) med (100) high (100) cutoff low (-50) cutoff high (50) ::#666666 |
| 346 | +``` |
| 347 | + |
| 348 | +Adjusts the balance between different frequency bands of the sound. This is a 3-Band Equalizer. |
| 349 | + |
| 350 | +Parameters | What they Do |
| 351 | +--- | --- |
| 352 | +gain low | gain applied to low frequencies |
| 353 | +gain med | gain applied to mid frequencies |
| 354 | +gain high | gain applied to high frequencies |
| 355 | +cutoff low | low-frequency cutoff point |
| 356 | +cutoff high | high-frequency cutoff point |
0 commit comments