Ejemplo n.º 1
0
def louder():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    maxL = left[:]
    maxR = right[:]
    bigL = left[0]
    bigR = right[0]
    for i in range(len(left)):
        if abs(left[i]) > abs(bigL):
            bigL = left[i]
    for i in range(len(right)):
        if abs(right[i]) > abs(bigR):
            bigR = right[i]
    for i in range(len(left)):
        maxL[i] = left[i]/bigL
    for i in range(len(right)):
        maxR[i] = right[i]/bigR
    left[:] = maxL[:]
    right[:] = maxR[:]
    for i in range(len(left)):
        if left[i] > 0:
            left[i] = left[i] ** .8
        else:
            left[i] = -1*((left[i]*-1)**.8)
    for i in range(len(right)):
        if right[i] > 0:
            right[i] = right[i] ** .8
        else:
            right[i] = -1*((right[i]*-1)**.8)       
    BCAudio.play()
Ejemplo n.º 2
0
def swap():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    newRight = left[:]
    newLeft = right[:]
    left[:] = newLeft[:]
    right[:] = newRight[:]
    BCAudio.play()
Ejemplo n.º 3
0
def mono():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    mono = left[:]
    for i in range(len(left)):
        mono[i] = (left[i] + right[i])/ 2.0
    left[:] = mono[:]
    right[:] = mono[:]
    BCAudio.play()
Ejemplo n.º 4
0
def quiet():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    quietL = left[:]
    quietR = right[:]
    for i in range(len(left)):
        quietL[i] = left[i]/2.0
        quietR[i] = right[i]/2.0
    left[:] = quietL[:]
    right[:] = quietR[:]
    BCAudio.play()
Ejemplo n.º 5
0
def faster():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    leftFaster = []
    rightFaster = []
    for i in range(0,len(left),2):
        leftFaster.append(left[i])
    for i in range (0,len(right),2):
        rightFaster.append(right[i])
    left[:] = leftFaster[:]
    right[:] = rightFaster[:]
    BCAudio.play()
Ejemplo n.º 6
0
def reverse():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    reverseL = []
    reverseR = []
    for i in reversed(right):
        reverseR.append(i)
    for i in reversed(left):
        reverseL.append(i)
    left[:] = reverseL[:]
    right[:] = reverseR[:]
    BCAudio.play()
Ejemplo n.º 7
0
def slower():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    leftSlow = []
    rightSlow = []
    for i in range (len(left)):
        leftSlow.append(left[i])
        leftSlow.append(left[i])
    for i in range (len(right)):
        rightSlow.append(right[i])
        rightSlow.append(right[i])
    left[:] = leftSlow[:]
    right[:] = rightSlow[:]
    BCAudio.play()
Ejemplo n.º 8
0
def maximize():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    maxL = left[:]
    maxR = right[:]
    bigL = left[0]
    bigR = right[0]
    for i in range(len(left)):
        if abs(left[i]) > abs(bigL):
            bigL = left[i]
    for i in range(len(right)):
        if abs(right[i]) > abs(bigR):
            bigR = right[i]
    for i in range(len(left)):
        maxL[i] = left[i]/bigL
    for i in range(len(right)):
        maxR[i] = right[i]/bigR
    left[:] = maxL[:]
    right[:] = maxR[:]
    BCAudio.play()
Ejemplo n.º 9
0
def echo():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    leftEcho = []
    rightEcho = []
    leftTemp = []
    rightTemp = []
    delta = int(44100//8)
    for i in range (0, 44100//8):
        leftTemp.append(left[i])
        rightTemp.append(right[i])
    for i in range (44100//8,len(left)):
        leftEcho.append(.25*left[i] + .75*left[i-delta])
    for i in range (44100//8,len(right)):
        rightEcho.append(.25*right[i] + .75*right[i-delta])
    leftTemp.extend(leftEcho)
    rightTemp.extend(rightEcho)
    left[:] = leftTemp[:]
    right[:] = rightTemp[:]
    BCAudio.play()
Ejemplo n.º 10
0
def distort():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    leftDistort = left[:]
    rightDistort = right[:]
    for i in range (len(left)):
        if left[i] >= .2:
            leftDistort[i] = .2
        elif left[i] <= -.2:
            leftDistort[i] = -.2
        else:
            leftDistort[i] = left[i]
    for i in range (len(right)):
        if right[i] >= .2:
            rightDistort[i] = .2
        elif right[i] <= -.2:
            rightDistort[i] = -.2
        else:
            rightDistort[i] = right[i]
    left[:] = leftDistort[:]
    right[:] = rightDistort[:]
    BCAudio.play()
Ejemplo n.º 11
0
def read():
    song = songEntry.get()
    BCAudio.read(song)
Ejemplo n.º 12
0
def stop():
    BCAudio.stop()
Ejemplo n.º 13
0
def play():
    left = BCAudio.getLeft()
    right = BCAudio.getRight()
    BCAudio.play()