Skip to content

Commit

Permalink
Got the ambient thing working to the point where I can call it done. …
Browse files Browse the repository at this point in the history
…Started in on a thing for

live performance.

The ambient thing runs off the file temple.rns (Reason file) and temple.rb. It plays nice slow
ambient music until the end of time.

The live performance thing uses yurt.rb, yurt.rns, fuck.rns, and the files in live/. The live thing
can do chord progressions; everything else in this commit can also do key changes, basslines, etc.,
I think that was all in the last commit and since then I've only been tweaking the ambient one to
make it sound better, but I'm not really sure. The past few days have involved a lot of last-minute
logistical panicking.

This process, getting stuff ready, is uncovering loads of flaws. I've got a to-do list going on.
Maybe upgrade to a Lighthouse account near-future.

The chord progressions work pretty well. It's actually almost at a point of sounding good for the
dance music use case when you just leave it running. The goal is this is something I can play live
and tweak. In practice it's not totally there yet. I might be able to hack on it *at* Burning Man
but it seems unlikely, given the cost, the once-a-year-ness, the it-only-it-happens-here-ness, the
general wonder and indescribability, the fact that many of the women are topless, and the fact that
I can hack on my laptop more or less anywhere anytime.

Burning Man is kind of the opposite of Hollywood in that it's a very, very failure-tolerant
environment for artistic experiments. Obviously this only applies to the art side of things; the
desert is not failure-tolerant from a survival point of view at all. But my point is, this live
stuff, I knew it would be good enough for a one-hour live set in a failure-tolerant artistic
environment. I'm beginning to see how it can become good enough for hour-plus live sets in highly
*competitive* artistic environments in the reasonably near future.
  • Loading branch information
gilesbowkett committed Aug 24, 2008
1 parent 150acc4 commit 5abd15a
Show file tree
Hide file tree
Showing 11 changed files with 282 additions and 28 deletions.
14 changes: 8 additions & 6 deletions ethniq.rb
Expand Up @@ -22,11 +22,13 @@ def note(midi_note_number, channel)
end

notes = []
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number, 4),
:when => L{|beat| false},
:number_generator => L{rand},
:next => L{|queue| queue[rand(queue.size)]},
:probabilities => probabilities[midi_note_number] || probabilities[:none])
if rand > 0.75
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number, 4),
:when => L{|beat| false},
:number_generator => L{rand},
:next => L{|queue| queue[rand(queue.size)]},
:probabilities => probabilities[midi_note_number] || probabilities[:none])
end
end
notes
14 changes: 8 additions & 6 deletions forest_sounds.rb
Expand Up @@ -22,11 +22,13 @@ def note(midi_note_number, channel)
end

notes = []
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number, 5),
:when => L{|beat| false},
:number_generator => L{rand},
:next => L{|queue| queue[rand(queue.size)]},
:probabilities => probabilities[midi_note_number] || probabilities[:none])
if rand > 0.85
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number, 5),
:when => L{|beat| false},
:number_generator => L{rand},
:next => L{|queue| queue[rand(queue.size)]},
:probabilities => probabilities[midi_note_number] || probabilities[:none])
end
end
notes
71 changes: 62 additions & 9 deletions harmonic_cycle.rb
Expand Up @@ -2,32 +2,85 @@
$mutation = L{|measure| 0 == (measure - 1) % 2}
$measures = 4

root = OCTAVES[2].to_a[SCALE[CIRCLE_OF_FIFTHS.next]]
puts root
@root = OCTAVES[2].to_a[SCALE[[CIRCLE_OF_FIFTHS,CIRCLE_OF_FOURTHS][rand(2)].next]]

def note(midi_note_number, channel)
def midi_note(midi_note_number, channel, duration)
Note.create(:channel => channel,
:number => midi_note_number,
:duration => 3.00,
:duration => duration,
:velocity => 100 + rand(27))
end

