Skip to content

Update to Superpowered v2.7.2 #45

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

Merged
merged 1 commit into from
Nov 7, 2024
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Superpowered Inc develops the Superpowered Web Audio JavaScript and WebAssembly

Developers can use Superpowered interactive audio features in JavaScript without the need of building, initializing or even touching WebAssembly or C++.

For the most up-to-date information, see: https://superpowered.com/js-wasm-overview
For the most up-to-date information, see: https://docs.superpowered.com/?lang=js


# JavaScript + WebAssembly
Expand All @@ -31,7 +31,7 @@ See usage guide over at https://docs.superpowered.com/getting-started/how-to-int
- Time domain to frequency domain, frequency domain to time domain
- Time Stretching, Pitch Shifting
- FFT: complex, real, real-polar
- Web Audio I/O, support for ScriptProcessorNode, Workers, Worklets and Audio Worklet
- Web Audio I/O, support for Workers, Worklets and Audio Worklet


# Demos
Expand Down
1,042 changes: 454 additions & 588 deletions dist/Superpowered.js

Large diffs are not rendered by default.

Binary file modified dist/superpowered-npm.wasm
Binary file not shown.
Binary file modified dist/superpowered.wasm
Binary file not shown.
1,042 changes: 454 additions & 588 deletions examples/example_effects/Superpowered.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/example_effects/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './Superpowered.js';
import { SuperpoweredGlue, SuperpoweredWebAudio } from './Superpowered.js';

const states = { NOTRUNNING: 'START', INITIALIZING: 'INITIALIZING', RUNNING: 'STOP' }

Expand Down
2 changes: 1 addition & 1 deletion examples/example_effects/processor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './Superpowered.js';
import { SuperpoweredWebAudio } from './Superpowered.js';

function calculateFrequency(value, minFreq, maxFreq) {
if (value > 0.97) return maxFreq;
Expand Down
1,042 changes: 454 additions & 588 deletions examples/example_guitardistortion/Superpowered.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/example_guitardistortion/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './Superpowered.js';
import { SuperpoweredGlue, SuperpoweredWebAudio } from './Superpowered.js';

var webaudioManager = null; // The SuperpoweredWebAudio helper class managing Web Audio for us.
var Superpowered = null; // Reference to the Superpowered module.
Expand Down
2 changes: 1 addition & 1 deletion examples/example_guitardistortion/processor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './superpowered.min.js';
import { SuperpoweredWebAudio } from './Superpowered.js';

class MyProcessor extends SuperpoweredWebAudio.AudioWorkletProcessor {
// runs after the constructor
Expand Down
2 changes: 1 addition & 1 deletion examples/example_guitardistortion/processor_live.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './Superpowered.js';
import { SuperpoweredWebAudio } from './Superpowered.js';

class MyProcessor extends SuperpoweredWebAudio.AudioWorkletProcessor {
// runs after the constructor
Expand Down
1,042 changes: 454 additions & 588 deletions examples/example_pitchbend/Superpowered.js

Large diffs are not rendered by default.

869 changes: 0 additions & 869 deletions examples/example_pitchbend/assets/Superpowered.js

This file was deleted.

2 changes: 1 addition & 1 deletion examples/example_pitchbend/assets/processor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "./Superpowered.js";
import { SuperpoweredWebAudio } from './../Superpowered.js';

class MyProcessor extends SuperpoweredWebAudio.AudioWorkletProcessor {
cancelledPitchBend = true;
Expand Down
Binary file not shown.
6 changes: 3 additions & 3 deletions examples/example_pitchbend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<head>
<title>Superpowered WebAssembly Audio Player Time Stretching and Pitch Shifting Example</title>
<script type="module" src="./polyfill_worklet_import.js"></script>
<link href="/style.css" rel="stylesheet" />
<link href="./style.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<img class="logo" src="/assets/superpowered.svg" />
<img class="logo" src="./assets/superpowered.svg" />
<div class="controls">
<h2>AAP pitch/speed controls</h2>
<p>A demonstration of pitch bend, pitch shift and playback rate changes with the Advanced Audio Player class</p>
<div id="content">Initializing...</div>
</div>
</div>

<script src="main.js" type="module"></script>
<script src="./main.js" type="module"></script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/example_pitchbend/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import "./assets/Superpowered.js";
import { SuperpoweredGlue, SuperpoweredWebAudio } from './Superpowered.js';

var webaudioManager = null; // The SuperpoweredWebAudio helper class managing Web Audio for us.
var Superpowered = null; // A Superpowered instance.
Expand Down Expand Up @@ -135,7 +135,7 @@ function requestPitchBendDetails() {
async function start() {
webaudioManager = new SuperpoweredWebAudio(44100, Superpowered);
currentPath = window.location.href.substring(0, window.location.href.lastIndexOf('/'));
audioNode = await webaudioManager.createAudioNodeAsync(window.location.href + '/assets/processor.js?date=' + Date.now(), 'MyProcessor', onMessageFromAudioScope);
audioNode = await webaudioManager.createAudioNodeAsync(window.location.href + 'assets/processor.js?date=' + Date.now(), 'MyProcessor', onMessageFromAudioScope);
// audioNode -> audioContext.destination (audio output)
webaudioManager.audioContext.suspend();
audioNode.connect(webaudioManager.audioContext.destination);
Expand All @@ -144,12 +144,12 @@ async function start() {
requestAnimationFrame(requestPitchBendDetails)
}

async function loadFromMainThread() {
async function loadFromMainThread() {
Superpowered.downloadAndDecode(window.location.href + '/assets/track.mp3', audioNode);
}

async function loadJS() {
Superpowered = await SuperpoweredGlue.Instantiate('ExampleLicenseKey-WillExpire-OnNextUpdate', `${window.location.href}/assets/superpowered-npm.wasm`);
Superpowered = await SuperpoweredGlue.Instantiate('ExampleLicenseKey-WillExpire-OnNextUpdate');

// display the START button
content = document.getElementById('content');
Expand Down
2 changes: 1 addition & 1 deletion examples/example_pitchbend/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ body {
justify-content: center;
text-align: center;
height: 100vh;
background-image: url(/assets/wave.svg);
background-image: url('./assets/wave.svg');
background-size: cover;
overflow-y: auto;
margin: 0;
Expand Down
Loading