import fart import nuclear import wave from array import array import struct import pygame import pickle def l2h(thang): h_thang = array('h') for gas in thang: h_thang.append(gas) return h_thang smoothie = 55 dflt = 777 sarigama = [ # pickle.load(open("p_drums")), # fart.Zero(), fart.One(), # fart.Two(), # fart.Three(), # fart.Four(), # fart.Five(), # fart.Six(), # fart.Seven(), # fart.Eight(), # fart.Nine(), # nuclear.Zero(), # nuclear.One(), nuclear.Two(), nuclear.Three(), # nuclear.Four(), # nuclear.Five(), nuclear.Six(), nuclear.Seven(), nuclear.Eight(), nuclear.Nine() ] s_len = len(sarigama) #god = 2147483647 god = 1234567 fst = [1,1,1] stp = 0 cpls = 1 ok = 0 pulse = 44100 pygame.init() pygame.mixer.init(frequency=44100, size=-16, channels=2, buffer=4096) while stp == 0: if cpls == 1: dad = int(raw_input('change pulse -> ')) pulse = 22222 + dad % 33333 print "new pulse = ", pulse cpls = 0 for g in range(3): ok = 0 god = (2147483640-god-11111*g)%9999999 while ok != 1: print "part ", g dad = int(raw_input('sus favorite int .. stop = -1 chngpls = -2 -> ')) if dad == -1: stp = 1 print 'will stop' break elif dad == -2: cpls = 1 print 'will change pulse' break h_m_s = pulse*(3+god%7) if g == 0: nuc = [ [god%s_len,0,[dflt,dflt]], [(god-pulse)%s_len,0,[dflt,dflt]], [(god*7)%s_len,0,[dflt+50,dflt-50]], [(god*3+11)%s_len,0,[dflt-50,dflt+50]] ] elif g == 1: nuc = [ [(god*3)%s_len,0,[dflt,dflt]], [(god*3-pulse)%s_len,0,[dflt,dflt]], [(god*11)%s_len,0,[dflt+50,dflt-50]], [(god*5+13)%s_len,0,[dflt-50,dflt+50]] ] else: nuc = [ [(god*5)%s_len,0,[dflt,dflt]], [(god*5-pulse)%s_len,0,[dflt,dflt]], [(god*13)%s_len,0,[dflt+50,dflt-50]], [(god*17+11)%s_len,0,[dflt-50,dflt+50]] ] n_len = len(nuc) if g == 0: filter = 35753 elif g == 1: filter = 21312 else: filter = 41414 stereo = [] a_stereo = [32767,32767] for f in range(h_m_s): for n in nuc: if n[1] == 1 or n[1] == 4: continue song = sarigama[n[0]].sing() for s in range(2): if song > 0: v = (65534-a_stereo[s])/float(n[2][s]) else: v = a_stereo[s]/float(n[2][s]) 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 != 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] != 2 and n[1] != 1 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] = 4 else: nuc[w][1] = a_stereo[s]%4 stereo.append(a_stereo[0]-32767) stereo.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" sarigama[nuc[w][0]].reincarnate(f) if nuc[w][1] != 4: nuc[w][1] = 4 else: nuc[w][1] = f%4 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 sarigama[nuc[m][0]].fuck(sarigama[nuc[w][0]]) nuc[w][1] = (f+a_stereo[1])%4 nuc[m][1] = (f+a_stereo[0])%4 if f % 44100 == 0: print f,"/",h_m_s print "[",a_stereo[0],a_stereo[1],"]" for n in nuc: print(n[2]) for f in range(3000): fo = f/3000.0 i1 = 2*f i2 = 2*f+1 stereo[i1] = int(stereo[i1]*fo) stereo[i2] = int(stereo[i2]*fo) i1 = -2*f-1 i2 = -2*f-2 stereo[i1] = int(stereo[i1]*fo) stereo[i2] = int(stereo[i2]*fo) track_thang = l2h(stereo) if g == 0: a_thang = wave.open("radiation0.wav", "w") elif g == 1: a_thang = wave.open("radiation1.wav", "w") else: a_thang = wave.open("radiation2.wav", "w") a_thang.setnchannels(2) a_thang.setsampwidth(2) a_thang.setframerate(44100) a_thang.writeframes(track_thang.tostring()) a_thang.close() if g == 0: if fst[0] == 0: pygame.mixer.Channel(0).fadeout(3000) snd0 = pygame.mixer.Sound("radiation0.wav") pygame.mixer.Channel(0).set_volume(0.5,0.5) pygame.mixer.Channel(0).play(snd0, loops = -1) fst[0] = 0 elif g == 1: if fst[1] == 0: pygame.mixer.Channel(1).fadeout(3000) snd1 = pygame.mixer.Sound("radiation1.wav") pygame.mixer.Channel(1).set_volume(0.7,0.3) pygame.mixer.Channel(1).play(snd1, loops = -1) fst[1] = 0 else: if fst[2] == 0: pygame.mixer.Channel(2).fadeout(3000) snd2 = pygame.mixer.Sound("radiation2.wav") pygame.mixer.Channel(2).set_volume(0.3,0.7) pygame.mixer.Channel(2).play(snd2, loops = -1) fst[2] = 0 ok = int(raw_input('okay = 1 -> ')) if stp == 1 or cpls == 1: break pygame.mixer.Sound.stop(snd0) pygame.mixer.Sound.stop(snd1) pygame.mixer.Sound.stop(snd2) #print "dumping plutonium" #pickle.dump(sarigama[15][0],open("plutonium","w")) print "done" #pygame.time.wait(30000) #pygame.mixer.music.load("radiation.wav")