notes = []
bass = Drum.new(:note => note(root - 36, 1),
bass = Drum.new(:note => midi_note(@root - 36, 1, 3.00),
:when => L{|beat| false},
:next => L{|queue| queue[queue.size - 1]},
:number_generator => L{rand},
:probabilities => [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0])
notes << bass
bass5th = Drum.new(:note => midi_note((@root - 36) + 5, 1, 3.00),
:when => L{|beat| false},
:next => L{|queue| queue[queue.size - 1]},
:number_generator => L{rand},
:probabilities => [0.0, 0.0, 0.0, 0.0, 0.15, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.15, 0.0])
notes << bass5th

# channel 9 is the easter egg!
pad_channel = [2,2,2,2,2,2,2,2,
7,7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8,
9,
10,10,10,10,10,10,10,
11,11,11,11,11,11,11,11][rand(41)] # 11 is unassigned - sometimes it's silent
# pad_channel = 8
MAJOR_TRIAD.each do |number|
notes << Drum.new(:note => note(root + number, 2),
notes << Drum.new(:note => midi_note(@root + number, pad_channel, 3.00),
:when => L{|beat| false},
:next => L{|queue| queue[queue.size - 1]},
:number_generator => L{rand},
:probabilities => [1.0] + [0.0] * 15)
end

def temple_bells
boost = {}
# (0..11).each {|note| boost[note] = 0.0}
# MAJOR_SCALE.each {|note| boost[note] += 0.05}
# root = MAJOR_SCALE[0] ; boost[root] += 0.2
MAJOR_TRIAD.each {|note| boost[note] = 0.1}

rhythm = [0.0, 0.0, 0.5, 0.0,
0.25, 0.0, 0.0, 0.0,
0.25, 0.0, 0.75, 0.0,
0.0, 0.05, 0.0, 0.05]

bells = {}
boost.keys.each do |note|
bells[note] = rhythm.collect {|probability| probability + boost[note]}
end
notes

elevated_root = 60 + @root
wtf = []
bells.each do |note, probabilities|
next unless rand > 0.7
wtf << Drum.new(:note => midi_note(elevated_root + note, 6, 0.25),
:when => L{|beat| false},
:next => L{|queue| queue[queue.size - 1]},
:number_generator => L{rand},
:probabilities => probabilities)
end
wtf.compact
wtf
end

notes += temple_bells



# def temple_bells ; do(:awesome).stuff ; end
# notes << temple_bells






# this file expected to return array of notes!
notes
53 changes: 53 additions & 0 deletions live/db_drum_definition.rb
@@ -0,0 +1,53 @@
$clock.bpm = 170
$mutation = L{|measure| 0 == (measure - 1) % 2}
$measures = 4

probabilities = {}

probabilities[:none] = [0.0] * 16
probabilities[:all] = [1.0] * 16

# hip-hop
# probabilities[36] = [1.0, 0.0, 0.5, 0.25, 0.0, 0.6, 0.0, 0.9, 0.9, 0.0, 1.0, 0.0, 0.5, 0.0, 0.3, 0.0]
# probabilities[37] = [0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.0, 1.0, 0.0, 0.0, 0.0]

# d&b
probabilities[36] = [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]
probabilities[37] = [0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0]

# both
probabilities[38] = [0.2, 0.0, 0.3, 0.0, 0.3, 0.1, 0.3, 0.4, 0.0, 0.0, 0.2, 0.0, 0.4, 0.0, 0.0, 0.0]
probabilities[39] = [0.3, 0.0, 0.2, 0.6, 0.1, 0.0, 0.4, 0.1, 0.35, 0.15, 0.0, 0.0, 0.2, 0.0, 0.1, 0.0]
probabilities[40] = [0.0, 0.0, 0.2, 0.0, 0.4, 0.0, 0.0, 0.0, 0.2, 0.0, 0.3, 0.0, 0.3, 0.1, 0.3, 0.4]
probabilities[41] = [0.76, 0.0, 0.23, 0.0, 0.0, 0.0, 0.67, 0.0, 0.15, 0.0, 0.15, 0.0, 0.49, 0.0, 0.15, 0.0]
probabilities[42] = [0.75, 0.0, 0.13, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.13, 0.0, 0.23, 0.0, 0.0, 0.35, 0.0]
probabilities[43] = [0.9] * 16
probabilities[44] = [0.65] * 16
probabilities[45] = [0.85, 0.35] * 8

# 0 DO NOT USE!
# 14 Roni Size
# 15 alt Roni (thuddier)


def note(midi_note_number)
Note.create(:channel => 14,
:number => midi_note_number,
:duration => 0.25,
:velocity => 100 + rand(27))
end

notes = []
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number),
:when => L{|beat| false},
:number_generator => L{0.5},
:next => L{|queue| queue[queue.size - 1]},
# :number_generator => L{rand},
# :next => L{|queue| queue[rand(queue.size)]},
:probabilities => probabilities[midi_note_number] || probabilities[:none])
end
notes

# to send nothing
# []
118 changes: 118 additions & 0 deletions live/harmonic_cycle.rb
@@ -0,0 +1,118 @@
# chord progression and choice of key
reload = L{|key| puts "reload" ; @key = OCTAVES[2].to_a[SCALE[[CIRCLE_OF_FIFTHS,CIRCLE_OF_FOURTHS][rand(2)].next]]}
i = L{|key| puts "I" ; key}
iv = L{|key| puts "IV" ; key + 5}
v = L{|key| puts "V" ; key + 7}

@chord_progression ||= [reload, i, iv, v] + ([i, i, iv, v] * 15)
@chord_progression ||= [reload, i, i, i, iv, iv, v, v] + ([i, i, i, i, iv, iv, v, v] * 3)
@chord_progression ||= [v, v, i, reload]
#
# @key ||= OCTAVES[2].to_a[SCALE[[CIRCLE_OF_FIFTHS,CIRCLE_OF_FOURTHS][rand(2)].next]]
@root = @chord_progression.next[@key]


