Removed newline, resampled
This commit is contained in:
parent
4ddcd55261
commit
05b982a569
1 changed files with 8 additions and 7 deletions
|
@ -3,6 +3,7 @@
|
|||
# Study on bytebeat
|
||||
# By danielinux
|
||||
# License: GPL
|
||||
import sys
|
||||
|
||||
from random import randint
|
||||
|
||||
|
@ -15,7 +16,7 @@ t=0
|
|||
bass_note0 = [ 16, 0, 8, 0, 8, 16, 9, 0]
|
||||
bass_note1 = [ 12, 0, 12, 0, 0, 14,16,0]
|
||||
bass_note2 = [ 12, 0, 12, 0, 12, 14,16,0]
|
||||
hi_note0 = [2, 4, 2, 4, 3,4,3,4]
|
||||
hi_note0 = [4, 8, 4, 8, 6,8,6,8]
|
||||
hi_note1 = [12,6,12,6,14,12,14,12]
|
||||
|
||||
bd = [ 1, 1, 0, 0, 0, 1, 0, 1 ]
|
||||
|
@ -26,12 +27,12 @@ snare = [ 0x41, 0x89, 0xAF, 0x49, 0xC6, 0x20, 0xC0, 0x65, 0xCA, 0xAE,
|
|||
while 1:
|
||||
x = 0
|
||||
u = (~(t & 0xFF) & 0xFF)
|
||||
beat = t >> 9
|
||||
beat = t >> 10
|
||||
part = (beat >> 3) # part
|
||||
hit = (t - (beat << 9)) # Hit: 0-1024
|
||||
bnote = (t - ((t >> 9) << 9)) << 6
|
||||
note = (t - ((t >> 13)<<13)) << 6
|
||||
note2 = (t - ((t >> 14)<<14)) << 7
|
||||
hit = (t - (beat << 10)) # Hit: 0-1024
|
||||
bnote = (t - ((t >> 10) << 10)) << 6
|
||||
note = (t - ((t >> 14)<<14)) << 5
|
||||
note2 = (t - ((t >> 13)<<13)) << 7
|
||||
|
||||
if (bd[beat & 0x07]) and (hit < 32):
|
||||
x = 0xFF;
|
||||
|
@ -62,7 +63,7 @@ while 1:
|
|||
if (hi_note1[beat % len(hi_note1)] != 0):
|
||||
x ^= (bnote / hi_note1[beat % len(hi_note1)]) & (0x30)
|
||||
|
||||
print chr(x & 0xFF)
|
||||
sys.stdout.write(chr(x & 0xFF))
|
||||
t+=1
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue