module Generators

top   --> gotimeobject (which dictates when to play the children)

_|__ | | | | |

Public Instance Methods

aadd() click to toggle source
# File lib/melody_object/Generators.rb, line 481
def aadd
  aadd=Section.new
2.times do
  # two different a's, which make up aadd
 a=Section.new(4) 
a.create_notes(16,:low)
a.makechannel 1
a=a.array_out(4)
aadd.addon(a)
end
return aadd
end
deoun() click to toggle source
# File lib/melody_object/Generators.rb, line 52
def deoun
  infun('sounn',16,16,71,65,74,65).a 2
  end
du() click to toggle source
# File lib/melody_object/Generators.rb, line 178
def du
  a=g_combin(['wu','g_comeonblu5'])
  return a
end
dum() click to toggle source
# File lib/melody_object/Generators.rb, line 610
def dum
  infun('sounn',16,0)
end
dunn() click to toggle source
# File lib/melody_object/Generators.rb, line 614
def dunn
  infun('sounn',64,0)
  end
duom() click to toggle source
# File lib/melody_object/Generators.rb, line 57
def duom
  infun('sounn',64,128,47)
end
eu() click to toggle source
# File lib/melody_object/Generators.rb, line 159
  def eu
  
r=[4,2,2,2,2,2,2,2,2,2,2,2,2,4]
x=GotimeObject.new(r)
topp=Section.new(x)
topp.name='toppy'

ary=[41,42,42,42,41,42,42,42,41,42,42,42,rand(6)+47,47]
ary.each {|d|
topp.addon g_comeon41(d)
}
topp.makechannel 1
#~ topp=topp.array_out(8)
return topp
end
g_aadd() click to toggle source
# File lib/melody_object/Generators.rb, line 332
def g_aadd
  aadd=Section.new
2.times do
  # two different a's, which make up aadd
 a=Section.new(16) 
a.create_specific_notes(x=[40])
a.makechannel 1
a=a.array_out(4)
aadd.addon(a)
end
return aadd
end
g_aadd2() click to toggle source
# File lib/melody_object/Generators.rb, line 346
def g_aadd2
  aadd=Section.new
2.times do
  # two different a's, which make up aadd
 a=Section.new(3) 
a.create_specific_notes(x=[54])
a.makechannel 1
a=a.array_out(4)
aadd.addon(a)
end
return aadd
end
g_combin(ary) click to toggle source
# File lib/melody_object/Generators.rb, line 203
def g_combin(ary)
  don=Section.new
  aadd=Threadset.new
  ary.each{|s|
    aadd.addon(eval(s))}
  don.addon(aadd)
return don
end
g_comeon() click to toggle source
# File lib/melody_object/Generators.rb, line 496
def g_comeon

topp=Section.new(4)
stopp=Section.new

topp.create_notes(16,:drum1)
stopp=topp
end
g_comeon10() click to toggle source
# File lib/melody_object/Generators.rb, line 361
def g_comeon10
  topp=Section.new(5)
  topp.addon(g_comeon5)
return topp
end
g_comeon11() click to toggle source
# File lib/melody_object/Generators.rb, line 323
def g_comeon11
  topp=Section.new
  topp=g_comeon10

end
g_comeon2() click to toggle source
# File lib/melody_object/Generators.rb, line 438
def g_comeon2


topp=Section.new(6)
stopp=Section.new

topp.create_notes(16,:drum1)

stopp=topp

end
g_comeon3() click to toggle source
# File lib/melody_object/Generators.rb, line 455
def g_comeon3
  stopp=Section.new
stopp.addon(stopthread)
stopp=stopp.array_out(2)

end
g_comeon4(ary) click to toggle source
# File lib/melody_object/Generators.rb, line 414
def g_comeon4(ary)


topp=Section.new(ary[0])
stopp=Section.new

topp.create_notes(ary[1],:drum1)

stopp=topp

end
g_comeon40(ary) click to toggle source
# File lib/melody_object/Generators.rb, line 288
def g_comeon40(ary)
topp=Section.new(ary[0])
topp.create_specific_notes(ary[1])
topp.makechannel 1
return topp
end
g_comeon41(v,len=1) click to toggle source
# File lib/melody_object/Generators.rb, line 89
def g_comeon41(v,len=1)
topp=Section.new
topp.name=v.to_s
topp.create_specific_notes(v,len)
return topp
end
g_comeon4a(ary) click to toggle source
# File lib/melody_object/Generators.rb, line 426
def g_comeon4a(ary)


topp=Section.new(ary[0])
stopp=Section.new

topp.create_notes(ary[1],:none)

stopp=topp

end
g_comeon5() click to toggle source
# File lib/melody_object/Generators.rb, line 403
def g_comeon5

topp=Section.new

ary=[[1,1],[1,1],[1,1],[1,1]]
ary.each {|d|
topp.addon g_comeon4(d)
}
return topp
end
g_comeon50() click to toggle source
# File lib/melody_object/Generators.rb, line 259
def g_comeon50
r=[4,6,8,14,16]
x=GotimeObject.new(r)
topp=Section.new(x)
topp.name='toppy'
ary=[42,42,45,43,44]
ary.each {|d|
topp.addon g_comeon41(d)
}
return topp
end
g_comeon51() click to toggle source
# File lib/melody_object/Generators.rb, line 247
def g_comeon51
r=[4,8,14,16]
x=GotimeObject.new(r)
topp=Section.new(x)
topp.name='toppy'
ary=[42,45,43,44]
ary.each {|d|
topp.addon g_comeon41(d)
}
return topp
end
g_comeon55() click to toggle source
# File lib/melody_object/Generators.rb, line 234
def g_comeon55
r=[8,16]
x=GotimeObject.new(r)
topp=Section.new(x)
topp.name='toppy'
ary=[41,41]
ary.each {|d|
topp.addon g_comeon41(d)
}
#~ topp=topp.array_out(8)
return topp
end
g_comeon56() click to toggle source
# File lib/melody_object/Generators.rb, line 272
def g_comeon56
r=[4,6,8,10,12,14,16]
x=GotimeObject.new(r)
topp=Section.new(x)
topp.name='toppy'
ary=[42,42,45,45,45,44,44]
ary.each {|d|
topp.addon g_comeon41(d)
}
return topp
end
g_comeon6() click to toggle source
# File lib/melody_object/Generators.rb, line 394
def g_comeon6
  topp=Section.new(2)
  2.times do topp.addon(g_comeon5) end
  c=topp.array_out(4)
  return c
end
g_comeon60() click to toggle source
# File lib/melody_object/Generators.rb, line 309
def g_comeon60

topp=Section.new

ary=[[4,[41]],[2,[40]],[2,[40]]]
ary.each {|d|
topp.addon g_comeon40(d)
}
topp=topp.array_out(8)
return topp
end
g_comeon7(x) click to toggle source
# File lib/melody_object/Generators.rb, line 385
def g_comeon7(x)
  topp=Section.new
  a=eval(x)  #how do i make the function the variable?
  b=eval(x)
  ary=[a,b,a.uf,b.uf]
 ary.each {|d| topp.addon(d)}
  return topp
end
g_comeon70() click to toggle source
# File lib/melody_object/Generators.rb, line 296
def g_comeon70

topp=Section.new
x=45
ary=[[1,[45]],[10,[38]],[14,[43]],[1,[44]]]
ary.each {|d|
topp.addon g_comeon40(d)
}
topp.makechannel 0
topp=topp.array_out(8)
return topp
end
g_comeon77() click to toggle source
# File lib/melody_object/Generators.rb, line 228
def g_comeon77
  s=Section.new
  s.create_notes(4,:none)
  return s
end
g_comeon8() click to toggle source
# File lib/melody_object/Generators.rb, line 378
def g_comeon8
  topp=Section.new
  2.times {topp.addon(g_comeon7('g_comeon6'))}
  return topp
end
g_comeon9() click to toggle source
# File lib/melody_object/Generators.rb, line 367
def g_comeon9
  topp=Section.new
  ts=Threadset.new
  topp.addon(ts)
  a=[1,16]
  ts.addon(g_comeon8,g_comeon4a(a))
return topp
end
g_comeonblu5() click to toggle source
# File lib/melody_object/Generators.rb, line 212
def g_comeonblu5
r=[4,6,8,10,12,14,16,18,20,22,24,26,28,32]
x=GotimeObject.new(r)
topp=Section.new(x)
topp.name='toppy'

ary=[41,42,42,42,41,42,42,42,41,42,42,42,49,47]
ary.each {|d|
topp.addon g_comeon41(d)
}
topp.makechannel 1
#~ topp=topp.array_out(8)
return topp
end
g_popp() click to toggle source
# File lib/melody_object/Generators.rb, line 573
def g_popp
  popp=Section.new
  popp.addon(l_loaded3,stopthread,l_loaded3)
  return popp
end
infun(fun,len,gran,*ary) click to toggle source
# File lib/melody_object/Generators.rb, line 61
def infun(fun,len,gran,*ary)
  s=Section.new
  ary.each do |i|
    s.addon(eval(fun+"("+i.to_s+","+gran.to_s+","+len.to_s+")"))
  end
  return s
end
l_load(obj) click to toggle source
# File lib/melody_object/Generators.rb, line 550
def l_load(obj)
  stopp=Section.new
   a=File.open("trax/eoms/#{obj}.dat") do |g|
     Marshal.load(g)
   end
stopp=a
end
l_loaded() click to toggle source
# File lib/melody_object/Generators.rb, line 519
def l_loaded

stopp=Section.new

dall=['rund-gqscvh']

 dall.each do |f|
   a=File.open("trax/eoms/#{f}.dat") do |g|
     Marshal.load(g)
   end
stopp=a
end
loaded=stopp
end
l_loaded2() click to toggle source
# File lib/melody_object/Generators.rb, line 534
def l_loaded2

stopp=Section.new

dall=['rund-gud']

 dall.each do |f|
   a=File.open("eooms/#{f}.dat") do |g|
     Marshal.load(g)
   end
stopp=a
end
loaded=stopp
end
l_loaded3() click to toggle source
# File lib/melody_object/Generators.rb, line 558
def l_loaded3

stopp=Section.new

dall=['rund-nyce']

 dall.each do |f|
   a=File.open("eooms/#{f}.dat") do |g|
     Marshal.load(g)
   end
stopp=a
end
loaded=stopp
end
l_loaded4() click to toggle source
# File lib/melody_object/Generators.rb, line 579
def l_loaded4

stopp=Section.new

dall=['rund-fsp']

 dall.each do |f|
   a=File.open("eooms/#{f}.dat") do |g|
     Marshal.load(g)
   end
stopp=a
end
loaded=stopp
end
l_loaded5() click to toggle source
# File lib/melody_object/Generators.rb, line 594
def l_loaded5

stopp=Section.new

dall=['rund-natt']

 dall.each do |f|
   a=File.open("eooms/#{f}.dat") do |g|
     Marshal.load(g)
   end
stopp=a
end
loaded=stopp
end
makeinstances(fun,num) click to toggle source
# File lib/melody_object/Generators.rb, line 25
def makeinstances(fun,num)
  ary=[]

  1.upto(num) {|instance| ary[instance-1]=eval(fun)}
return ary
end
objfromarys(noteary,timingary,len) click to toggle source
# File lib/melody_object/Generators.rb, line 96
def objfromarys(noteary,timingary,len)
    x=GotimeObject.new(timingary)
  topp=Section.new(x)
  noteary.each {|d| topp.addon g_comeon41(d,len)}
     #~ $fyl.puts timingary.join(',')
  return topp
  
  end
