mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-24 12:08:28 +00:00
dont create defaultSynth on start
This commit is contained in:
parent
b20467d6e3
commit
fd28cfc4f8
@ -30,13 +30,16 @@ import { getPlayableNoteValue } from '@strudel.cycles/core/util.mjs';
|
|||||||
|
|
||||||
// "balanced" | "interactive" | "playback";
|
// "balanced" | "interactive" | "playback";
|
||||||
// Tone.setContext(new Tone.Context({ latencyHint: 'playback', lookAhead: 1 }));
|
// Tone.setContext(new Tone.Context({ latencyHint: 'playback', lookAhead: 1 }));
|
||||||
export const defaultSynth = new PolySynth().chain(new Gain(0.5), getDestination());
|
export const getDefaultSynth = () => {
|
||||||
defaultSynth.set({
|
const s = new PolySynth().chain(new Gain(0.5), getDestination());
|
||||||
oscillator: { type: 'triangle' },
|
s.set({
|
||||||
envelope: {
|
oscillator: { type: 'triangle' },
|
||||||
release: 0.01,
|
envelope: {
|
||||||
},
|
release: 0.01,
|
||||||
});
|
},
|
||||||
|
});
|
||||||
|
return s;
|
||||||
|
};
|
||||||
|
|
||||||
// what about
|
// what about
|
||||||
// https://www.charlie-roberts.com/gibberish/playground/
|
// https://www.charlie-roberts.com/gibberish/playground/
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import CodeMirror, { markEvent, markParens } from './CodeMirror';
|
|||||||
import cx from './cx';
|
import cx from './cx';
|
||||||
import logo from './logo.svg';
|
import logo from './logo.svg';
|
||||||
import playStatic from './static.mjs';
|
import playStatic from './static.mjs';
|
||||||
import { defaultSynth } from '@strudel.cycles/tone';
|
import { getDefaultSynth } from '@strudel.cycles/tone';
|
||||||
import * as tunes from './tunes.mjs';
|
import * as tunes from './tunes.mjs';
|
||||||
import useRepl from './useRepl.mjs';
|
import useRepl from './useRepl.mjs';
|
||||||
import { useWebMidi } from './useWebMidi';
|
import { useWebMidi } from './useWebMidi';
|
||||||
@ -31,12 +31,22 @@ import '@strudel.cycles/tone/draw.mjs';
|
|||||||
import '@strudel.cycles/osc/osc.mjs';
|
import '@strudel.cycles/osc/osc.mjs';
|
||||||
import controls from '@strudel.cycles/core/controls.mjs';
|
import controls from '@strudel.cycles/core/controls.mjs';
|
||||||
|
|
||||||
extend(Tone, strudel, strudel.Pattern.prototype.bootstrap(), controls, toneHelpers, voicingHelpers, drawHelpers, uiHelpers, {
|
extend(
|
||||||
gist,
|
|
||||||
euclid,
|
|
||||||
mini,
|
|
||||||
Tone,
|
Tone,
|
||||||
});
|
strudel,
|
||||||
|
strudel.Pattern.prototype.bootstrap(),
|
||||||
|
controls,
|
||||||
|
toneHelpers,
|
||||||
|
voicingHelpers,
|
||||||
|
drawHelpers,
|
||||||
|
uiHelpers,
|
||||||
|
{
|
||||||
|
gist,
|
||||||
|
euclid,
|
||||||
|
mini,
|
||||||
|
Tone,
|
||||||
|
},
|
||||||
|
);
|
||||||
// eval stuff end
|
// eval stuff end
|
||||||
|
|
||||||
const codeParam = window.location.href.split('#')[1];
|
const codeParam = window.location.href.split('#')[1];
|
||||||
@ -54,6 +64,7 @@ function getRandomTune() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const randomTune = getRandomTune();
|
const randomTune = getRandomTune();
|
||||||
|
const defaultSynth = getDefaultSynth();
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [editor, setEditor] = useState();
|
const [editor, setEditor] = useState();
|
||||||
|
|||||||
@ -2,7 +2,9 @@ import { Tone } from '@strudel.cycles/tone';
|
|||||||
import { State, TimeSpan } from '@strudel.cycles/core';
|
import { State, TimeSpan } from '@strudel.cycles/core';
|
||||||
import { getPlayableNoteValue } from '@strudel.cycles/core/util.mjs';
|
import { getPlayableNoteValue } from '@strudel.cycles/core/util.mjs';
|
||||||
import { evaluate } from '@strudel.cycles/eval';
|
import { evaluate } from '@strudel.cycles/eval';
|
||||||
import { defaultSynth } from '@strudel.cycles/tone';
|
import { getDefaultSynth } from '@strudel.cycles/tone';
|
||||||
|
|
||||||
|
const defaultSynth = getDefaultSynth();
|
||||||
|
|
||||||
// this is a test to play back events with as less runtime code as possible..
|
// this is a test to play back events with as less runtime code as possible..
|
||||||
// the code asks for the number of seconds to prequery
|
// the code asks for the number of seconds to prequery
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user