808 drum machine

In circuitplaygroundexpress python, I finished this project and it isn’t working. Here is my code:

import audioio
import touchio
import board
import time

from digitalio import DigitalInOut, Direction

bpm = 120

spkrenable = DigitalInOut(board.SPEAKER_ENABLE)
spkrenable.direction = Direction.OUTPUT
spkrenable.value = True

touch1 = touchio.TouchIn(board.A1)
touch2 = touchio.TouchIn(board.A2)
touch3 = touchio.TouchIn(board.A3)
touch4 = touchio.TouchIn(board.A4)
touch5 = touchio.TouchIn(board.A5)
touch6 = touchio.TouchIn(board.A6)
touch7 = touchio.TouchIn(board.A7)

audiofiles = [“bd_tek.wav”, “elec_hi_snare.wav”, “elec_blip2.wav”, “bd_zome.wave”, “bass_hit_c.wav”, “drum_cowbell.wav” ]

a = audioio.AudioOut(board.A0)

def play_file(filename):
f = open(filename, “rb”)
wave = audioio.WaveFile(f)
a.play(wave)
time.sleep(bpm/960)

while True:
for i in range(7):
if touchPad[i].value:
play_file(audiofiles[i])

please get back to me as soon as possible. Thanks

mnazarani, did you get this to work? I’m having problems and would like to know how you got this to work. Thanks