add example tune

This commit is contained in:
Felix Roos
2023-04-05 23:48:14 +02:00
parent d3c4fd70dc
commit c90bc80e6d
4 changed files with 31 additions and 6 deletions
-1
View File
@@ -4,7 +4,6 @@ import { atomOneDark } from 'react-syntax-highlighter/dist/esm/styles/hljs';
Object.assign(atomOneDark.hljs, { padding: '10px' });
function Highlight({ code, language }) {
console.log('atomOneDark', atomOneDark);
return (
<div className="mb-4 text-[32px] leading-10">
<SyntaxHighlighter language={language} style={atomOneDark}>
+2 -2
View File
@@ -20,7 +20,7 @@ if (typeof window !== 'undefined') {
prebake();
}
export function SlideRepl({ tune, drawTime, punchcard, canvasHeight = 100, hideHeader = false }) {
export function SlideRepl({ tune, drawTime, punchcard, canvasHeight = 100, hideHeader = false, fontSize = 32 }) {
// const { theme } = useSettings();
return (
<div className="mb-4">
@@ -31,7 +31,7 @@ export function SlideRepl({ tune, drawTime, punchcard, canvasHeight = 100, hideH
drawTime={drawTime}
punchcard={punchcard}
canvasHeight={canvasHeight}
fontSize={32}
fontSize={fontSize}
theme={atomone}
// theme={themes[theme]}
/>
-3
View File
@@ -1,5 +1,2 @@
import { SlideRepl } from '../SlideRepl.jsx';
# Strudel
<SlideRepl tune={'note("c a f e")'} punchcard />
+29
View File
@@ -1,6 +1,35 @@
import { SlideRepl } from '../SlideRepl.jsx';
# What is Strudel
- a port of Tidal Cycles to JavaScript
- a browser based editor for zero-install live coding: [strudel.tidalcycles.org](https://strudel.tidalcycles.org)
- multiple outputs: Web Audio, OSC, MIDI, ...
- "Strudel" = internationally known as delicious pastry, but also "swirl" / "whirlpool" in german (a tidal can cause a whirlpool!)
- free & open source, hackable, sharable, embeddable:
<SlideRepl
hideHeader
fontSize={24}
tune={`// froos - freakuency - 2023/03/29
setcps(.5)
//
await samples('https://shabda.ndre.gr/speech/frequency,freaky.json?strudel=1')
//
stack(
stack(
s("bd, ~ <rim cp>,~ hh*2").off(1/8, x=>x.speed(2).gain(.5)).fast(2),
s("oh*6").end(.01).speed(.5).room(.5).fast("1 2")
).bank('RolandTR909'),
//
note("[c a f e](<3 5>,8,<0 1>)".add("0,.1").sub(24)).s('sawtooth').lpf(500),
//
"[~ <Cm7 Fm7 Bb7 Db7>]*2".voicings('lefthand').note().legato(.2)
.echoWith(6, .1, (p,n)=>p.add(note(n*.6)))
.lpf(sine.range(300,1000).slow(8)).lpq(6)
.add(note(perlin.range(0,.8))).s('gm_epiano2')
.mask("<0 1>")
).restart("<1@3 1*[4 [8 16]]>")
.stack(s("<~ [[~@2.4 freaky] frequency]>/2").delay(.8)
.echoWith(4,-.0125,(p,n)=>p.speed(1-n*.1).gain(n*.2)))`}
/>