Hydra code:

let p5 = new P5();
let maxCount = 5000; // max count of the circles
let currentCount = 1;
let x = [];
let y = [];
let r = [];
s0.init({ src: p5.canvas });
src(s0).out();
p5.hide();
  p5.strokeWeight(0.5);
  x[0] = p5.width / 2;
  y[0] = p5.height / 2;
  r[0] = 10;
p5.draw = () => {
  p5.clear();
  let newR = p5.random(1, 7);
  let newX = p5.random(newR, p5.width - newR);
  let newY = p5.random(newR, p5.height - newR);
  let closestDist = Number.MAX_VALUE;
  let closestIndex = 0;
  for (let i = 0; i < currentCount; i++) {
    let newDist = p5.dist(newX, newY, x[i], y[i]);
    if (newDist < closestDist) {
      closestDist = newDist;
      closestIndex = i;
    }
  }
  let angle = p5.atan2(newY - y[closestIndex], newX - x[closestIndex]);
  x[currentCount] = x[closestIndex] + p5.cos(angle) * (r[closestIndex] + newR);
  y[currentCount] = y[closestIndex] + p5.sin(angle) * (r[closestIndex] + newR);
  r[currentCount] = newR;
  currentCount++;
  for (let i = 0; i < currentCount; i++) {
    p5.fill(255, 255, 0);
    p5.ellipse(x[i], y[i], r[i] * 2, r[i] * 2);
  }
  if (currentCount >= maxCount) p5.noLoop();
};
render(o0);

src(s0).mult(osc(10,1,1)).out()

src(s0).modulate(voronoi(()=>(cc[1])*15,.9)).mult(osc(9,1.1,2)).out()

src(s0).modulate(voronoi(()=>(cc[1])*15,1)).mult(osc(9,1.1,2)).scale(1.5,1,1).out()

src(s0).modulate(voronoi(()=>(cc[1])*15,1)).mult(osc(9,10,6)).scale(1.5,1,1).saturate(({time}) => Math.sin(time) * 4).out()

TidalCycles code:

hush