rd() click to toggle source
# File lib/melody_object/Generators.rb, line 39
def rd
  rand(5)+40
end
s(*arr) click to toggle source
# File lib/melody_object/Generators.rb, line 151
def s(*arr)
  don=Section.new
  arr.each{|d| don.addon(d)}
  return don
end
s_topp() click to toggle source
# File lib/melody_object/Generators.rb, line 469
def s_topp
  s_topp=Section.new
  2.times do
  t_tset=Threadset.new
t_tset.addon(g_comeon,g_comeon2)
#~ z=z.array_out(2)
#~ stopp.addon(x,y)
s_topp.addon(t_tset)
end
return s_topp
end
seoun() click to toggle source
# File lib/melody_object/Generators.rb, line 47
def seoun
  infun('sounn',64,64,60,52,60,52)
  #~ return s(sounn(34),sounn(30),sounn(34),sounn(30))
end
si(fun,num=1) click to toggle source
# File lib/melody_object/Generators.rb, line 32
def si(fun,num=1)
  s=makeinstances(fun,num)
  d=Section.new
  s.each{|e| d.addon(e)}
  return d
end
sounn(note,gran,len) click to toggle source
# File lib/melody_object/Generators.rb, line 71
def sounn(note,gran,len)
  timingary=[]
  noteary=[]
  0.upto(0) {
  noteary.push(note)
  timingary.push(gran)
  }

  a=objfromarys(noteary,timingary,len)
  a.makechannel 3
  return a
end
ssoun() click to toggle source
# File lib/melody_object/Generators.rb, line 43
def ssoun
  s(seoun,deoun)
  end
sta() click to toggle source
# File lib/melody_object/Generators.rb, line 108
def sta
  timingary=[]
  noteary=[]
  fee=rand(4)+1
  feei=fee
  rdi=rd
  
 0.upto(fee) {timingary.push(8/feei)}
  x=GotimeObject.new(timingary)
  topp=Section.new(x)
  noteary[0]=rd
  1.upto(fee-1) {noteary.push(rdi)}
  noteary.push(rd)
  noteary.each {|d| topp.addon g_comeon41(d)}
     #~ $fyl.puts timingary.join(',')
  return topp

  end
stedy() click to toggle source
# File lib/melody_object/Generators.rb, line 127
def stedy
    timingary=[]
  noteary=[]
  fee=15
  0.upto(fee) {timingary.push(1)}
  x=GotimeObject.new(timingary)
  topp=Section.new(x)
  0.upto(fee-1) {noteary.push(0)}
  noteary.push(42)
  noteary.each {|d| topp.addon g_comeon41(d)}

  return topp
  end
stopthread() click to toggle source
# File lib/melody_object/Generators.rb, line 462
def stopthread
  stopthread=Threadset.new
stopthread.addon(s_topp,aadd)
return stopthread
end
t(*arr) click to toggle source
# File lib/melody_object/Generators.rb, line 142
def t(*arr)
  don=Section.new
  aadd=Threadset.new
  arr.each{|s|
    aadd.addon(s)}
  don.addon(aadd)
return don
  end
wu() click to toggle source
# File lib/melody_object/Generators.rb, line 185
def wu
  #~ s=Section.new
  a=g_combin(['g_comeon55','g_comeon51'])
  a=a.array_out(4)
  t=g_combin(['g_comeon55','g_comeon50'])
  t=t.array_out(4)
  z=g_combin(['g_comeon55','g_comeon56'])
  z=z.array_out(64)
  s=Section.new
  s.addon(a,t)
  s=s.array_out(8)
  s.addon(z)
  #~ s=s.array_out 8
   #~ s.addon(g_comeon60,d)
   #~ s.makechannel 1
return s
end