Exemplo n.º 1
0
    (5, 8),  # Pads > Intergalactic Pass
    (0, 13),  # Bass > Kraft Bass
    (6, 9),  # Percussion > Space Hat
]

patch_count = len(touch_patch)
patch_index = (
    patch_count - 1
)  # start on the last one so first time it is pressed it goes to first

cc_x = 0
cc_y = 0
cc_prox = 0

# Use default HID descriptor
midi_service = adafruit_ble_midi.MIDIService()
advertisement = ProvideServicesAdvertisement(midi_service)

ble = adafruit_ble.BLERadio()
if ble.connected:
    for c in ble.connections:
        c.disconnect()

midi = adafruit_midi.MIDI(midi_out=midi_service, out_channel=midi_channel - 1)

print("advertising")
ble.name = "CLUE BLE MIDI"
ble.start_advertising(advertisement)

clue.display.brightness = 1.0
clue.pixel.brightness = 0.2
Exemplo n.º 2
0
            self.init_screen()


def remap(x, in_min, in_max, out_min, out_max, no_float=True):
    res = (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min
    if res < out_min:
        res = out_min
    if res > out_max:
        res = out_max
    if no_float:
        res = round(res)
    return res


MIDI_CHANNEL = 1
MIDI_SERVICE = adafruit_ble_midi.MIDIService()
BLE_AD = ProvideServicesAdvertisement(MIDI_SERVICE)
MIDI = adafruit_midi.MIDI(midi_out=MIDI_SERVICE, out_channel=MIDI_CHANNEL - 1)

BLE = adafruit_ble.BLERadio()
if BLE.connected:
    print("Remove active BLE connections")
    for c in BLE.connections:
        c.disconnect()
BLE.name = "BIAS FX CLUE BLE MIDI"
print("Advertising BLE")
BLE.start_advertising(BLE_AD)

clue_display = DisplayManager(clue)
debouncer = Debouncer(BUTTONS)
START_RANGE = 0