Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
8d319248fThis file is pinned to the selected release. Download the original to open it in your design tool.
# This example shows how to play a different sample when the button is
# pressed and when the button is released.
import winterbloom_bhb
bhb = winterbloom_bhb.BigHonkingButton()
snare = bhb.load_sample("samples/snare.wav")
reverse = bhb.load_sample("samples/reverse.wav")
while bhb.update():
if bhb.triggered:
bhb.gate_out = True
bhb.play(snare)
if bhb.released:
bhb.gate_out = False
bhb.play(reverse)