From 1de371e9443638d1e963e966bdec750d3e2de17b Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sun, 20 Feb 2022 20:31:00 +0100 Subject: [PATCH] replace m with cat in tunes --- repl/src/tunes.ts | 97 +++----------------------------------------- repl/src/useCycle.ts | 1 - 2 files changed, 6 insertions(+), 92 deletions(-) diff --git a/repl/src/tunes.ts b/repl/src/tunes.ts index 93a21479..d4a50bb9 100644 --- a/repl/src/tunes.ts +++ b/repl/src/tunes.ts @@ -5,11 +5,11 @@ export const timeCatMini = `stack( )`; export const timeCat = `stack( - timeCat([3, c3], [1, stack(eb3, g3, m(c4, d4).slow(2))]), - m(c2, g2), + timeCat([3, c3], [1, stack(eb3, g3, cat(c4, d4).slow(2))]), + cat(c2, g2), sequence( - timeCat([5, eb4], [3, m(f4, eb4, d4)]), - m(eb4, c4).slow(2) + timeCat([5, eb4], [3, cat(f4, eb4, d4)]), + cat(eb4, c4).slow(2) ).slow(4) )`; @@ -178,11 +178,11 @@ export const spanish = `slowcat( stack(g3,b3,d4) )`; -export const whirlyStrudel = `mini("[e4 [b2 b3] c4]") +export const whirlyStrudel = `sequence(e4, [b2, b3], c4) .every(4, fast(2)) .every(3, slow(1.5)) .fast(slowcat(1.25, 1, 1.5)) -.every(2, _ => mini("e4 ~ e3 d4 ~"))`; +.every(2, _ => sequence(e4, r, e3, d4, r))`; export const swimming = `stack( mini( @@ -296,13 +296,6 @@ export const giantStepsReggae = `stack( .groove('x ~'.m.fast(4*8)) ).slow(25)`; -/* export const transposedChords = `stack( - m('c2 eb2 g2'), - m('Cm7').voicings(['g2','c4']).slow(2) -).transpose( - slowcat(1, 2, 3, 2).slow(2) -).transpose(5)`; */ - export const transposedChordsHacked = `stack( 'c2 eb2 g2'.mini, 'Cm7'.pure.voicings(['g2','c4']).slow(2) @@ -315,27 +308,12 @@ export const scaleTranspose = `stack(f2, f3, c4, ab4) .scaleTranspose(sequence(0, -1, -2, -3).slow(4)) .transpose(sequence(0, 1).slow(16))`; -/* export const groove = `stack( - m('c2 g2 a2 [e2@2 eb2] d2 a2 g2 [d2 ~ db2]'), - m('[C^7 A7] [Dm7 G7]') - .groove(m('[x@2 x] [~@2 x] [~ x@2]@2 [x ~@2] ~ [~@2 x@4]@2')) - .voicings(['G3','A4']) -).slow(4.5)`; */ - export const groove = `stack( 'c2 g2 a2 [e2@2 eb2] d2 a2 g2 [d2 ~ db2]'.mini, '[C^7 A7] [Dm7 G7]'.mini.groove('[x@2 x] [~@2 x] [~ x@2]@2 [x ~@2] ~ [~@2 x@4]@2'.mini) .voicings(['G3','A4']) ).slow(4)`; -/* export const magicSofa = `stack( - m('[C^7 F^7 ~]/3 [Dm7 G7 A7 ~]/4') - .every(2, fast(2)) - .voicings(), - m('[c2 f2 g2]/3 [d2 g2 a2 e2]/4') -).slow(1) - .transpose.slowcat(0, 2, 3, 4)`; */ - export const magicSofa = `stack( ' '.m .every(2, fast(2)) @@ -462,66 +440,3 @@ export const caverave = `() => { synths ).slow(2); }`; - -export const caveravefuture = `() => { - const delay = new FeedbackDelay(1/8, .4).chain(vol(0.5), out); - const kick = new MembraneSynth().chain(vol(.8), out); - const snare = new NoiseSynth().chain(vol(.8), out); - const hihat = new MetalSynth().set(adsr(0, .08, 0, .1)).chain(vol(.3).connect(delay),out); - const bass = new Synth().set({ ...osc('sawtooth'), ...adsr(0, .1, .4) }).chain(lowpass(900), vol(.5), out); - const keys = new PolySynth().set({ ...osc('sawtooth'), ...adsr(0, .5, .2, .7) }).chain(lowpass(1200), vol(.5), out); - - const drums = stack( - \`c1*2\`.tone(kick).bypass(\`<0@7 1>/8\`), - \`~ \`.tone(snare).bypass(\`<0@7 1>/4\`), - \`[~ c4]*2\`.tone(hihat) - ); - - const thru = (x) => x.transpose(\`<0 1>/8\`).transpose(-1); - const synths = stack( - \`/2\`.scale(timeCat([3,'C minor'],[1,'C melodic minor']).slow(8)).groove(\`[~ x]*2\`) - .edit( - scaleTranspose(0).early(0), - scaleTranspose(2).early(1/8), - scaleTranspose(7).early(1/4), - scaleTranspose(8).early(3/8) - ).edit(thru).tone(keys).bypass(\`<1 0>/16\`), - \`/2\`.groove(\`x [~ x] <[~ [~ x]]!3 [x x]>@2\`).edit(thru).tone(bass), - \`/2\`.groove(\`~ [x@0.5 ~]\`.fast(2)).voicings().edit(thru).every(2, early(1/8)).tone(keys).bypass(\`<0@7 1>/8\`.early(1/4)), - ) - return stack( - drums.fast(2), - synths - ).slow(2); -}`; - -export const caveravefuture2 = `const delay = new FeedbackDelay(1/8, .4).chain(vol(0.5), out); -const kick = new MembraneSynth().chain(vol(.8), out); -const snare = new NoiseSynth().chain(vol(.8), out); -const hihat = new MetalSynth().set(adsr(0, .08, 0, .1)).chain(vol(.3).connect(delay),out); -const bass = new Synth().set({ ...osc('sawtooth'), ...adsr(0, .1, .4) }).chain(lowpass(900), vol(.5), out); -const keys = new PolySynth().set({ ...osc('sawtooth'), ...adsr(0, .5, .2, .7) }).chain(lowpass(1200), vol(.5), out); - -const drums = stack( - "c1*2".tone(kick).bypass("<0@7 1>/8"), - "~ ".tone(snare).bypass("<0@7 1>/4"), - "[~ c4]*2".tone(hihat) -); - -const thru = (x) => x.transpose("<0 1>/8").transpose(-1); -const synths = stack( - "/2".scale(timeCat([3, 'C minor'], [1, 'C melodic minor']).slow(8)).groove("[~ x]*2") - .edit( - scaleTranspose(0).early(0), - scaleTranspose(2).early(1/8), - scaleTranspose(7).early(1/4), - scaleTranspose(8).early(3/8) - ).edit(thru).tone(keys).bypass("<1 0>/16"), - "/2".groove("x [~ x] <[~ [~ x]]!3 [x x]>@2").edit(thru).tone(bass), - "/2".groove("~ [x@0.5 ~]".fast(2)).voicings().edit(thru).every(2, early(1/8)).tone(keys).bypass("<0@7 1>/8".early(1/4)), -) -$: stack( - drums.fast(2), - synths -).slow(2); -`; diff --git a/repl/src/useCycle.ts b/repl/src/useCycle.ts index 15dc3dbd..bce7a8da 100644 --- a/repl/src/useCycle.ts +++ b/repl/src/useCycle.ts @@ -3,7 +3,6 @@ import type { ToneEventCallback } from 'tone'; import * as Tone from 'tone'; import { TimeSpan } from '../../strudel.mjs'; import type { Hap } from './types'; -import usePostMessage from './usePostMessage'; export declare interface UseCycleProps { onEvent: ToneEventCallback;