mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 03:28:33 +00:00
proper setup minirepl
This commit is contained in:
parent
5ca7ce1f75
commit
b46330fc7a
@ -1,12 +1,9 @@
|
|||||||
import { evalScope, controls } from '@strudel.cycles/core';
|
import { evalScope, controls } from '@strudel.cycles/core';
|
||||||
import { samples } from '@strudel.cycles/webaudio';
|
import { initAudioOnFirstClick } from '@strudel.cycles/webaudio';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { prebake } from '../repl/prebake';
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
fetch('https://strudel.tidalcycles.org/EmuSP12.json')
|
|
||||||
.then((res) => res.json())
|
|
||||||
.then((json) => samples(json, 'https://strudel.tidalcycles.org/EmuSP12/'));
|
|
||||||
|
|
||||||
evalScope(
|
evalScope(
|
||||||
controls,
|
controls,
|
||||||
import('@strudel.cycles/core'),
|
import('@strudel.cycles/core'),
|
||||||
@ -20,6 +17,11 @@ if (typeof window !== 'undefined') {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
initAudioOnFirstClick();
|
||||||
|
prebake();
|
||||||
|
}
|
||||||
|
|
||||||
export function MiniRepl({ tune }) {
|
export function MiniRepl({ tune }) {
|
||||||
const [Repl, setRepl] = useState();
|
const [Repl, setRepl] = useState();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -1,17 +1,18 @@
|
|||||||
import { Pattern, toMidi, valueToMidi } from '@strudel.cycles/core';
|
import { Pattern, toMidi, valueToMidi } from '@strudel.cycles/core';
|
||||||
import { samples } from '@strudel.cycles/webaudio';
|
import { samples } from '@strudel.cycles/webaudio';
|
||||||
|
|
||||||
export async function prebake({ baseDir = '.' } = {}) {
|
export async function prebake({ baseDir = '' } = {}) {
|
||||||
// https://archive.org/details/SalamanderGrandPianoV3
|
// https://archive.org/details/SalamanderGrandPianoV3
|
||||||
// License: CC-by http://creativecommons.org/licenses/by/3.0/ Author: Alexander Holm
|
// License: CC-by http://creativecommons.org/licenses/by/3.0/ Author: Alexander Holm
|
||||||
return await Promise.all([
|
return await Promise.all([
|
||||||
samples('piano.json', `${baseDir}/piano/`),
|
samples('/piano.json', `${baseDir}/piano/`),
|
||||||
// https://github.com/sgossner/VCSL/
|
// https://github.com/sgossner/VCSL/
|
||||||
// https://api.github.com/repositories/126427031/contents/
|
// https://api.github.com/repositories/126427031/contents/
|
||||||
// LICENSE: CC0 general-purpose
|
// LICENSE: CC0 general-purpose
|
||||||
samples('vcsl.json', 'github:sgossner/VCSL/master/'),
|
samples('/vcsl.json', 'github:sgossner/VCSL/master/'),
|
||||||
samples('tidal-drum-machines.json', 'github:ritchse/tidal-drum-machines/main/machines/'),
|
samples('/tidal-drum-machines.json', 'github:ritchse/tidal-drum-machines/main/machines/'),
|
||||||
samples('EmuSP12.json', `${baseDir}/EmuSP12/`),
|
samples('/EmuSP12.json', `${baseDir}/EmuSP12/`),
|
||||||
|
// samples('github:tidalcycles/Dirt-Samples/master'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user