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

I was inspired by the theory of the backrooms for this composition. Since I already wanted to go for something creepy/eerie, the video I found of the backrooms with the random visuals fit perfectly.

I wanted to start with calm and distant music, gradually introducing the more distorted and abnormal sounds, as this was happening, I simultaneously changed the visuals to make more and more intense, often being modified with the sounds. The climax was supposed to be reached towards the end of the composition when the visuals got more and more intense/red and bright, and the music got more and more creepy, finishing with the numbers track.

Tidal Code:

d1 $ stack [
  slow 4 $ s "pad:1.5" # gain 0.5,
  s "bass*2" # room 0.3 # gain 1.2
]


d2 $ stack [
  s "haw(4,8) blue(4,8)" # speed 0.5 ,
  ccv "<64 0 127 0>" # ccn "0" # s "midi"
]

d2 $ stack [
slow 1 $ s "moog" >| note (arp "up" (scale "major" ("[0,2,4,6]") + "a5"))# room 0.4 # gain 0.7,
 ccv "<0 64 127 64>" # ccn "0" # s "midi"
 ]

 -- # room 0.4 # gain 0.5,

d2 $ stack [
slow 1 $ s "moog" >| note (arp "up" (scale "major" ("[0,2,4,6]") + "a5")) # room 0.4 # gain 0.7,
ccv 0 # ccn 1 # s "midi"
]
-- # krush 10

d1 $ fast 2 $ s "moog" >| note (arp "up" (scale "major" ("[0,2,4,6]") + "a5")) # room 0.4 # gain 1 # squiz 0.3
-- # squiz 0.1
-- note "a5"
-- add this d4 $ fast 2 $ s "stab*2 stab*2 stab*2 <stab*6 [stab*2]!3>" # room 0.7 # gain (range 1.2 1.4 rand)
d4 $ fast 2 $ s "stab*2 stab*2 stab*2 <stab*6 [stab*2]!3>" # room 0.7 # gain 1.3

d1 $ stack [
  slow 2 $ s "bassfoo" >| note (arp "updown" (scale "major" ("[0,2,4,6]"+"<0 0 2 3>") + "c2")) # room 0.4 # delay 0.9,
  ccv "<127 0 64 >" # ccn "0" # s "midi"
-- add squiz and have it distort image
-- hydra 2
]

d1 $ slow 2 $ ccv " 127 64" # ccn "0" # s "midi"

d3 $ stack [
  slow 4 $ s "pad:1.5" # gain 0.1,
  s "bass*2" # room 0.5 # gain 0.1
]

d2 $ stack [
  s "haw(4,8) blue(4,8)" # speed 0.5 # gain 0.5,
  ccv "<64 0 127 0>" # ccn "0" # s "midi"
]
d3 silence
d4 silence
d1 silence
-- d4 $ fast 2 $ s "stab*2 stab*2 stab*2 <stab*6 [stab*2]!3>" # room 0.7 # gain (range 1.2 1.4 rand)

d2 $ slow 2 $ s "[~numbers:1] [numbers:2] [~numbers:3] [numbers:4] [numbers:5] [numbers:6] [~numbers:7] [numbers:8*2]" # squiz 1.5 # gain 1.2
d3 $ slow 2 $ s "[numbers:1*2] [numbers:2] [numbers:3] [numbers:4] [numbers:5] [numbers:6] [numbers:7] [numbers:8]" # note "c'maj e'min d'maj" # room 0.4 # squiz 2
hush

Hydra Code:

s0.initVideo("/Users/kween/Desktop/Spring 2025!/LiveCoding/0.mp4")

src(s0).out()


src(s0)
  .saturate(0.8)
  .contrast(1.1)
  .modulate(noise(1, 0.1), 0.15)
  .modulateScrollX(osc(2, 0.1, 1), 0.05)
  .brightness(-0.1)
  .out()


  src(s0)
  .brightness(() => cc[0] * 0.5 - 0.5)
  .out()



src(s0)
      .blend(src(o0).diff(s0).scale(() => cc[1] * 1),1)
      .modulatePixelate(noise(2,0.01).pixelate(16,16),1024)
      .out()


 src(s0)
          .modulate(noise(() => cc[0] * 2, 0.2))
          .color(0.4, 0.1, 0.1)
          .contrast(1.5)
          .brightness(0.3)
          .modulateScale(voronoi(5, 0.3))
          .rotate(() => Math.sin(time) * 0.1)
          .out(o0)



      src(s0)
        .blend(src(o0).diff(s0).scale(.99),1.1)
        .modulatePixelate((noise(() => cc[0] * 2, 0.1)).pixelate(() => cc[0] * 2,16),1024)
        .out()


      src(s0)
          .blend(src(o0).diff(s0).scale(.99),1.1)
          .out()


          //end?
              src(s0)
                .modulate(noise(() => cc[1] * 2, 0.1))
                .colorama(() => cc[0] * 0.5)
                .rotate(() => Math.sin(time) * 0.2)
                .color(1, 0.2, 0.2)
                .out()

          src(s0)
            .blend(src(o0).diff(s0).scale(.99),1.1)
            .modulate(noise(() => cc[1] * 2, 0.1))
            .colorama(() => cc[0] * 0.5)
            .rotate(() => Math.sin(time) * 0.2)
            .color(1, 0.2, 0.2)
            .out()


              src(s0).out()



hush()

I drew inspiration from Hans Zimmer’s work in Dune, with the industrial but desert sounds and the deep base. The sounds for the evil side of the track were also insipred by the Sardukar chant from the epilogue of each of the movies. The aesthetics of the hero soundtracks in games I played growing up.

The story being told is of a battle between evil and good a where good win after the beat drops (hopefully on time..). I have attached a video to the composition.

Looking at the video one more time, I realise that you can see the cursor bing visible in the middle of the screen. This is evidence of the p5js visualization shown as a video and there not being a p5 instance created during the performance.

The background visual is made with p5.js by taking muse mind monitors eeg readings of me playing chess and taking time-series data for each type of brain wave (alpha, delta, thetha) which are correlated to different types of emotions. The wave values, while in .csv had lost a lot of information and context where the color pf the particles is the aggregation of the wavetypes and the size is dictated by purely delta waves associated with high stress. The ring in the middle pulses on the heart-rate data from the headband.

The code code was used to generate the p5js video:

let brainData = [];
let headers = [];
let particles = [];
let currentIndex = 0;
let validData = [];
let heartBeatTimer = 0;
let lastHeartRate = 70; //default heart rate

class Particle {
  constructor(x, y, delta, theta, alpha) {
    this.pos = createVector(x, y);
    this.vel = p5.Vector.random2D().mult(map(delta, -2, 2, 0.5, 3));
    this.acc = createVector(0, 0);

    this.r = map(delta, -2, 2, 50, 255);
    this.g = map(theta, -2, 2, 50, 255);
    this.b = map(alpha, -2, 2, 50, 255);

    this.size = map(abs(delta), 0, 2, 2, 10);
    this.lifespan = 255;
  }

  update() {
    this.vel.add(this.acc);
    this.pos.add(this.vel);
    this.acc.mult(0);
    this.vel.add(p5.Vector.random2D().mult(0.1));
    this.lifespan -= 2;
  }

  applyForce(force) {
    this.acc.add(force);
  }

  display() {
    noStroke();
    fill(this.r, this.g, this.b, this.lifespan);
    ellipse(this.pos.x, this.pos.y, this.size, this.size);
  }

  isDead() {
    return this.lifespan < 0;
  }
}

function preload() {
  brainData = loadStrings("mindMonitor_2025-02-26--20-59-08.csv");
}

function setup() {
  createCanvas(windowWidth, windowHeight);
  colorMode(RGB, 255, 255, 255, 255);

  headers = brainData[0].split(",");
//filterinf dataset for valid rows
  validData = brainData.slice(1).filter((row) => {
    let cells = row.split(",");
    return cells.some((cell) => !isNaN(parseFloat(cell)));
  });

  console.log("Total valid data rows:", validData.length);
}

function draw() {
  //trailing effect for particles
  background(0, 20);

  if (validData.length === 0) {
    console.error("No valid data found!");
    noLoop();
    return;
  }

  let currentLine = validData[currentIndex].split(",");

  let hrIndex = headers.indexOf("Heart_Rate");
  let heartRate = parseFloat(currentLine[hrIndex]);

  if (!isNaN(heartRate) && heartRate > 0) {
    lastHeartRate = heartRate;
  }

  let beatInterval = 60000 / lastHeartRate;

  heartBeatTimer += deltaTime;

  if (heartBeatTimer >= beatInterval) {
    heartBeatTimer = 0;

    let deltaIndex = headers.indexOf("Delta");
    let thetaIndex = headers.indexOf("Theta");
    let alphaIndex = headers.indexOf("Alpha");

    let delta = parseFloat(currentLine[deltaIndex]) || 0;
    let theta = parseFloat(currentLine[thetaIndex]) || 0;
    let alpha = parseFloat(currentLine[alphaIndex]) || 0;

    let particleCount = map(abs(delta), 0, 2, 5, 30);
    for (let i = 0; i < particleCount; i++) {
      let p = new Particle(
        width / 2 + random(-100, 100),
        height / 2 + random(-100, 100),
        delta,
        theta,
        alpha
      );
      particles.push(p);
    }

    currentIndex = (currentIndex + 1) % validData.length;
  }

  push();
  noFill();
  stroke(255, 0, 0, 150);
  strokeWeight(3);
  let pulseSize = map(heartBeatTimer, 0, beatInterval, 100, 50);
  ellipse(width / 2, height / 2, pulseSize, pulseSize);
  pop();

  for (let i = particles.length - 1; i >= 0; i--) {
    particles[i].update();
    particles[i].display();

    if (particles[i].isDead()) {
      particles.splice(i, 1);
    }
  }
}

function windowResized() {
  resizeCanvas(windowWidth, windowHeight);
}

I encapsulated the tidal code so that i would only have to excute few lines during the performance which didn’t go the way I wanted:( , so in a way i feel like when it comes to live coding performance, having a few refactored functions work while working with code blocks lives gives a better setup for performing and debuggin on the fly.

Below is the tidal code:


-----------------hehe----

setcps (135/60/4)

-- harkonnen type beat
evilPad = slow 8
$ n (cat [
"0 3 7 10",
"3 6 10 13",
"5 8 12 15",
"7 14 17 21"
])
# s "sax"
# room 0.8
# size 0.9
# gain (range 0.7 0.9 $ slow 4 $ sine)

--shardukar type beat
evilBass = slow 8
$ sometimesBy 0.4 (rev)
$ n "0 5 2 7"
# s "sax:2"
# orbit 1
# room 0.7
# gain 0.75
# lpf 800
# shape 0.3

--geidi prime type beat
evilAtmosphere = slow 16
$ sometimes (|+ n 12)
$ n "14 ~ 19 ~"
# s "sax"
# gain 0.8
# room 0.9
# size 0.95
# orbit 2

--shardukar chant type pattern chpped
evilPercussion = slow 4
$ striate "<8 4>"
$ n (segment 16 $ range 6 8 $ slow 8 $ perlin)
# s "speechless"
# legato 2
# gain 1.2
# krush 4

--shardukar chant type pattern 2 chopped
evilVoice = slow 4
$ density "<1 1 2 4>/8"
$ striate "<2 4 8 16>/4"
$ n (segment 32 $ range 0 6 $ slow 8 $ sine)
# s "speech"
# legato (segment 8 $ range 2 3 $ slow 16 $ sine)
# gain (segment 32 $ range 0.8 1.2 $ slow 4 $ sine)
# pan (range 0.3 0.7 $ rand)
# crush 8

hush

evilRhythm = stack [
s "~ arp ~ ~" # room 0.5 # krush 9 # gain 1.2,
fast 2 $ s "moog2 moog2 moog2 moog3 moog:1 moog2" # room 0.7 # krush 5, fast 4 $ s "wobble8" # gain 0.8 # lpf 1200
]

d1 $ evilRhythm
hush

-- Build-up to drop
evilBuildUp = do {
d1 $ qtrigger $ filterWhen (>=0) $ seqP [
(0, 1, s "moog:14"), (1, 2, s "moog:18"),
(2, 3, s "moog:116"), (3, 4, s "moog:132")
] # room 0.3 # krush 9 # lpf (slow 4 (3000saw + 200)); d2 $ qtrigger $ filterWhen (>=0) $ seqP [ (0, 1, s "bass1:74"),
(1, 2, s "bass1:88"), (2, 3, s "bass1:916"),
(3, 4, s "bass1:932") ] # room 0.3 # lpf (slow 4 (1000saw + 100)) # speed (slow 4 (range 1 4 saw)) # gain 1.3;
d3 $ qtrigger $ filterWhen (>=0) $ seqP [
(0, 4, evilVoice # gain (slow 4 (range 0.8 1.5 saw)))
];
d4 $ qtrigger $ filterWhen (>=0) $ seqP [
(3, 4, s "crash:2*16" # gain (slow 1 (range 0.7 1.3 saw)) # room 0.9)
]
}

d1 $ silence
d2 $ silence
d3 silence
d4 silence

theDrop = do {
d1 silence;
d2 silence;
d3 silence;
d4 silence
}

heroBassDrum = s "[808bd:3(3,8), 808bd:4(5,16)]" # gain 1.3 # room 0.4 # shape 0.4 #krush 9

heroSnare = s "~ sd:2 ~ sd:2" # room 0.6 # gain 1.1 # squiz 0.8 #krush 6

heroHiHats = fast 2 $ s "hh*4" # gain (range 0.8 1.0 $ rand) # pan (range 0.2 0.8 $ slow 3 $ sine) #krush 5

heroTom = s "~ ~ ~ [~ lt:1 lt:2 lt:3*2]" # gain 1.0 # room 0.5 # speed 0.9 #krush 9

heroCymbal = s "[~ ~ ~ crash:4]" # gain 0.95 # room 0.7 # size 0.8

heroicFill = s "[feel:14, [~ ~ ~ feel:64], [~ ~ ~ ~ crash]]"
# gain 1.2
# room 0.7
# speed (range 1.5 0.9 $ saw)
# crush 8

dramaticEntrance = do {
d1 $ s "808bd:3 ~ ~ ~ ~ ~ ~ ~" # gain 1.4 # room 0.9 # size 0.9;
d2 $ s "~ ~ ~ crash:4" # gain 1.3 # room 0.9;
d3 silence;
d4 silence
}

heroPattern = do {
d1 $ stack [
heroBassDrum,
heroSnare,
heroHiHats
];
d2 $ stack [
heroTom,
heroCymbal
] # shape 0.3;
d3 $ s "sine:3" >| note (scale "mixolydian" ("0,4,7") + "c4")
# gain 0.65 # room 0.7;
d4 silence
}

heroExpanded = do {
d1 $ stack [
heroBassDrum # gain 1.4,
heroSnare # gain 1.2,
heroHiHats # gain 1.1
];
d2 $ stack [
heroTom,
heroCymbal # gain 1.1
] # shape 0.3;
d3 $ s "sine:3" >| note (scale "mixolydian" ("0,4,7") + "")
# gain 0.75 # room 0.7 # lpf 3000;
d4 $ s "[~ ~ ~ [feel:6 feel:7]]" # gain 0.9 # room 0.6
}

heroEpic = do {
d1 $ stack [
s "[808bd:3(3,8), 808bd:4(5,16)]" # gain 1.4 # room 0.4,
s "~ sd:2 ~ [sd:2 sd:4]" # room 0.6 # gain 1.2,
fast 2 $ s "hh4" # gain (range 0.9 1.1 $ rand) ]; d2 $ stack [ s "~ ~ mt:1 [~ lt:1 lt:2 lt:32]" # gain 1.1 # room 0.5,
s "[~ ~ ~ crash:4]" # gain 1.0 # room 0.7
] # shape 0.4;
d3 $ s "sine:3" >| note (scale "mixolydian" ("0,4,7,9") + "")
# gain 0.8 # room 0.8 # lpf 4000;
d4 $ s "feel:6(3,8)" # gain 0.9 # room 0.6 # speed 1.2
}

evilIntro = do {
d1 $ evilPad;
d2 silence;
d3 silence;
d4 silence
}

evilBuilds = do {
d1 $ evilPad;
d2 $ evilBass;
d3 $ evilAtmosphere;
d4 silence
}

evilIntensifies = do {
d1 $ evilPad;
d2 $ evilBass;
d3 $ evilAtmosphere;
d4 $ evilPercussion
}

d9 $ ccv "0 40 60 120" # ccn "0" # s "midi"

evilFullPower = do {
d1 $ evilPad # gain 0.6;
d3 $ evilVoice;
d4 $ evilPercussion # gain 1.3
}

--for evil full power
d6 $ s "~ arp ~ ~" # room 0.5 # krush 9 # gain 1.2
d7 $ fast 2 $ s "moog2 moog2 moog2 moog3 moog:1 moog2" # room 0.7 # krush 5 d8 $ fast 4 $ s "wobble8" # gain 0.8 # lpf 1200

evilIntro
evilBuilds
evilIntensifies
evilFullPower

evilBuildUp
theDrop

dramaticEntrance
heroPattern
heroExpanded
heroEpic

hush

Below is the hydra code:

s0.initVideo("/Users/janindu/Documents/liveCoding/p5_demo/p5_js_eegViz.mp4")

src(s0)
  .blend(o1, () => cc[1])
  .out()

  src(o0)
    .blend(src(o0).diff(s0).scale(.99),1.1)
    .modulatePixelate(noise(2,0.8).pixelate(160,160),1024)
    .out(o1)



  src(o0)
    .blend(
      src(o0)
        .diff(s0)
        .scale(() => 0.99 + 0.1 * Math.sin(time * 0.1))
        .rotate(() => cc[1] * 0.1),
      () => 1.1 + cc[1] * 0.5
    )
    .modulatePixelate(
      noise(() => 2 + cc[1] * 3, () => 0.01 + cc[1] * 0.05)
        .pixelate(() => 16 - cc[1] * 8, () => 16 - cc[1] * 8),
      () => 1024 * (1 - cc[1] * 0.5)
    )
    .modulate(
      o0,
      () => cc[1] * 0.3
    )
    .kaleid(() => Math.floor(cc[1] * 4) + 1)
    .colorama(() => cc[1] * 0.1)
    .out(o1)


//---
    hush()

Im really happ something came out of the eeg pipieline but I honestly feel that that that time culd have been better spent relying on noise to generate visuals.

But nevertheless, I’m happy I could (pun intended..) leave my heart and soul on the screen.

Also this is how it looks like. from p5js: