-- BreakBlue: Breakbit nocturnal piano instrumental
-- Tags: Hip-Hop, piano, energique
-- Ready: 4/10

setcps (60/60/4)

do
  solo 1 -- Break/kick
  solo 3 -- Basse
  solo 4 -- Piano Aigu
  solo 5 -- Piano Grave
  solo 6 -- Clap
  solo 8 -- Maracas

do
  solo 1 -- Break/kick
  unsolo 3 -- Basse
  solo 4 -- Piano Aigu
  unsolo 5 -- Piano Grave
  unsolo 6 -- Clap
  solo 8 -- Maracas

do
  setcps 0.4
  let scale = getScale (scaleTable ++ [("blues", [0, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12])])
  let gKick = 0.8
  let gBreak = 0.47
  let gBass = 0.7
  let gClap = 0.7
  let gMaracas = 1
  let vPianoMin = 0.2
  let vPianoGauche = 0.4
  let vPiano = 0.5
  d1
    $ superimpose (const -- THE BEAT
      -- $ slow 4 -- l'attente
      $ s "k"
      # s "jazz"
      # lpf 1500
      # gain gKick
      )
    -- $ whenmod 64 32 (# gain 0)
    $ loopAt 2
    $ slice 8 (
      whenmod 8 6 (|> "6!7 7")
      "0 1*2 2 3 4*[1|2|4] 5 <6!3 7> 7"
      )
    $ s "break"
    # gain 0.65
  d3 -- Bassline
    $ fast 2
    $ note (scale "blues"
    ("<0!5 4 5 4>  . 2(<3!3 5>,8)")
     - 24)
    # s "supersaw"
    # voice 0.05
    # sustain "0.75 . 0.25 0.5"
    # gain gBass
    # hpf (slow 64 $ range 0 1000 sine)
  d4 -- Piano aigu fou
    $ mask "t(<1!4 2!4 4!24>,12)"
    $ whenmod 32 16 (often (off 0.125 (|+ note "[0,7]")))
    $ whenmod 4 3 (often (fast 2))
    $ n "0*16"
    # note (scale "blues" (
      "<0!2 [0 1] 0!2 [0 -1 -4]>"
      )
    + 24)
    # s "superpiano"
    # velocity (slow 64 $ range vPianoMin vPiano sine)

  d5 -- Accords main gauche
    $ stut' 4 (1/16) ((|+ 0). (|- velocity 0.05))
    $ note (scale "blues" "[0,<3 2 1 3 2 5 1 1 3 1 0 ~>]")
    # s "superpiano"
    # velocity (vPianoGauche)
    # sustain 2
  d8 -- maracas hombre
    $ whenmod 6 4 (fast 2)
    $ s "m(<3 5>,8)" # speed "[0.8|0.86|0.92]"
    # s "drum:3"
    # room 0.2 # sz 0.4 # dry (slow 100 $ range 0 5 sine)
    # gain gMaracas
  d6
    -- $ fast 2
    $ s "~ clap:1"
    # speed (slow 42 $ range 0.9 1.2 isaw)
    # gain gClap








-- V1: Bleu casse

do
let scale = getScale (scaleTable ++ [("blues", [0, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12])])
let gKick = 0.65
let gBreak = 0.45
let gBass = 0.5
let gClap = 0.7
let gMaracas = 0.8
let vPianoMin = 0.35
let vPianoGauche = 0.4
let vPiano = 0.5
d1
  $ superimpose (const -- THE BEAT
    $ slow 4 -- l'attente
    $ s "k*0"
    # s "jazz"
    # lpf 50
    # gain gKick
    )
  -- $ whenmod 64 32 (# gain 0)
  $ loopAt 2
  $ slice 8 (
    whenmod 32 28 (|> "0*4 1!2 7 6 8 ~ 8")
    $ whenmod 32 24 (|> "0 1 2!6")
    $ whenmod 16 15 (|> "0!6 [8 7]")
    $ whenmod 16 12 (|> "0 1 2 3*5")
    "0 <1 2> <2 1> 3 4*<1!4 2!4 4!24> [5 5?] 6*<1 2 4> <7!3 6>"
    )
  $ s "break"
  # gain gBreak
d3 -- Bassline
  $ note (scale "aeolian" (run 8)
   - 24)
  # s "supersaw" # voice 0.01
  # sustain "0.75 . 0.25 0.5"
  # gain gBass
  -- # hpf (slow 64 $ range 0 2500 sine)
d4 -- Piano aigu fou
  $ mask "t(<1!4 2!4 4!24>,4)"
  $ whenmod 32 16 (often (off 0.125 (|+ note "[0,7]")))
  $ whenmod 4 3 (often (fast 2))
  $ n "0*16"
  # note (scale "blues" (
    "<0!2 [0 1] 0!2 [0 -1 -4]>"
    )
  + 24)
  # s "superpiano"
  # velocity (slow 64 $ range vPianoMin vPiano sine)
d5 -- Accords main gauche
  $ stut' 4 (1/16) ((|+ 0). (|- velocity 0.05))
  $ note (scale "blues" "[0,<3 2 1 3 2 5 1 1 3 1 0 ~>]")
  # s "superpiano"
  # velocity (vPianoGauche)
  # sustain 2
d8 -- maracas hombre
  $ whenmod 6 4 (fast 2)
  $ s "m(<3 5>,8)" # speed "[0.8|0.86|0.92]"
  # s "drum:3"
  # room 0.2 # sz 0.4 # dry (slow 100 $ range 0 5 sine)
  # gain gMaracas
d6
  -- $ fast 2
  $ s "~ clap:1"
  # speed (slow 42 $ range 0.9 1.2 isaw)
  # gain gClap


once $ s "hh:9" # gain 1

d3
$ fast 4
$ s "drum:8" # gain 0.6

d4
$ iter 4
$ fast 3 $ n "<[0 1 2] [0 1]> . <0 1 2>"
# s "ho hc"
# gain 0.4

d5 $ s
