From 60b0d8882f93ff39d0d2811a2d5fd104905a6823 Mon Sep 17 00:00:00 2001 From: Raphael Forment Date: Mon, 9 Oct 2023 23:03:39 +0200 Subject: [PATCH] New reverb and new compressor documentation and parameters --- package.json | 2 +- src/classes/SoundEvent.ts | 23 +++++++++++++++++++++-- src/documentation/engine.ts | 27 +++++++++++++++++++++++---- yarn.lock | 8 ++++---- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index a3c6903..996194a 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "postcss": "^8.4.27", "showdown": "^2.1.0", "showdown-highlight": "^3.1.0", - "superdough": "^0.9.8", + "superdough": "^0.9.10", "tailwind-highlightjs": "^2.0.1", "tailwindcss": "^3.3.3", "tone": "^14.8.49", diff --git a/src/classes/SoundEvent.ts b/src/classes/SoundEvent.ts index f2be5f5..8edacab 100644 --- a/src/classes/SoundEvent.ts +++ b/src/classes/SoundEvent.ts @@ -301,10 +301,29 @@ export class SoundEvent extends AudibleEvent { // Reverb management public room = (value: number) => this.updateValue("room", value); - public rm = this.room; - public size = (value: number) => this.updateValue("size", value); + public rm = this.room + public roomfade = (value: number) => this.updateValue("roomfade", value); + public rfade = this.roomfade; + public roomlp = (value: number) => this.updateValue("roomlp", value); + public rlp = this.roomlp; + public roomdim = (value: number) => this.updateValue("roomdim", value); + public rdim = this.roomdim; + public size = (value: number) => this.updateValue("roomsize", value); public sz = this.size; + // Compressor + public comp = (value: number) => this.updateValue('compressor', value); + public cmp = this.comp; + public ratio = (value: number) => this.updateValue('compressorRatio', value); + public rt = this.ratio; + public knee = (value: number) => this.updateValue('compressorKnee', value); + public kn = this.knee; + public compAttack = (value: number) => this.updateValue('compressorAttack', value); + public cmpa = this.compAttack; + public compRelease = (value: number) => this.updateValue('compressorRelease', value); + public cmpr = this.compRelease; + + // Unit public stretch = (beat: number) => { this.updateValue("unit", "c"); diff --git a/src/documentation/engine.ts b/src/documentation/engine.ts index a72967e..e9900c6 100644 --- a/src/documentation/engine.ts +++ b/src/documentation/engine.ts @@ -246,17 +246,21 @@ beat(.5) && snd('sawtooth') ## Reverb -A basic reverberator that you can use to give some depth to your sounds. This simple reverb design has a _LoFI_ quality that can be quite useful on certain sounds. +A good sounding reverb. This reverb unit is using a convolution that gets updated everytime you change a parameter. +For that reason, it is often a good idea to set fixed reverb values per orbit. Do not try to pattern the reverb too much. | Method | Alias | Description | |------------|-------|---------------------------------| -| room | | The more, the bigger the reverb (between 0 and 1.| -| size | | Reverberation amount | +| room | rm | Reverb level (between 0 and 1 | +| size | sz | Reverb room size of the reverb, between 0 and n | +| roomfade | | Reverb fade time, in seconds | +| roomlp | | Reverb lowpass starting frequency (in hertz) | +| roomdim | | Reverb lowpass frequency at -60db (in hertz) | ${makeExample( "Clapping in the cavern", ` -beat(2)::snd('cp').room(1).size(0.9).out() +beat(2)::snd('cp').room(0.5).size(4).out() `, true )}; @@ -282,7 +286,22 @@ beat(1)::snd('kick').out() true )}; +## Compression + +This effect is leveraging the basic WebAudio compressor. More information can be found about it on the [DynamicsCompressorNode](https://developer.mozilla.org/en-US/docs/Web/API/DynamicsCompressorNode?retiredLocale=de#instance_properties) page. This can be come quite complex :) + +| Method | Alias | Description | +|------------|-----------|---------------------------------| +| comp | cmp | Compressor threshold value (dB) over which compressor operates | +| ratio | rt | Compressor ratio: input amount in dB needed for 1dB change in the output | +| knee | kn | dB value defining the range over which the signal transitions to compressed section | +| compAttack | cmpa | In seconds, time to decrease the gain by 10db | +| compRelease | cmpr | In seconds, time to increase the gain by 10db | + + ## Distorsion, saturation, destruction + +Three additional effects that are easy enough to understand. These effects are deteriorating the signal, making it easy to get digital or gritty audio sample playback or synthesizers destroyed beyond recognition. Be careful with your signal level! | Method | Alias | Description | |------------|-----------|---------------------------------| diff --git a/yarn.lock b/yarn.lock index 27acbe6..33b643e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1272,10 +1272,10 @@ sucrase@^3.32.0: pirates "^4.0.1" ts-interface-checker "^0.1.9" -superdough@^0.9.8: - version "0.9.8" - resolved "https://registry.yarnpkg.com/superdough/-/superdough-0.9.8.tgz#de30e364b2613a15a46f35f359a2a0ce30d52611" - integrity sha512-3xy2LXAH4K0JMwwY4G0eJz+u1VIhSFxIE4YZL7E4isjUQZTN9Y0jpX17EzQgvFIW1V3PUJMkDiDgEDWZTRCTKg== +superdough@^0.9.10: + version "0.9.10" + resolved "https://registry.yarnpkg.com/superdough/-/superdough-0.9.10.tgz#9554964741c508b4c5d596fa8acbb2efea822250" + integrity sha512-IGu0+fBXpSS4l4Q+4ATRhSFXnas7t2G6uc5Ry+keQ4G+nc6uK6twAP0YyBlSB4RUdGpZCIS1o0t8qJ7MaBg4gw== dependencies: nanostores "^0.8.1"