Skip to content

Instantly share code, notes, and snippets.

@tedthetrumpet
Last active February 4, 2023 13:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tedthetrumpet/0410ae1cd2ad0a2837a36aca94e5b5ea to your computer and use it in GitHub Desktop.
Code and links for JSvdW 'patternuary' January 2023
//////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-01
// thanks to froos for 'run' :)
await samples('github:tidalcycles/Dirt-Samples/master/');
const run = (n) => saw.range(0,n).floor().segment(n)
n(run("<6 12>")).s("brakedrum").slow(2).gain(2).sometimes(x=>x.ply(2)).speed(0.5)
https://strudel.tidalcycles.org?Tdhv3pfdx6bc
//////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-02
// listen to this long enough you'll start to believe its a melody :)
s("sine*<2 3 9 2 3 4 7 8>")
.note("60 74 19 92 87 34 76".iter(3))
.crush(perlin.range(4,9).fast(8))
https://strudel.tidalcycles.org?F546CH7SRWrF
//////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-03
// just a quartal drone: many things I do not understand
stack(
note("bb eb4 ab4 db5 gb5".iter(2).every(2, x =>x.rev()))
.s("sine")
.legato(2)
.decay(0.5).attack(0.2)
.room(0.7).size(2)
.delay("1 | 2 | 3 | 5 ".div(2))
,
note("[bb2, bb1]").s("sawtooth").attack(1).decay(1).legato(2).slow(4)
)
https://strudel.tidalcycles.org?XDGez1rQI6sc
//////////////////////////////////////////////////////////////////////
// patternuary 2023-01-03b
// bonus estuary pattern today in preparation
// for concert 'in' Indonesia on Thursday
// this one is MiniTidal in Estuary, not strudel!
mask "< 1 0 0 1 1 0 0 1 >*16" $ stack[
rarely (hurry "0.5 2") $ n "0 3*2 2 <5 6> " # s "sdemung" # gain 0.85
, sometimes (rev . (ply "2 4")) $ n "0 3 2 5 " # s "sdemung" # gain 0.85 # speed 1.01 # pan rand
]
https://diode.zone/w/rGCkerVsidfNzQG7eMYefr
//////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-04
// drones all the way down
note("d1!2").s("saxello")
.slow("< 3 4 5>")
.legato(1).attack(0.5).decay(0.5)
.add(note("7,14,21,-5"))
.pan("0.2,0.4,0.6,0.8")
.gain(0.4)
.room(0.9).size(4)
.hcutoff(tri.rangex(100,2000).slow(8)).resonance(0.9)
https://strudel.tidalcycles.org?yH2ZrLdbB5TV
//////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-05
// not got my gamelan samples working here yet
// but here's an approximation
// also still need to figure out how to do
// random cycles instead of random-forever
stack(
note("eb bb!2".add("-12")).struct("x(3,8)")
.s("vibraphone_soft").slow(2).gain(1)
,
irand(8).struct("x!8").n().slow(2).s("cajon")
.every("2/8", x=>x.ply("1 2")).gain(0.4)
,
irand(8).struct("x(3,4)".iter(4))
.scale('bb pelog').note().s("xylophone_medium_ff").gain(0.6)
).room(0.7).size(0.8)
https://strudel.tidalcycles.org?CLIdO8DHduoc
//////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-06
// not quite sounding as phat as I would like
// but this is ok :)
await samples('github:tidalcycles/Dirt-Samples/master/');
stack(
irand(8).restart("t".slow(2)).struct("x(5,8)").n().slow(2).s("dr_few")
.every(8, x=>x.fast(2)).pan(rand.range(0.4,0.6))
.late(4/8).gain(1.1)
.color("red")
,
note("a1!4 <c2 g1> ~ <d2 e1> ~".iter(4)).slow(2).speed("1,0.5")
.s("sawtooth")
.decay(0.1).attack(0.001)
.gain(0.9).hcutoff("{2 3 4}%8".mul(50))
.color("green")
).fast(1.2).room(0.6).size(2)
.pianoroll({fold:1})
https://strudel.tidalcycles.org?chxwiHdU6_Un
https://diode.zone/w/ocNZjYtoL54a1rcymwH2Gg
//////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-07
// proof of concept, and probably not quite as intended
// but intriguing
await samples('github:tedthetrumpet/testpage/master/strudelsamples/');
n(irand(8).restart("t".slow(2)))
.struct("x(<3 5 2>,8,<0 1>)")
.s("barung")
.note(irand(8).add(30).restart("t".slow(4)).superimpose(x=>x.sub("0 | 2 4 7")))
.when("<0!7 1>/4", x=>x.gain(0))
https://strudel.tidalcycles.org?Ai9g80h300do
//////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-08
// now have my favourite 'Spirit of Hope' demung sounds :)
// nice energetic 7/8 riff
// but still not sure how some of this works
await samples('github:tedthetrumpet/testpage/master/strudelsamples/');
const run = (n) => saw.range(0,n).floor().segment(n)
n(run(7).slow(2).chunk("<2!3 1>", x=>x.rev()))
.every(16, x=>x.add(2)) // is this doing anything? what is 'x' in this context? 'n'??
.s("demung")
.superimpose(x=>x.vowel("{o i a u q}%7"))
.when("1 0!3", x=>x.note("c2,c1"))
https://strudel.tidalcycles.org/?x0wW999KcEC8
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-09
// simple beat: misusing vowel filter on bd sound to make a percussion track
// not sure why the drum break every 4 seems to come out different each time?!
stack(
s("bd!8").vowel("[a | e | i | o | x]*8".restart("t".slow(2)))
.speed("0.5,1").late(6/8).room(0.4).size(2)
,
s("bd!2, ~ cp").gain(0.45).every(4, x=>x.fast("4 2").iter(8))
)
https://strudel.tidalcycles.org?amByogT9Sm1Q
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-10
// finding strudel syntax harder to grasp than tidal
// this is not really how I wanted this to sound :(
await samples('github:tedthetrumpet/testpage/master/strudelsamples/');
stack(
n(irand(19).segment(16).restart("t"))
.s("kendhang").gain(0.3)
.late(15/16).color("red")
,
note((irand(16).segment(16).restart("t")).scale('D1 dorian'))
.s("psaltery_pluck")
.gain(2)
.juxBy(0.5, x=>x.room(1).orbit(1))
//.gain(0)
.early(1/16)
.cut(1).color("green")
,
"d!8 g!4 f!4".superimpose(x=>x.sub("12,24"))
.ply(2)
.slow(2).late(7/16).note().attack(0.001).decay(0.2).sustain(0.2)
.s("square").gain(0.35).colour("teal")
,
s("bd:4 sd:1, hh*4").fast(4)
.gain(0.45).color("blue")
)
.slow(3.5)
.pianoroll({fold:1})
https://strudel.tidalcycles.org?MhHEnYwgq479
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-11
// inspired by yaxu https://strudel.tidalcycles.org/?ruqdsxA6Qbb-
// but went in a different direction with the drone :)
var a = s("AkaiLinn_bd@2 [AkaiMPC60_hh <AkaiLinn_cb XdrumLM8953_rim>] ViscoSpaceDrum_perc")
.superimpose(x=>x.off(1/2, x=>x.cutoff("[1 | 2 | 3 | 4]*8").mul(500).resonance(20)))
.iter("<4 2>/2")
.speed("1,0.5")
var b = s("harmonica_vib").note("c1,c2,g2".add(2)).gain(0.8)
.superimpose(x=>x.cutoff(perlin.range(200,4000).segment(16).slow(5)).resonance(20))
.juxBy(0.5, rev)
.gain(0.5)
stack(a.colour("orange"),b.colour("orchid")).pianoroll({fold:1, vertical:1})
https://strudel.tidalcycles.org?kqs1gajKi8r2
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-12
// 11/8 exploration of Jill Linz's 'Atom Tones', with thanks!
// https://academics.skidmore.edu/blogs/jlinz/atom-tones/
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
const run = (n) => saw.range(0,n).floor().segment(n)
var a = "< 0 1 2 3 4 5 6 7 8 >/4"
n(run(99).add(a))
.euclid(a.add(3),11)
.s("atomtones")
.slow(2)
https://strudel.tidalcycles.org?s9V37HP3HSxQ
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-13
// very late today with this one!
// proof of concept using #shabda with #strudel
// thanks to @detour
await samples('https://shabda.ndre.gr/knife,fork,spoon,bird.json?strudel=1')
s("knife fork spoon bird")
.off(1/2, x=>x.speed(0.25).cut(1))
.superimpose(x=>x.s("spoon").speed(perlin.range(0.5,3).segment(12)).ply(3).fast(1/4).gain(0.9))
.room(tri.range(0.2,0.7).slow(8))
https://strudel.tidalcycles.org?35s-5tIsjbZA
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-14
// hard to keep up with these at the weekend!
// two metals two different ways
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
// 26 = cobalt, 25 = iron
await samples('https://shabda.ndre.gr/cobalt, iron.json?strudel=1')
stack(
note("[2 8 14 2] [-3 -1 0 1 2 3 4 5]".add(30).inside(8, rev))
.iter(8)
.add("{2 6}%16")
.s("atomtones")
.slow(2)
,
s("iron cobalt").speed("0.5 1")
)
https://strudel.tidalcycles.org?rAq3C1IFNIh2
////////////////////////////////////////////////////////////////////////
// #patternuary 2023-01-15
// two questions: how to do alternating phrases in a less clunky way?
// how to make the piano notes overlap less
// without using 'cut', too abrupt
// 'end' does not seem to do anything
var a = "9 1 8 2 3 7 4".scale('C3 prometheus')
var b = "9 0 8 2 3 4 7".scale('C3 piongio')
var c = "9 2 7 10 4 7 9".scale('C3 minor hexatonic')
var d = "2 9 7 4 8 2 7".scale('C3 prometheus neopolitan')
stack(
a.mask("<1 0 1 0 0 0 0 0 >/4")
,
b.mask("<0 1 0 1 0 0 0 0>/4")
,
c.mask("<0 0 0 0 1 0 1 0>/4")
,
d.mask("<0 0 0 0 0 1 0 1>/4")
).note().s("piano")
https://strudel.tidalcycles.org?oksMui5M3NAt
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-16
// irritating musical representation of the wet method for the production of phosphoric acid
// H2SO4 + Ca5(PO4)3F
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
cat(
n("1!2 16 8!4").sub(1) // H2SO4
.late(rand.range(0.5,2))
.often(x=>x.speed(rand.range(1.5,3)))
.fast(2)
,
n("20!5 [15 8!4]!3 9").sub(1) // Ca5(PO4)3F
.note("< -7 -3 5 7 >").scale('C1 diminished')
).s("atomtones").slow(8)
https://strudel.tidalcycles.org?0BgsuOvmkCaB
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-17
// never ending struggle to chop samples without clicks
// this is not really it but sounds kind of musical in places
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
s("bisbig").n("<0 1 2 3 >/4")
.slow(4)
.attack(0.1).hold(0.3).release(0.2)
.chop(128).rev()
.speed(0.5)
https://strudel.tidalcycles.org?_v9fqXOrhifI
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-18
// whistles trading fours :)
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
Pattern.prototype.slice = function(slices, control) {
return control.fmap(i => this.begin(i/slices).end((i+1)/slices)).outerJoin()
}
s("bisbig")
.slice(256, irand(8).segment(8).restart("t".slow("<2 4>/4")))
.attack(0.01).release(0.1)
.n("<0 1 2 3>".slow(8))
https://strudel.tidalcycles.org?dDIHEcxaxYUY
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-19
I think this one is going to have to stand as my #patternuary for today, not got time to do any coding I think
https://diode.zone/w/oj2tn5bR5De9Vy82gsx46d
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-20
I'm putting this Pd patch out there as my #patternuary for 2023-01-20 because, sadly, I have no idea how to execute this in either #SuperCollider, #TidalCycles or #Strudel. A random melodic walk with a constrained choice of intervals. Direction reverses at upper and lower bounds. Crucially, syncopation is achived by throwing away any numbers that would repeat either the note before or, in this particular version of the patch, two notes before.
https://diode.zone/w/v6dCG6Xr4XZZsvy7ZBzSM1
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-21
Kind of a response to my own #patternuary video of yesterday 2022-01-20, am now closer to realising my favourite melodic walking algorithm in #SuperCollider rather than #PureData. But, still a fundamental problem to solve here to do with repeated intervals…
https://diode.zone/w/cXECMSkRaeYgbTvqB
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-22
// better late than never
// combinining 'Funk12a' rhythm from here https://urswilke.github.io/strudel/swatch/
// with sounds from here https://academics.skidmore.edu/blogs/jlinz/atom-tones/
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
n(
stack(
"[~ ~ ~ ~] [~ ~ ~ ~] [~ ~ ~ ~] [1 ~ ~ ~] ",
"[2 ~ ~ 13] [~ ~ 11 ~] [12 ~ ~ 2] [~ ~ ~ ~] ",
"[6 ~ 3 5] [7 ~ 3 ~] [8 ~ 3 ~] [9 ~ 3 ~] ",
"[~ ~ ~ ~] [8 ~ ~ ~] [~ ~ ~ ~] [10 ~ ~ ~] ",
).add("<0 1 2 3>")
).s("atomtones")
.slow(3)
.iter(4)
.rarely(x=>x.late("{0 0.25 0.125}%8"))
.note(36).add("{0 5 7}%8")
.every(4, x=>x.mask("0 0 0 0 0 1 1 1 0"))
https://strudel.tidalcycles.org/?SnaG5LDKvj-o
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-23
// rwalk from @joschi00@mastodon.social
// but misusing to create quartal-ish chords
// not very succesful!
/* This class holds the current rwalk state */
class RWalkState {
constructor(start,low,high,steps) {
this.value = start;
this.prev_value1 = start;
this.prev_value2 = start;
this.low = low;
this.high = high;
this.steps = steps;
}
/* step note by diff */
step(diff) {
this.prev_value2 = this.prev_value1;
this.prev_value1 = this.value;
this.value = Math.min(Math.max(this.value+diff, this.low), this.high);
}
/* returns current note value if the value is not equal to the two previous ones */
get() {
return this.value != this.prev_value1 && this.value != this.prev_value2 ? this.value : undefined;
}
}
const _choose = (x, s) => {
const i = Math.trunc(x * s.steps.length * 2);
const d = s.steps[i % 2] * (i < s.steps.length ? 1 : -1);
s.step(d);
//console.log('_choose x='+x+' s.value='+s.value+' d='+d+' i='+i);
return s.get()
};
const _rwalk = (s) => rand.fmap((x) => _choose(x,s));
/* continuous pattern generator with random walk steps */
const rwalk = (start,low,high,steps) => {
return reify(new RWalkState(start,low,high,steps)).fmap(_rwalk).innerJoin();
}
// the pattern
rwalk(48,48,72,[5,7,14]).struct("x!16").note()
.mask("x ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ".slow(4))
.s('sawtooth')
.attack(0.01).decay(0.2)
.sustain(0.6)
.release(0.7)
.legato(4)
.fast("8 | 4 | 16!4 | 12!6")
.cutoff(rand.range(700,1500))
.resonance(6)
https://strudel.tidalcycles.org?srYAkc6B2ddQ
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-24
// bleepy :)
note(irand(30).segment("2 4 8 16").add(40).restart("t".slow(4)))
.hcutoff(rand.range(200,5000).restart("t".slow(2).early(99))).hresonance(9)
.shape("{0.1 0.3 0.5}%8").add(0.2)
.juxBy(0.4, x=>x.room(0.3))
.s("<sawtooth square triangle>".fast("2 4 8"))
https://strudel.tidalcycles.org?tLy33lC86MDg
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-25
// composition for solo piano
// except should be played more sensitively and by a human being!
let chords = "[c,f,a] | [c,f,b] | [c,f#,b]"
stack(
"ab1 eb2 bb2"
.when("<0 1>".slow(4), x=>x.rev())
.transpose("<0 13 26 39 38 25 12 -1>")
.when("<0 1>".slow(16), x=>x.transpose(-2))
.note()
.when("<0 1>".slow(32), x=>x.iter("1 2 4").ply("{1 2 1}%4"))
,
note(chords.add(irand(12).add(24)).slow("3 | 2 | 0.75!3 | 1"))
.when("<0 1>".slow(32), x=>x.gain(0))
).piano().room(0.7).size(2)
https://strudel.tidalcycles.org?CJi3-YkP0eIR
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-26
// just a few days more! keep going! keep going!
// even if the ideas are not very good…
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
stack(
n("7 1 5 6 3 5 1 7 2 5 6 1 3 4 2 3 5 6 ")
.struct("x!16").degradeBy(0.1)
.s("atomtones demung!3")
.iter("2 4 8")
.slow("8 4 2 1".mul(2))
.when("{1 0!6}%8", x=>x.speed(0.5).legato(0.1))
,
n(" 8 7 2!2 3 6 4 [9 8] 7 2 [3 6] 4 8 7 6 2 3")
.s("kendhang")
.struct("x!16")
.slow(4)
.superimpose(x=>x.speed(0.5))
)
https://strudel.tidalcycles.org/?Lzky_HWE4-YP
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-27
// quick atomtones riff
// no time tonight to do more with this!
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
cat(
n("9 8 1 7 0 34 87 0 9 18 23 47")
.struct("<x*16 x(5,16) x(7,16)>").slow(2)
.s("atomtones")
.superimpose(x=>x.speed(2))
,
n("9 8 1 7 0 34 87 0 9 18 23 47".add(20))
.struct("<x*8 x(7,16) x(5,16,1)>").slow(2)
.s("atomtones")
.superimpose(x=>x.speed(2.4))
)
https://strudel.tidalcycles.org?fTD1ljVMKE2R
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-28
// bleepy rave
const run = (n) => saw.range(0,n).floor().segment(n)
stack(
n(run("4 7 18 9").inside("<2 3 4>", rev).mul(4).add("<20 10 30 40>")).cpm(80).color('orange')
,
s("bd:4!2").gain(0.4).cutoff(500).echo(3,1/2,0.7).color('red')
,
n(run("16").add("<0 8>")).slow(2).gain(0.3).s("RolandMC303_perc").pan(rand.range(0.5,0.7)).color('green')
).pianoroll({fold:1,vertical:1})
https://strudel.tidalcycles.org?2kpytuPdMe7h
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-29
// ambient whistles texture
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
s("bisbig")
.chop(128).iter(64)
.end(0.5)
.slow(8).n("<0 1 2 3>/8")
.speed("<0.5 0.25>/16")
.pan(sine.range(0.3,0.7).slow(4))
.gain(0.3)
https://strudel.tidalcycles.org/?nhLvAYZ8dTDm
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-30
// I don't understand this kind of coding in #strudel!
// this is the best I can do :(
stack(
"<C^7 Bb^7>/2"
.voicings('lefthand')
.struct("x(<3 5>,8,<0 1>)")
.note()
.s("vibraphone_soft").end("1".div(10))
,
note("D2!9 F2!3 G2!5".slow(2))
.s("sawtooth")
.attack(0.01).decay(0.05).sustain(0.4).release(0.3)
,
s("bd!2")
.cutoff(400)
)
https://strudel.tidalcycles.org?CZ70UGTBm50Z
////////////////////////////////////////////////////////////////////////
// @tedthetrumpet@post.lurk.org #patternuary 2023-01-31
// have you tried turning it off and on again?
await samples('github:tedthetrumpet/testpage/master/strudelsamples/')
const loop = (n) => rand.range(0,n).floor().segment(n)
Pattern.prototype.slice = function(slices, control) {
return control.fmap(i => this.begin(i/slices).end((i+1)/slices)).outerJoin()
}
s("theit")
.slice(16, loop(16).restart("t"))
.n("<1 1 1 3>< 0 2 4 3>")
.slow(4 * 120/160)
https://strudel.tidalcycles.org?uZioFomGDypN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment