import guy import gal import copy import wave import pickle from array import array import struct smoothie = 77 h_m_s = 120*44100 def l2h(t): h_t = array('h') for i in t: h_t.append(i) return h_t # [fartnuc, 0=free,1=fix,2=-,3=+,[L,R]] # smaller the bigger # doesnt have to be in this order nuc = [ [gal.She(),0,[100,100]], [guy.Sa(),0,[777,777]], [guy.Ri(),4,[777,777]], [guy.Ga(),0,[777,777]], [guy.Ma(),0,[777,777]], [guy.Pa(),0,[777,777]], [guy.Da(),0,[777,777]], [guy.Ni(),0,[777,777]] ] n_len = len(nuc) what = [] where = 0 #use copy.hardcopy to keep the default #[start,every,[[which,seven,press],[which,seven,press]],till] yin = [ [0,50000,h_m_s,[[4,1,[smoothie,smoothie]],[5,1,[smoothie,smoothie]],[2,4,[700,700]],[6,0,[500,600]]]], [29000,50000,h_m_s,[[2,1,[100,100]],[7,0,[150,150]]]], [30000,50000,h_m_s,[[4,0,[200,300]],[5,0,[300,200]],[6,2,[700,700]]]] ] #mayb can generate this base automatically #ippatsu #[where,[[which,seven,press],[which,seven,press]]] yang = [ [int(1.4*44100),[[0,0,[smoothie,smoothie+10]]]], [int(30.8*44100),[[0,0,[smoothie+10,smoothie]]]], [int(80.9*44100),[[0,0,[smoothie,smoothie+30]]]], [int(110.3*44100),[[0,0,[smoothie+30,smoothie]]]], [int(150.7*44100),[[0,0,[smoothie,smoothie]]]] ] for i in yin: for f in range(i[0],i[2],i[1]): yang.append([f,copy.deepcopy(i[3])]) yang.sort() filter = 35753 wy = 0 groove = [0,0] a_stereo = [32767,32767] for f in range(h_m_s): if f == yang[wy][0]: for i in yang[wy][1]: print("yang update") nuc[i[0]][1] = i[1] nuc[i[0]][2] = i[2] wy = wy+1 for n in nuc: if n[1] == 4: continue song = n[0].sing() for s in range(2): if (n[0].heshe == "guy" and song > 0) or (n[0].heshe == "gal" and song[s] > 0): v = (65534-a_stereo[s])/n[2][s] else: v = a_stereo[s]/n[2][s] if n[0].heshe == "gal": a_stereo[s] = a_stereo[s]+int(v*song[s]) else: a_stereo[s] = a_stereo[s]+int(v*song) if n[2][s] > smoothie: w = a_stereo[s]%n_len if nuc[w][2][s]+1 != 65534 and nuc[w][2][s]+1 != nuc[w][2][(s+1)%2] and n[2][s]-1 != n[2][(s+1)%2]: if nuc[w][1] != 1 and nuc[w][1] != 5 and nuc[w][1] != 2 and n[1] != 1 and n[1] != 5 and n[1] != 3: n[2][s] = n[2][s]-1 nuc[w][2][s] = nuc[w][2][s]+1 if n[2][s] == smoothie: n[1] = 1 if nuc[w][1] == 4: nuc[w][1] = (65534-a_stereo[s])%4 if nuc[w][1] == 1: nuc[w][1] = 0 else: nuc[w][1] = 4 groove.append(a_stereo[0]-32767) groove.append(a_stereo[1]-32767) h = (f+a_stereo[0]+a_stereo[1])%filter if h == 12 or h == 212 or h == 1212: w = (f+a_stereo[0])%n_len print(w,"will reincarnate") nuc[w][0].reincarnate(f) if nuc[w][1] !=1: if nuc[w][1] !=4: nuc[w][1] = 4 else: nuc[w][1] = f%4 if nuc[w][1] == 1: nuc[w][1] = 0 elif h == 13 or h == 313 or h == 1313: w = a_stereo[0]%n_len m = a_stereo[1]%n_len print( m,"fucks",w) nuc[m][0].fuck(nuc[w][0]) if nuc[w][1] != 1 and nuc[w][1] != 5: nuc[w][1] = (f+a_stereo[1])%5 if nuc[w][1] == 1: nuc[w][1] = 0 if nuc[m][1] != 1 and nuc[m][1] != 5: nuc[m][1] = (f+a_stereo[0])%5 if nuc[m][1] == 1: nuc[m][1] = 0 if f % 44100 == 0: print(int(f/44100),"/",int(h_m_s/44100)) print("[",a_stereo[0],a_stereo[1],"]") for n in nuc: print(n[2]) for f in range(44100): i1 = -2*f-1 i2 = -2*f-2 fo = f/44100 groove[i1] = int(groove[i1]*fo) groove[i2] = int(groove[i2]*fo) if f<10: print(groove[i1],groove[i2]) thang = l2h(groove) a_thang = wave.open("groove.wav", "w") a_thang.setnchannels(2) a_thang.setsampwidth(2) a_thang.setframerate(44100) a_thang.writeframes(thang.tostring()) a_thang.close() #print "dumping plutonium" #pickle.dump(nuc[0][0],open("plutonium","w")) print("done")