forked from tidalcycles/strudel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'patternuary' of https://github.com/edcrub/strudel into …
…patternuary
- Loading branch information
Showing
156 changed files
with
3,628 additions
and
1,522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ paper | |
pnpm-lock.yaml | ||
pnpm-workspace.yaml | ||
**/dev-dist | ||
website/.astro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
/> | ||
<div id="output"></div> | ||
<script type="module"> | ||
const strudel = await import('https://cdn.skypack.dev/@strudel.cycles/[email protected]'); | ||
const strudel = await import('https://cdn.skypack.dev/@strudel/[email protected]'); | ||
Object.assign(window, strudel); // assign all strudel functions to global scope to use with eval | ||
const input = document.getElementById('text'); | ||
const getEvents = () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
/> | ||
<canvas id="canvas"></canvas> | ||
<script type="module"> | ||
const strudel = await import('https://cdn.skypack.dev/@strudel.cycles/[email protected]'); | ||
const strudel = await import('https://cdn.skypack.dev/@strudel/[email protected]'); | ||
// this adds all strudel functions to the global scope, to be used by eval | ||
Object.assign(window, strudel); | ||
// setup elements | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,34 +16,40 @@ | |
</div> | ||
<div id="output"></div> | ||
<script type="module"> | ||
import { controls, repl, evalScope } from 'https://cdn.skypack.dev/@strudel.cycles/core@0.6.8'; | ||
import { mini } from 'https://cdn.skypack.dev/@strudel.cycles/mini@0.6.0'; | ||
import { transpiler } from 'https://cdn.skypack.dev/@strudel.cycles/transpiler@0.6.0'; | ||
import { controls, repl, evalScope } from 'https://cdn.skypack.dev/@strudel/core@0.11.0'; | ||
import { mini } from 'https://cdn.skypack.dev/@strudel/mini@0.11.0'; | ||
import { transpiler } from 'https://cdn.skypack.dev/@strudel/transpiler@0.11.0'; | ||
import { | ||
getAudioContext, | ||
webaudioOutput, | ||
initAudioOnFirstClick, | ||
} from 'https://cdn.skypack.dev/@strudel.cycles/[email protected]'; | ||
registerSynthSounds, | ||
} from 'https://cdn.skypack.dev/@strudel/[email protected]'; | ||
|
||
initAudioOnFirstClick(); | ||
const ctx = getAudioContext(); | ||
const input = document.getElementById('text'); | ||
input.innerHTML = getTune(); | ||
|
||
evalScope( | ||
const loadModules = evalScope( | ||
controls, | ||
import('https://cdn.skypack.dev/@strudel.cycles/core@0.6.8'), | ||
import('https://cdn.skypack.dev/@strudel.cycles/mini@0.6.0'), | ||
import('https://cdn.skypack.dev/@strudel.cycles/tonal@0.6.0'), | ||
import('https://cdn.skypack.dev/@strudel.cycles/webaudio@0.6.0'), | ||
import('https://cdn.skypack.dev/@strudel/core@0.11.0'), | ||
import('https://cdn.skypack.dev/@strudel/mini@0.11.0'), | ||
import('https://cdn.skypack.dev/@strudel/tonal@0.11.0'), | ||
import('https://cdn.skypack.dev/@strudel/webaudio@0.11.0'), | ||
); | ||
|
||
const initAudio = Promise.all([initAudioOnFirstClick(), registerSynthSounds()]); | ||
|
||
const { evaluate } = repl({ | ||
defaultOutput: webaudioOutput, | ||
getTime: () => ctx.currentTime, | ||
transpiler, | ||
}); | ||
document.getElementById('start').addEventListener('click', () => evaluate(input.value)); | ||
document.getElementById('start').addEventListener('click', async () => { | ||
await loadModules; | ||
await initAudio; | ||
evaluate(input.value); | ||
}); | ||
|
||
function getTune() { | ||
return `await samples('github:tidalcycles/Dirt-Samples/master') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Packages | ||
|
||
Each folder represents one of the @strudel.cycles/* packages [published to npm](https://www.npmjs.com/org/strudel.cycles). | ||
Each folder represents one of the @strudel/* packages [published to npm](https://www.npmjs.com/org/strudel). | ||
|
||
To understand how those pieces connect, refer to the [Technical Manual](https://github.com/tidalcycles/strudel/wiki/Technical-Manual) or the individual READMEs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.