import guy import wave from array import array import struct import sys import pygame def l2h(thang): h_thang = array('h') for gas in thang: h_thang.append(gas) return h_thang smoothie = 33 dflt = 777 sarigama = [guy.Sa(),guy.Ri(),guy.Ga(),guy.Ma(),guy.Pa(),guy.Da(),guy.Ni()] s_len = len(sarigama) #god = 2147483647 god = 1234567 fst = [1,1,1] stp = 0 cnt = 0 pulse = 44100 pygame.init() pygame.mixer.init(frequency=44100, size=-16, channels=2, buffer=4096) while stp == 0: if (god+cnt)%7 == 0 or fst[0] == 1: print("es gonna change the length of our PULSE cuz GOD =",god) pulse = 22222+god%33333 print("new pulse = ",pulse) for g in range(3): if (god+g*cnt)%3 == 0 or fst[g] == 1: print("es gonna update the pattern of TRACK ",g," cuz GOD =",god) track = [] h_m_s = pulse*(3+god%7) if g == 0: nuc = [ [god%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*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*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])/n[2][s] else: v = a_stereo[s]/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 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 god = 123*g+int(cnt/2)+(2147483640-god)%9999999 cnt = (cnt+1)%7777777 buddha = 12+(god+cnt)%12000 if fst[g] == 0: print("gonna doze por ",buddha,"ms") pygame.time.wait(buddha)