d1 $ someCycles(degradeBy 0.1) $ jux rev $ struct "t(4,8,3)" $ sometimes (# octave 7) $ n (scale "major" (sometimes rev $ "[0 2 3 4 7]")) # s "superpiano" # speed "[1,2]" # room 0.2
d6 $ ccv "0 10 20 50 80 100 127" # ccn "1" # s "midi"


d2 $ s "bassdm:14*4" # gain 2.5 # room 0.09
d5 $ ccv "0 40 80" # ccn "1" # s "midi"


d4 $ s "[reverbkick]" # room 0.5
d5 $ ccv "0 20 40 80" # ccn "1" # s "midi"


d3 $ sometimes (# velocity 0.6) $ iter 4 $ struct "<t(4,8) t(4,8,1)>" $ s "cp"

Design P_2_2_1_01 (Herman Schmidt et al., 2018) from the generative design book caught my eye and I decided that it would be a good base for the work I was planning to make with p5. I felt that abstract patterns like the one seen below were a great start to the project. I took the algorithm of how the patterns were drawn and then I customized the code to be able to respond to midi events instead of mouse position. 

There are 4 patterns on tidal. One is a pattern of higher sounds and the other is a bit lower sounding pattern where I experimented with distortion using the someCycles function. The other two patterns control the midi output.

Here is the demo of the visuals controlled by tidalCycles:

This is the link for the video

This is the code:

Hydra:

let p5 = new P5()
s0.init({src: p5.canvas})
// in a browser you'll want to hide the canvas
p5.hide();
// no need for setup
p5.noFill()
p5.strokeWeight(10);
p5.angleMode(p5.DEGREES);
p5.stroke(255);
p5.noiseDetail(2,1)
// with tidal
let start = 10
p5.draw = ()=>{
  p5.background(0);
  p5.translate(p5.width/2, p5.height/2)
  let space = 10;
  for (let i = 0; i < 360; i+= space){
    let xoff = p5.map(p5.cos(i), -1, 1, 0, 10)
    let yoff = p5.map(p5.sin(i), -1,1, 0, 10)
    let n = p5.noise(xoff + start, yoff + start);
    var h = p5.map(n, 0, 1, -150, 200)
    p5.rotate(space)
    p5.rect(200 + cc[0] * 5, ccActual[0],h,1)
  }
  start += 0.01
}
src(s0).rotate(ccActual[0], 0.5).out(o1) //rotate(10, 0.5).
osc(24,0.5,3.5).mult(o1).out()

TidalCycles:

d1 $ whenmod 16 8 (# note (scale "major" ("[0,2,4] [1,3,5] [5,7,9]") + "c5")) $ s "[hh*8?, <superhammond:5(3,8) gtr(5,8)>, <clubkick(5,8) [drumtraks:6(3,8), bd(5,8,1)]>]" # room 0.95 # gain 1.4 # speed (slow 4 (range 1 2 square))
d2 $ whenmod 16 8 (# ccv ((segment 128 (range 0 127 saw)))) $ struct "<t(3,8) t(5,8)>" $ ccv ((segment 128 (range 40 120 rand))) # ccn "0" # s "midi"
d1 $ degradeBy 0.2 $ sometimes (jux rev) $ bite 4 "[0 1 0 1]" $ chunk 4 (# note "{c e f g b}%16")  $ slow 2 $ note (off 0.125 (+12) (off 0.25 (+"-5") "c(3,8) f(3,8,2) <c d e3 f3>(3,8,1) <c3 d e f>*4")) # s "[arpy]" # room 0.8 # speed "[0.5,1]"

d2 $ someCycles (jux rev) $ iter 4 $ s "amencutup*16" # n (run 32) # room 0.5 # gain 1.1

Apologies for the late submission, it slipped my mind to post one, though I had recorded my video prior to the class.

All in all, I had to idea what to expect with the composition. I had no idea what my personal stylistic choices are, so I kind of struggled at the start with a concept. Therefore, I simply began with crafting a funky upbeat solid rhythm. I took my time to become more familiar with the visuals, therefore, I had spent quite a bit of time experimenting with them, but not many of my results felt like they aligned with the direction my piece was heading. Then I thought to bring in a personal sound sample to spice things up. As a result, I went to the first thing that came to my mind — Pingu. I included the Noot Noot sample as I find Pingu to be the perfect embodiment of chaos but also a playful character (and also he is one of my favourite characters to exist).  I wanted to ensure the visuals were in sync with the sound, and at the start I had struggled, especially with finding the right sort of ccv values, however, through a brute iterative trial and error session, I found a neat balance. I had started going with a more subtle approach, however I found that it was quite challenging to recognise this, and I was worried that given the time limit during the demos, I would not be able to execute in a proper manner. Therefore, I went for more bolder visuals, with simpler beats. I noted that in class you said that the sync between the visuals and the audio was not as evident, so I hope from this video you are able to find a more distinguishable link between them.

From the 0:27 part, I introduce a new melody, and I wanted to represent that with squiggly lines to indicate its playful nature. This is then followed by even funkier and playful beats such as Casio and blip. Once I had found an interesting synchrony with casio and blip, I understood how I wanted to go ahead — as this made it easy for me to create something that reflects the feeling lightheartedness with a tinge of a spirited and lively approach, however, as I had Pingu in my vision, around the end of my video (4:00) I began to truly mess with the visuals and create something that is quite disorderly in nature despite it being in sync with my sound.

I hope that you enjoyed!

Here is my code! (It’s a bit changed from the video since it is from the class demo)

Tidal

--- FINAL CODE

hush
d1 $ s "{808bd:5(3,4) 808sd:2(2,6)} " # gain 2 # room 0.3

d1 silence
d2 $ struct "{t(3,4) t(2,6) t(2,4)}" $ ccv ((segment 128 (range 127 0 saw))) # ccn "0" # s "midi"
hush

d3 $ fast 2 $ s "pluck" <| n (run 4) # gain 1 # krush 2
d2 $ ccv "0 20 64 127" # ccn "0" # s "midi"

d4 $ s "glasstap" <| n (run 4) # gain 1.5

d5 $ slow 2 $ s "arpy" <| up "c d e f g a b c6" # gain 1.5
d2 $ ccv " 9 19 36 99 80 87 45 100" # ccn "0" # s "midi"

d6  $ fast 2 $ s "casio" <| n (run 4) # gain 2
d3 $ qtrigger $ filterWhen (>=0) $ seqP [
  (0, 1, s "blip:1*4"),
  (1,2, s "blip:1*8"),
  (2,3, s "blip:1*12"),
  (3,4, s "blip:1*16")
] # room 0.3

d4 silence
hush
nooty = once $ sound "nootnoot:Noot" # squiz 1 # up "-2" # room 1.2 # krush 2
nooty
-- PART 2

d5 $ s "blip"  <| n (run 4)
  # krush 3
  # gain 1

d2 $ ccv "30 80 120 60" # ccn "0" # s "midi"
d6 silence

hush

d6 $ fast 2 $ s "control" <| n (run 2)
d7$ fast 2 $ s "casio" <| n (run 4) #gain 0.9 



d8 $ s "{arpy:5(3,4) 808sd:(2,4)} " # gain 1

d2 $ struct "{t(3,4) t(2,4) t(2,4)}" $ ccv ((segment 128 (range 127 0 saw))) # ccn "0" # s "midi"
nootynooty = once $ sound "nootnoot:Noot" # legato 0.2 # squiz 1 # up "-2" # room 1.2 # krush 2

d6 silence
d10 $ qtrigger $ filterWhen (>=0) $ seqP [
  (0, 1, s "control:1*4"),
  (1,2, s "control:1*8"),
  (2,3, s "control:1*12"),
  (3,4, s "control:1*16")
] # room 0.3
nooty

hush

Hydra


//SHAPE ONE 

osc(20, 0.4, 1)
  .color(0.3, 1.2, 1.2)
  .rotate(() => cc[0] * 0.9 * 0.8)
  .kaleid(10)
  .modulateRotate(noise(() => (cc[0]) * 0.7, 0.6))
  .rotate(() => cc[0] * 1.1 * 1.8)
  .kaleid(30)
  .modulateRotate(noise(() => (cc[0]) * 0.9, 0.6))

.out()
hush()

//SHAPE TWO 
osc(20, 0.3, 3)
  .color(1.3, 1.8, 2.9)
  .modulate(noise(() => (cc[0] + cc[1]) * 3, 1.4))
  .layer(
    osc(70, 0, 1)
      .luma(0.5, 0.1)
      .kaleid(10)
      .modulate(noise(() => (cc[0] + cc[1]) * 2, 0.4))
  )
  .out(o0)
hush()
//SHAPE THREE
shape(10,0.5).scale(1,1,2).repeat(30,9).modulate(noise(() => (cc[0] + cc[1]) * 9, 0.9)).out()

solid().out()
//SHAPE IV
osc(15, 2.6, 1.8)
  .color(1.2, 1.4, 1.2)
  .rotate(() => cc[0] * 0.9 *0.5)
  .kaleid(20)
  .modulateRotate(noise(() => (cc[0]) * 1.2))
.out()

hush()
//SHAPE V
osc(10, 30, 10)
.kaleid(99)
.modulate(noise(() => (cc[0] + cc[1]) * 1.9, 0.2))
.out(o0)

// noot
hush()

For this project, I wanted to place strong focus on the drum patterns in my music. In the first section, I used a central rectangle and changed its form through twisting and scaling. These transformations were chosen to represent different shifts and spikes in the drum beats. By distorting the rectangle, I tried to show how the percussion moves and grows during the track. This is a big challenge since it is hard to find the values that exactly match the strengths and the frequencies of the drums.

When the piece reaches its middle section, I remove all the drum parts after a brief lead-in and leave only an ambient synthesizer. I also take away the moving rectangles in the center to keep the visuals in step with the music. Afterwards, the bass brought some energy to the piece, and made me think of adding some glitchy patterns in Hydra together with some crushing and distorted sounds.

In the final section, I used only a Moog synth. I wanted the sound to be stretched out and slow to fit the outro of the entire composition and to make it stand apart from the earlier chaotic bass lines. I also adjusted the pattern to be more organized, and it shifted in step with the Moog as it gradually slowed down.

Code for Hydra:

shape(
  () => 3 + Math.floor(cc[0] / 10),
  () => 0.2 + cc[0] * 0.001,      
  () => 0.1 + cc[0] * 0.0005         
)
.modulateRotate(
  noise(
    () => 2 + cc[0] / 10,       
    () => 0.3 + cc[0] * 0.001        
  ),
  () => 0.3 + cc[0] * 0.003          
)
.out(o0)

shape(
  () => 3 + Math.floor(cc[0] / 10),
  () => 0.2 + cc[0] * 0.001,      
  () => 0.1 + cc[0] * 0.0005         
)
.modulateRotate(
  noise(
    () => 2 + cc[0] / 10,       
    () => 0.3 + cc[0] * 0.001        
  ),
  () => 0.3 + cc[0] * 0.003          
).layer(
  shape(
    () => 4 ,
    () => 0.15 + cc[1] * 0.008,
    0.02
  )
  .rotate(
    () => (time * 0.05) + (cc[1])
  )
  .colorama(() => cc[1] * 0.1)
  .scale(() => 1 + cc[1] * 0.002)
  .luma(0.2, 0.1)
)
.out(o0)

src(o0)
  .layer(
  shape(
    () => 4 ,
    () => 0.15 + cc[1] * 0.008,
    0.02
  )
  .rotate(
    () => (time * 0.05) + (cc[1])
  )
  .colorama(() => cc[1] * 0.1)
  .scale(() => 1 + cc[1] * 0.002)
  .luma(0.2, 0.1)
)
.out(o0) 


src(o0)
.layer(
  noise(
    () => 1 + cc[2] / 20,
    () => 0.2 + cc[2] * 0.001 
  )
  .rotate(() => cc[2]) 
  .kaleid(() => 2 + Math.floor(cc[2] / 20)) 
  .colorama(() => cc[2]*3) 
  .luma(0.3, 1)
)
.layer(
shape(
  () => 4 ,
  () => 0.15 + cc[1],
  0 // change to 0 after silence
)
.rotate(
  () => (cc[1])
)
.colorama(() => cc[1] * 0.1)
.scale(() => Math.random())
.luma(0.2, 0.1)
)
.out(o0)

src(o0)
.layer(
  noise(
    () => 1 + cc[2] / 20,
    () => 0.2 + cc[2] * 0.001 
  )
  .rotate(() => cc[2]) 
  .kaleid(() => 2 + Math.floor(cc[2] / 20)) 
  .colorama(() => cc[2]*3) 
  .luma(0.3, 1)
.rotate(
  () => (cc[1])
)
.colorama(() => cc[1] * 0.1)
.scale(() => Math.random())
.luma(0.2, 0.1)
)
.out(o0)

hush()

osc(
    () => 10 + Math.random() * 20,
    0.1,
    () => 0.8 + Math.random() * 0.2  
  )
  .modulate(
    noise(
      () => 2 + Math.random() * 3,
      () => 0.1 + Math.random() * 0.05
    )
  )
  .rotate(
    () => time * 0.05 * Math.random()
  )
  .out(o0)  


src(o0)
    .layer(
    shape(() => 3 + Math.floor(Math.random() * 5), 0.2, 0.05)
    .scale(() => 0.8 + Math.random() * 0.4)
    .luma(0.4, 0.1)
    .rotate(() => Math.random() * 2)
    .colorama(() => Math.random() * 2)
    )
    .rotate(() => cc[3] * 0.03)
    .kaleid(() => 2 + Math.floor(cc[3] / 15))
    .colorama(() => cc[1] * 0.1)
    .scale(() => 1 + cc[3] * 0.001 + cc[3] * 0.001)
    .out(o0)


solid().out()

Code for Tidal:

d1 $ s "arp:3*4" >| note (scale "<major>" ("[<-2 -5 -1 -3>,2](3,8)") + "c7")
  # room 0.4
  # krush 6
  # lpf 100
  # gain 1.5

d2  $ ccv "<40 60 80 100>"
    # ccn "0"
    # s "midi"

d3 $ s "bass*4" >| note (scale "<major>" ("[-5,2](3,8)") + "c4")
  # krush 8
  # lpf 100
  # gain 2
  # legato 2
  # room 0.4

d4
  $ struct "t*4"
  $ ccv "<30 60 90 120>"
  # ccn "1"
  # s "midi"

d3 $ s "bd:3(2,8) bd:3(3,8)" # krush 6 # gain 2 # legato 2

d5 $ struct "<t(2,8), t(3,8)>"
 $ ccv "<40 80 10 120 150>"
 # ccn "2"
 # s "midi"

d4 $ s "arp:5*4" >| note (scale "<major>" ("[<-2 -5 -1 -3>,2]") + "c4")
    # lpf 200
    # krush 4
    # gain 1.5
    # legato 2

d3 silence

d3 $ s "808bd:3*4" # room 0.7 # krush 6 # gain 1.2

d3 $ qtrigger $ filterWhen (>=0) $ seqP [
  (0,1, s "808bd:3*4"),
  (1,2, s "808bd:3*8"),
  (2,3, s "808bd:3*16"),
  (3,4, s "feel:6(3,8)")
] # room 0.7 # krush 6 # gain 1.2

boom = do
  d1 $ qtrigger $ filterWhen (>=0) silence
  d2 $ qtrigger $ filterWhen (>=0) silence
  d3 $ qtrigger $ filterWhen (>=0) silence
  d4 $ qtrigger $ filterWhen (>=0)
    $ s "<feel:6(3,8), feel:6(5,8,1), feel:6(3,8)>"
    # room 0.85
    # speed "<1.2 0.8>"
    # gain 1.2
    # krush 3
    # pan (slow 4 sine)

boom
  
d5
  $ s "moog"
  # note (scale "aeolian" (irand 8))
  # sustain 8
  # release 8
  # gain 2

d4 silence

d7
  $ struct "t"
  $ ccv "<30 60 90 120>"
  # ccn "3"
  # s "midi"

hush