Hi, all! This time I've been working on putting it all together and making it work. There is the audio part, the touch sensitive ink part and building of the drum.
I used white glue for the faux leather and a mix of Liquid Tape and powdered graphite to connect/glue the cables to the e-ink. I used double tape for the speaker and breadboard. Putting it all together:
Although at first I was aiming to replicate the sound of the tabla accurately for whatever area of the drum one would play while studying how tabla players play the different strokes I noticed that they use very particular areas for playing. I thought this could make the project somewhat easier but also I imagine as it serving an educational purpose: when using this project you get to see the areas where you should be playing to get a specific sound.
This last pictures shows the different areas where touch sensitivity can be recognized. Also, I upgraded the look of the drum by shaving off the extra faux leather to make it look more clean. Here is how it looks on the tripod!:
As mentioned in a past blog post, the tripod is an important part of the project because the table player usually adjusts the angle of the drum.
I was happily surprised with the low resistance of the conductive paint. I applied only 2 layers of paint and didn't have any missing readings from the touch detection system that I could notice. Here you see it in action:
I managed to write a code that allows the user to play the three most important notes of this drum. Namely the Ghe, Ke and the pitch changing Ghe+Slide. For the Ghe note the hand rests on the part of the drum nearest to the player and the fingers strike on the opposite side of the drum. For the Ke sound the whole palm is used to generate a muted sound. And for the pitch-changing note a normal Ghe note is played and then the hand puts pressure and slides in the drum shortening the radius of the vibrating leather and thus generating a higher pitch. Naturally this last one was the trickiest to replicate. My solution was to detect if the hand is sliding after a Ghe stroke. If it is, the Ghe stroke sound file stops being played and in its place a recording of the last part of the Ghe+Slide stroke is played. In other words, for this last stroke we play half of one sound file and the second half of another sound file. It worked quite well:
Here you can checkout the algorithms to detect the different strokes:
import audiocore import board import audiobusio import busio import time import adafruit_mpr121 # Configure touch sensor i2c = busio.I2C(board.GP9, board.GP8) i2c_touch_address = 0x5A mpr121 = adafruit_mpr121.MPR121(i2c) # Load .wav files left_drum_strokes = { "Ghe":{ }, "Ga":{ }, "Ke":{ }, "Slide":{ } } wave_objects = [] for note in left_drum_strokes: left_drum_strokes[note]["wave_object"] = audiocore.WaveFile(open("tabla_samples/" + note + ".wav", "rb")) # Configure I2S output audio = audiobusio.I2SOut(board.GP0, board.GP1, board.GP2) main_stroke_area_ready = True central_circle_ready = True first_4_pads_ready = True while True: touched_pins = mpr121.touched_pins first_3_pads = touched_pins[9:12] first_4_pads = touched_pins[8:12] central_circle = touched_pins[7] main_stroke_area = touched_pins[1] if not main_stroke_area: main_stroke_area_ready = True if not central_circle: central_circle_ready = True if not any(first_4_pads): first_4_pads_ready = True if main_stroke_area and any(first_3_pads) and main_stroke_area_ready and not central_circle: audio.play(left_drum_strokes["Ghe"]["wave_object"]) main_stroke_area_ready = False time.sleep(0.2) new_touched_pins = mpr121.touched_pins new_first_4_pads = new_touched_pins[8:12] print("new_touched_pins", new_touched_pins) print("new_first_4_pads", new_first_4_pads) if new_first_4_pads == (1, 1, 0, 0) or new_first_4_pads == (0, 1, 1, 0): audio.play(left_drum_strokes["Slide"]["wave_object"]) main_stroke_area_ready = False if main_stroke_area and any(first_4_pads) and central_circle_ready and central_circle: audio.play(left_drum_strokes["Ke"]["wave_object"]) central_circle_ready = False
Still reading? Thanks! Stay tuned for the last blog post!