Module: Generators
- Defined in:
- lib/melody_object/Generators.rb
Overview
top –> gotimeobject (which dictates when to play the children)
_________|________
| | | | |
Instance Method Summary collapse
- #aadd ⇒ Object
- #deoun ⇒ Object
- #du ⇒ Object
- #dum ⇒ Object
- #dunn ⇒ Object
- #duom ⇒ Object
- #eu ⇒ Object
- #g_aadd ⇒ Object
- #g_aadd2 ⇒ Object
- #g_combin(ary) ⇒ Object
- #g_comeon ⇒ Object
- #g_comeon10 ⇒ Object
- #g_comeon11 ⇒ Object
- #g_comeon2 ⇒ Object
- #g_comeon3 ⇒ Object
- #g_comeon4(ary) ⇒ Object
- #g_comeon40(ary) ⇒ Object
- #g_comeon41(v, len = 1) ⇒ Object
- #g_comeon4a(ary) ⇒ Object
- #g_comeon5 ⇒ Object
- #g_comeon50 ⇒ Object
- #g_comeon51 ⇒ Object
- #g_comeon55 ⇒ Object
- #g_comeon56 ⇒ Object
- #g_comeon6 ⇒ Object
- #g_comeon60 ⇒ Object
- #g_comeon7(x) ⇒ Object
- #g_comeon70 ⇒ Object
- #g_comeon77 ⇒ Object
- #g_comeon8 ⇒ Object
- #g_comeon9 ⇒ Object
- #g_comeonblu5 ⇒ Object
- #g_popp ⇒ Object
- #infun(fun, len, gran, *ary) ⇒ Object
- #l_load(obj) ⇒ Object
- #l_loaded ⇒ Object
- #l_loaded2 ⇒ Object
- #l_loaded3 ⇒ Object
- #l_loaded4 ⇒ Object
- #l_loaded5 ⇒ Object
- #makeinstances(fun, num) ⇒ Object
- #objfromarys(noteary, timingary, len) ⇒ Object
- #rd ⇒ Object
- #s(*arr) ⇒ Object
- #s_topp ⇒ Object
- #seoun ⇒ Object
- #si(fun, num = 1) ⇒ Object
- #sounn(note, gran, len) ⇒ Object
- #ssoun ⇒ Object
- #sta ⇒ Object
- #stedy ⇒ Object
- #stopthread ⇒ Object
- #t(*arr) ⇒ Object
- #wu ⇒ Object
Instance Method Details
#aadd ⇒ Object
481 482 483 484 485 486 487 488 489 490 491 492 |
# 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 ⇒ Object
52 53 54 |
# File 'lib/melody_object/Generators.rb', line 52 def deoun infun('sounn',16,16,71,65,74,65).a 2 end |
#du ⇒ Object
178 179 180 181 |
# File 'lib/melody_object/Generators.rb', line 178 def du a=g_combin(['wu','g_comeonblu5']) return a end |
#dum ⇒ Object
610 611 612 |
# File 'lib/melody_object/Generators.rb', line 610 def dum infun('sounn',16,0) end |
#dunn ⇒ Object
614 615 616 |
# File 'lib/melody_object/Generators.rb', line 614 def dunn infun('sounn',64,0) end |
#duom ⇒ Object
57 58 59 |
# File 'lib/melody_object/Generators.rb', line 57 def duom infun('sounn',64,128,47) end |
#eu ⇒ Object
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# 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 ⇒ Object
332 333 334 335 336 337 338 339 340 341 342 343 |
# 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 ⇒ Object
346 347 348 349 350 351 352 353 354 355 356 357 |
# 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) ⇒ Object
203 204 205 206 207 208 209 210 |
# 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 ⇒ Object
496 497 498 499 500 501 502 503 |
# 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 ⇒ Object
361 362 363 364 365 |
# File 'lib/melody_object/Generators.rb', line 361 def g_comeon10 topp=Section.new(5) topp.addon(g_comeon5) return topp end |
#g_comeon11 ⇒ Object
323 324 325 326 327 |
# File 'lib/melody_object/Generators.rb', line 323 def g_comeon11 topp=Section.new topp=g_comeon10 end |
#g_comeon2 ⇒ Object
438 439 440 441 442 443 444 445 446 447 448 |
# 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 ⇒ Object
455 456 457 458 459 460 |
# 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) ⇒ Object
414 415 416 417 418 419 420 421 422 423 424 |
# 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) ⇒ Object
288 289 290 291 292 293 |
# 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) ⇒ Object
89 90 91 92 93 94 |
# 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) ⇒ Object
426 427 428 429 430 431 432 433 434 435 436 |
# 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 ⇒ Object
403 404 405 406 407 408 409 410 411 412 |
# 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 ⇒ Object
259 260 261 262 263 264 265 266 267 268 269 |
# 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 ⇒ Object
247 248 249 250 251 252 253 254 255 256 257 |
# 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 ⇒ Object
234 235 236 237 238 239 240 241 242 243 244 245 |
# 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 ⇒ Object
272 273 274 275 276 277 278 279 280 281 282 |
# 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 ⇒ Object
394 395 396 397 398 399 |
# 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 ⇒ Object
309 310 311 312 313 314 315 316 317 318 319 |
# 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) ⇒ Object
385 386 387 388 389 390 391 392 |
# 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 ⇒ Object
296 297 298 299 300 301 302 303 304 305 306 307 |
# 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 ⇒ Object
228 229 230 231 232 |
# File 'lib/melody_object/Generators.rb', line 228 def g_comeon77 s=Section.new s.create_notes(4,:none) return s end |
#g_comeon8 ⇒ Object
378 379 380 381 382 |
# 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 ⇒ Object
367 368 369 370 371 372 373 374 |
# 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 ⇒ Object
212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# 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 ⇒ Object
573 574 575 576 577 |
# 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) ⇒ Object
61 62 63 64 65 66 67 |
# 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) ⇒ Object
550 551 552 553 554 555 556 |
# 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 ⇒ Object
519 520 521 522 523 524 525 526 527 528 529 530 531 532 |
# 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 ⇒ Object
534 535 536 537 538 539 540 541 542 543 544 545 546 547 |
# 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 ⇒ Object
558 559 560 561 562 563 564 565 566 567 568 569 570 571 |
# 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 ⇒ Object
579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
# 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 ⇒ Object
594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
# 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) ⇒ Object
25 26 27 28 29 30 |
# 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) ⇒ Object
96 97 98 99 100 101 102 103 |
# 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 ⇒ Object
39 40 41 |
# File 'lib/melody_object/Generators.rb', line 39 def rd rand(5)+40 end |
#s(*arr) ⇒ Object
151 152 153 154 155 |
# 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 ⇒ Object
469 470 471 472 473 474 475 476 477 478 479 |
# 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 ⇒ Object
47 48 49 50 |
# 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) ⇒ Object
32 33 34 35 36 37 |
# 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) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 |
# 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 ⇒ Object
43 44 45 |
# File 'lib/melody_object/Generators.rb', line 43 def ssoun s(seoun,deoun) end |
#sta ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# 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 ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 138 139 |
# 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 ⇒ Object
462 463 464 465 466 |
# File 'lib/melody_object/Generators.rb', line 462 def stopthread stopthread=Threadset.new stopthread.addon(s_topp,aadd) return stopthread end |
#t(*arr) ⇒ Object
142 143 144 145 146 147 148 149 |
# 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 ⇒ Object
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# 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 |