Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`delay basics 1`] = `
Float32Array [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`event propagation 1`] = `
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`maxhold basics 1`] = `
Float32Array [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`mc capture 1`] = `
[
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`child limit 1`] = `
Float32Array [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`sampleseq basics 1`] = `
Float32Array [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`sparseq basics 1`] = `
Float32Array [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`sparseq2 basics 1`] = `
Float32Array [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`feedback taps 1`] = `
Float32Array [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`time node 1`] = `
Float32Array [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`vfs sample 1`] = `
Float32Array [
Expand Down
15 changes: 7 additions & 8 deletions js/packages/offline-renderer/__tests__/events.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import OfflineRenderer from '..';
import { el } from '@elemaudio/core';
import OfflineRenderer from "..";
import { el } from "@elemaudio/core";


test('event propagation', async function() {
test("event propagation", async function () {
let core = new OfflineRenderer();

await core.initialize({
Expand All @@ -12,8 +11,8 @@ test('event propagation', async function() {
});

// Event handling
let callback = jest.fn();
core.on('meter', callback);
let callback = vi.fn();
core.on("meter", callback);

// Graph
core.render(el.meter({}, 0));
Expand All @@ -28,7 +27,7 @@ test('event propagation', async function() {
// node to fire on each block, thus we should see 4 calls to the meter
// callback
expect(callback.mock.calls).toHaveLength(4);
expect(callback.mock.calls.map(x => x[0])).toMatchSnapshot();
expect(callback.mock.calls.map((x) => x[0])).toMatchSnapshot();

callback.mockClear();

Expand All @@ -41,5 +40,5 @@ test('event propagation', async function() {
// We just pushed four more blocks of data, we would expect the same
// as above but this time the meter should be reporting the new value 1
expect(callback.mock.calls).toHaveLength(4);
expect(callback.mock.calls.map(x => x[0])).toMatchSnapshot();
expect(callback.mock.calls.map((x) => x[0])).toMatchSnapshot();
});
2 changes: 1 addition & 1 deletion js/packages/offline-renderer/__tests__/mc.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ test("mc capture", async function () {
core.process(inps, outs);
}

let eventCallback = jest.fn();
let eventCallback = vi.fn();
core.on("mc.capture", eventCallback);

setGateProps({ value: 1 });
Expand Down
38 changes: 18 additions & 20 deletions js/packages/offline-renderer/__tests__/tap.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import OfflineRenderer from '..';
import { el } from '@elemaudio/core';
import OfflineRenderer from "..";
import { el } from "@elemaudio/core";


test('feedback taps', async function() {
test("feedback taps", async function () {
let core = new OfflineRenderer();

await core.initialize({
Expand All @@ -12,10 +11,10 @@ test('feedback taps', async function() {

// Graph
core.render(
el.tapOut({name: 'test'}, el.add(
el.tapIn({name: 'test'}),
el.in({channel: 0}),
)),
el.tapOut(
{ name: "test" },
el.add(el.tapIn({ name: "test" }), el.in({ channel: 0 })),
),
);

// Ten blocks of data
Expand Down Expand Up @@ -49,7 +48,7 @@ test('feedback taps', async function() {
expect(outs[0]).toMatchSnapshot();
});

test('idle feedback taps', async function() {
test("idle feedback taps", async function () {
let core = new OfflineRenderer();

await core.initialize({
Expand All @@ -59,15 +58,15 @@ test('idle feedback taps', async function() {
});

// Event handling
let callback = jest.fn();
core.on('meter', callback);
let callback = vi.fn();
core.on("meter", callback);

// Graph
core.render(
el.tapOut({name: 'test'}, el.add(
el.meter({}, el.tapIn({name: 'test'})),
1,
)),
el.tapOut(
{ name: "test" },
el.add(el.meter({}, el.tapIn({ name: "test" })), 1),
),
);

// Render four blocks
Expand All @@ -78,17 +77,16 @@ test('idle feedback taps', async function() {
expect(callback.mock.calls).toMatchSnapshot();
callback.mockClear();


// Render a new graph and we should see the feedback
// path begin winding down. This demonstrates that only
// the updated graph is feeding into the `test` feedback
// path, not the nodes from the deactivated roots that
// will become idle after the root node fade
core.render(
el.tapOut({name: 'test'}, el.add(
el.meter({}, el.tapIn({name: 'test'})),
-1,
)),
el.tapOut(
{ name: "test" },
el.add(el.meter({}, el.tapIn({ name: "test" })), -1),
),
);

// Render four blocks
Expand Down
6 changes: 0 additions & 6 deletions js/packages/offline-renderer/babel.config.cjs

This file was deleted.

2 changes: 2 additions & 0 deletions js/packages/offline-renderer/elementary-wasm.js

Large diffs are not rendered by default.

Binary file not shown.
4 changes: 1 addition & 3 deletions js/packages/offline-renderer/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import invariant from "invariant";

import { EventEmitter, Renderer } from "@elemaudio/core";

// NEEDS WASM_ASYNC COMPILATION FLAG IN THE WASM BUILD SCRIPT
import Module from "./elementary-wasm.cjs";
import Module from "./elementary-wasm";

export default class OfflineRenderer extends EventEmitter {
private _module: any;
Expand Down
Loading