# choice of pad channel

# channel 9 is the easter egg!
pad_channel = [2,2,2,2,2,2,2,2,
7,7,7,7,7,7,7,7,7,
10,10,10,10,10,10,
9,
11,11,11,11,11][rand(29)] # 11 is unassigned - sometimes it's silent
pad_channel = 10













def midi_note(midi_note_number, channel, duration)
Note.create(:channel => channel,
:number => midi_note_number,
:duration => duration,
:velocity => 100 + rand(27))
end

notes = []
bass = Drum.new(:note => midi_note(@root - 24, 1, 0.5),
:when => L{|beat| false},
:next => L{|queue| queue[queue.size - 1]},
:number_generator => L{rand},
:probabilities => [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0])
notes << bass
bass5th = Drum.new(:note => midi_note((@root - 24) + 5, 1, 0.5),
:when => L{|beat| false},
:next => L{|queue| queue[queue.size - 1]},
:number_generator => L{rand},
:probabilities => [0.0, 0.0, 0.0, 0.0, 0.15, 0.0, 0.0, 0.0, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.15, 0.0])
notes << bass5th

MAJOR_7TH.each do |number|
notes << Drum.new(:note => midi_note(@root + number, pad_channel, 1.00), # hack!
:when => L{|beat| false},
:next => L{|queue| queue[queue.size - 1]},
:number_generator => L{rand},
:probabilities => [0.5] + [0.0] * 15)
end











def temple_bells
boost = {}
# (0..11).each {|note| boost[note] = 0.0}
# MAJOR_SCALE.each {|note| boost[note] += 0.05}
# root = MAJOR_SCALE[0] ; boost[root] += 0.2
MAJOR_7TH.each {|note| boost[note] = 0.1}

rhythm = [0.0, 0.0, 0.5, 0.0,
0.25, 0.0, 0.0, 0.0,
0.25, 0.0, 0.75, 0.0,
0.0, 0.05, 0.0, 0.05]

bells = {}
boost.keys.each do |note|
bells[note] = rhythm.collect {|probability| probability + boost[note]}
end

elevated_root = 60 + @root
wtf = []
bells.each do |note, probabilities|
# next unless rand > 0.7
wtf << Drum.new(:note => midi_note(elevated_root + note, 6, 0.25),
:when => L{|beat| false},
:next => L{|queue| queue[queue.size - 1]},
:number_generator => L{rand},
:probabilities => probabilities)
end
wtf.compact
wtf
end

notes += temple_bells









# this file expected to return array of notes!
notes
Binary file added music_software_files/fuck.rns
Binary file not shown.
Binary file modified music_software_files/temple.rns
Binary file not shown.
Binary file added music_software_files/yurt.rns
Binary file not shown.
2 changes: 1 addition & 1 deletion temple.rb
Expand Up @@ -2,7 +2,7 @@

require 'lib/archaeopteryx'

$clock = Clock.new(60)
$clock = Clock.new(30)
$mutation = L{|measure| 0 == (measure - 1) % 2}
$measures = 4

Expand Down
14 changes: 8 additions & 6 deletions xanadu.rb
Expand Up @@ -22,11 +22,13 @@ def note(midi_note_number, channel)
end

notes = []
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number, 3),
:when => L{|beat| false},
:number_generator => L{rand},
:next => L{|queue| queue[rand(queue.size)]},
:probabilities => probabilities[midi_note_number] || probabilities[:none])
if rand > 0.95
(36..45).each do |midi_note_number|
notes << Drum.new(:note => note(midi_note_number, 3),
:when => L{|beat| false},
:number_generator => L{rand},
:next => L{|queue| queue[rand(queue.size)]},
:probabilities => probabilities[midi_note_number] || probabilities[:none])
end
end
notes
24 changes: 24 additions & 0 deletions yurt.rb
@@ -0,0 +1,24 @@
# cycle through the circle of fifths

require 'lib/archaeopteryx'

$clock = Clock.new(30)
$mutation = L{|measure| 0 == (measure - 1) % 2}
$measures = 4

@loop = Arkx.new(:clock => $clock, # rename Arkx to Loop
:measures => $measures,
:logging => false,
:evil_timer_offset_wtf => 0.2,
:generator => Mix.new(:rhythms => [Rhythm.new(:drumfile => "live/db_drum_definition.rb",
:mutation => $mutation),
Rhythm.new(:drumfile => "live/harmonic_cycle.rb",
:mutation => L{|measure| 0 == (measure - 1) % 16}),]))
# Rhythm.new(:drumfile => "forest_sounds.rb",
# :mutation => L{|measure| 0 == (measure - 1) % 16}),
# Rhythm.new(:drumfile => "ethniq.rb",
# :mutation => L{|measure| 0 == (measure - 1) % 16})]))
@loop.go


# also, play random atmospheric samples

0 comments on commit 5abd15a

Please sign in to comment.