Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scratch-audioengine

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scratch-audioengine - npm Package Compare versions

Comparing version 0.1.0-prerelease.1478709622 to 0.1.0-prerelease.1478803928

2

package.json
{
"name": "scratch-audioengine",
"version": "0.1.0-prerelease.1478709622",
"version": "0.1.0-prerelease.1478803928",
"description": "audio engine for scratch 3.0",

@@ -5,0 +5,0 @@ "main": "dist.js",

/*
This is a port of Jamison Dance's port of Chris Wilson's WebAudio vocoder.
This is a port of Jamison Dance's port of Chris Wilson's WebAudio vocoder:
https://github.com/jergason/Vocoder
https://github.com/cwilso/Vocoder
I have adapted it to use the ToneJs library, making it a Tone Effect that

@@ -46,3 +49,3 @@ can be added to an audio effects chain.

this.vocoderBands = this.generateVocoderBands(55, 7040, 10);
this.vocoderBands = this.generateVocoderBands(55, 7040, 8);
this.initBandpassFilters();

@@ -103,28 +106,9 @@ this.createCarrier();

// Create the sine oscillator for the heterodyne
var heterodyneOscillator = new Tone.Oscillator(this.vocoderBands[i].frequency).start();
// create a lowpass filtered follower to turn the bandpass filter output into a smooth control
// signal for the carrier filter
var follower = new Tone.Follower(0,0);
modulatorFilterPostGain.connect(follower);
var followerLowPass = new Tone.Filter(50, 'lowpass');
follower.connect(followerLowPass);
// Create the node to multiply the sine by the modulator
var heterodyne = new Tone.Gain(0); // audio-rate inputs are summed with initial intrinsic value
modulatorFilterPostGain.connect(heterodyne);
heterodyneOscillator.connect(heterodyne.gain);
var heterodynePostGain = new Tone.Gain(2.0);
heterodyne.connect(heterodynePostGain);
// Create the rectifier node
var rectifier = new Tone.WaveShaper([1, 0, 1]);
heterodynePostGain.connect(rectifier);
// Create the lowpass filter to mask off the difference (near zero)
var lpFilter = new Tone.Filter(5, 'lowpass');
lpFilter.Q.value = 1; // don't need a peak
rectifier.connect(lpFilter);
var lpFilterPostGain = new Tone.Gain();
lpFilter.connect(lpFilterPostGain);
var waveshaper = new Tone.WaveShaper([1, 0, 1]);
lpFilterPostGain.connect(waveshaper);
// Create the bandpass filter in the carrier chain

@@ -139,6 +123,7 @@ var carrierFilter = new Tone.Filter(this.vocoderBands[i].frequency, 'bandpass', -24);

// Create the carrier band gain node
var bandGain = new Tone.Gain(0); // audio-rate inputs are summed with initial intrinsic value
var bandGain = new Tone.Gain(0);
carrierFilterPostGain.connect(bandGain);
waveshaper.connect(bandGain.gain); // connect the lp controller
followerLowPass.connect(bandGain.gain);
bandGain.connect(this.outputGain);

@@ -145,0 +130,0 @@ }

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc