Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mo deeper - Improved 808 Kick sound #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/initialState.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default Immutable({
selectedPlayFillPattern: 0,
fillScheduled: false,

tempo: 135,
tempo: 118,
fineTempo: 0,

currentStep: 0,
Expand All @@ -132,4 +132,4 @@ export default Immutable({
clearDragging: false,

pendingPatternLength: 0
})
})
18 changes: 9 additions & 9 deletions src/synth/drumModules/bassDrum.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import PulseTrigger from 'synth/basics/pulseTrigger';
import SoftClipper from 'synth/effects/softClipper';
import {equalPower} from 'helpers';

const FREQ_AMT = 50;
const START_FREQ = 48;
const FREQ_AMT = 14;
const START_FREQ = 44;

export default function (audioCtx, destination, time, {level, tone, decay}) {
// parameters
const outputLevel = equalPower(level);
const vcfFreq = 200 + tone * 20;
const decayTime = decay * 5 + 50;
const vcfFreq = 100 + tone * 20;
const decayTime = decay * 8 + 50;

// audio modules
const vco = new VCO(SINE, audioCtx);
Expand All @@ -29,13 +29,13 @@ export default function (audioCtx, destination, time, {level, tone, decay}) {
vca.amplitude.value = 0;

const outputVCA = new VCA(audioCtx);
outputVCA.amplitude.value = outputLevel + 0.4;
outputVCA.amplitude.value = outputLevel + 0.2;

const softClipper = new SoftClipper(0.6, audioCtx);
const softClipper = new SoftClipper(0.7, audioCtx);

// envelopes
const oscEnv = new ADGenerator(EXPONENTIAL, 0.11, decayTime, START_FREQ, FREQ_AMT);
const ampEnv = new ADGenerator(LINEAR, 2, decayTime, 0.0, 1.0);
const oscEnv = new ADGenerator(EXPONENTIAL, 0.12, decayTime, START_FREQ, FREQ_AMT);
const ampEnv = new ADGenerator(LINEAR, 2, decayTime, 0.0, 1.4);

// module routing
vco.connect(vca);
Expand Down Expand Up @@ -64,4 +64,4 @@ export default function (audioCtx, destination, time, {level, tone, decay}) {
}, (time - audioCtx.currentTime) + 1000);

return outputVCA;
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The work here does sound a lot more like the original, nice work!

28 changes: 17 additions & 11 deletions src/synth/drumModules/snareDrum.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import VCO, { SINE, WHITE_NOISE } from 'synth/basics/vco';
import VCF, { HIGHPASS } from 'synth/basics/vcf';
import VCA from 'synth/basics/vca';
import ADGenerator, { LINEAR } from 'synth/basics/ADGenerator';
import ADGenerator, { LINEAR, EXPONENTIAL } from 'synth/basics/ADGenerator';
import {equalPower} from 'helpers';

const highOscFreq = 476;
const lowOscFreq = 238;

var highOscFreq = 478;
var lowOscFreq = 238;
export default function (audioCtx, destination, time, { level, tone, snappy }) {
tone = tone == 0 ? 1 : tone;
// parameters
const outputLevel = equalPower(level);
const noiseVCFFreq = (tone * 100) + 800;
const snappyEnvAmt = snappy / 200;

const noiseVCFFreq = 300;
const snappyEnvAmt = snappy / 10;
var oscVCFFreq = (function(){
var freq = 20;
freq = freq * tone
return freq;
})();
// audio modules
const highOsc = new VCO(SINE, audioCtx);
highOsc.frequency.value = highOscFreq;
Expand All @@ -24,6 +27,9 @@ export default function (audioCtx, destination, time, { level, tone, snappy }) {

const noiseVCF = new VCF(HIGHPASS, audioCtx);
noiseVCF.frequency.value = noiseVCFFreq;

const oscVCF = new VCF(HIGHPASS, audioCtx);
oscVCF.frequency.value = oscVCFFreq;

const oscVCA = new VCA(audioCtx);
const noiseVCA = new VCA(audioCtx);
Expand All @@ -32,14 +38,14 @@ export default function (audioCtx, destination, time, { level, tone, snappy }) {
outputVCA.amplitude.value = outputLevel;

// envelopes
const noiseEnv = new ADGenerator(LINEAR, 0.1, 75, 0, 0.5);
const snappyEnv = new ADGenerator(LINEAR, 0.1, 50, 0, snappyEnvAmt);
const noiseEnv = new ADGenerator(EXPONENTIAL, 0.1, 100, 0, snappyEnvAmt*.5);
const snappyEnv = new ADGenerator(EXPONENTIAL, 0.1, 80, 0, tone);

// module routing
highOsc.connect(oscVCA);
lowOsc.connect(oscVCA);
oscVCA.connect(outputVCA);

oscVCF.connect(oscVCF);
noiseOsc.connect(noiseVCF);
noiseVCF.connect(noiseVCA);
noiseVCA.connect(outputVCA);
Expand Down