scratch-audioengine
Advanced tools
Comparing version 0.1.0-prerelease.1479762203 to 0.1.0-prerelease.1479770911
{ | ||
"name": "scratch-audioengine", | ||
"version": "0.1.0-prerelease.1479762203", | ||
"version": "0.1.0-prerelease.1479770911", | ||
"description": "audio engine for scratch 3.0", | ||
@@ -5,0 +5,0 @@ "main": "dist.js", |
@@ -5,3 +5,2 @@ var log = require('./log'); | ||
var Soundfont = require('soundfont-player'); | ||
var Vocoder = require('./vocoder'); | ||
var ADPCMSoundLoader = require('./ADPCMSoundLoader'); | ||
@@ -23,4 +22,9 @@ | ||
this.pitchEffectValue; | ||
this.vocoder = new Vocoder(); | ||
this.robotic = new Tone.Effect(); | ||
// use the period of a musical note to set the feedback filter delay time | ||
var delayTime = 1 / Tone.Frequency('Gb3').eval(); | ||
var robotFilter = new Tone.FeedbackCombFilter(delayTime, 0.9); | ||
this.robotic.effectSend.chain(robotFilter, this.robotic.effectReturn); | ||
this.wobble = new Tone.Effect(); | ||
@@ -44,4 +48,3 @@ var wobbleLFO = new Tone.LFO(10, 0, 1).start(); | ||
this.effectsNode.chain( | ||
// this.vocoder, | ||
this.distortion, this.delay, this.telephone, | ||
this.robotic, this.distortion, this.delay, this.telephone, | ||
this.wobble, this.panner, this.reverb, Tone.Master); | ||
@@ -52,2 +55,5 @@ | ||
this.effectNames = ['PITCH', 'PAN', 'ECHO', 'REVERB', 'FUZZ', 'TELEPHONE', 'WOBBLE', 'ROBOTIC']; | ||
// load sounds | ||
@@ -203,2 +209,6 @@ | ||
AudioEngine.prototype.setEffect = function (effect, value) { | ||
if (Number.isInteger(effect)) { | ||
effect = this._clamp(effect, 0, this.effectNames.length); | ||
effect = this.effectNames[effect]; | ||
} | ||
switch (effect) { | ||
@@ -227,3 +237,3 @@ case 'PITCH': | ||
case 'ROBOTIC' : | ||
this.vocoder.wet.value = value / 100; | ||
this.robotic.wet.value = value / 100; | ||
break; | ||
@@ -263,4 +273,4 @@ } | ||
case 'ROBOTIC' : | ||
this.vocoder.wet.value += value / 100; | ||
this.vocoder.wet.value = this._clamp(this.vocoder.wet.value, 0, 1); | ||
this.robotic.wet.value += value / 100; | ||
this.robotic.wet.value = this._clamp(this.robotic.wet.value, 0, 1); | ||
break; | ||
@@ -274,5 +284,2 @@ | ||
var freq = this._getPitchRatio() * Tone.Frequency('C3').eval(); | ||
this.vocoder.setCarrierOscFrequency(freq); | ||
if (!this.soundPlayers) { | ||
@@ -313,3 +320,3 @@ return; | ||
this.distortion.wet.value = 0; | ||
this.vocoder.wet.value = 0; | ||
this.robotic.wet.value = 0; | ||
this.wobble.wet.value = 0; | ||
@@ -316,0 +323,0 @@ this.telephone.wet.value = 0; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
857474
24693