Skip to content

Add control values #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2021
Merged

Add control values #27

merged 2 commits into from
Apr 11, 2021

Conversation

gamblor21
Copy link
Member

Added in common control change values as per #10

I used a couple of reference list, this is not exhaustive. But seems to be the more popular ones.

@ladyada
Copy link
Member

ladyada commented Oct 20, 2020

@kevinjwalters please try it!

@tannewt
Copy link
Member

tannewt commented Oct 20, 2020

@jedgarpark probably knows if these are relevant CC values too.

@kevinjwalters
Copy link

kevinjwalters commented Oct 20, 2020

The new Continue message works based on pressing play, play, stop in Ableton lite.

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit CircuitPlayground Express with samd21g18
>>> import adafruit_midi
>>> import usb_midi
>>> import time
>>> from adafruit_midi.start import Start
>>> from adafruit_midi.stop import Stop
>>> from adafruit_midi.timing_clock import TimingClock
>>> from adafruit_midi.control_change import ControlChange
>>> from adafruit_midi.midi_continue import Continue  ### new one
>>> midi = adafruit_midi.MIDI(midi_in=usb_midi.ports[0], in_channel=0)
>>> while True:
...     msg = midi.receive()
...     if msg is not None:
...         print(time.monotonic(), msg)
...
...
...
10558.6 <MIDIUnknownEvent object at 20003f70>
10558.6 <Start object at 20004120>
10558.6 <TimingClock object at 20004300>
10558.6 <TimingClock object at 200018d0>
10558.6 <TimingClock object at 20002470>
10558.6 <TimingClock object at 20002d70>
10558.7 <TimingClock object at 200034e0>
10558.7 <TimingClock object at 20003aa0>
10558.7 <TimingClock object at 20004420>
10558.7 <TimingClock object at 20001c60>
10558.7 <TimingClock object at 200026f0>
10558.8 <TimingClock object at 20002f80>
10558.8 <TimingClock object at 200039f0>
10558.8 <TimingClock object at 200041e0>
10558.8 <TimingClock object at 200017b0>
10558.8 <TimingClock object at 20002260>
10558.9 <TimingClock object at 20002bb0>
10558.9 <TimingClock object at 20003320>
10558.9 <TimingClock object at 20003c40>
10558.9 <TimingClock object at 200042e0>
10558.9 <Stop object at 20001720>
10558.9 <MIDIUnknownEvent object at 20001850>
10558.9 <Continue object at 20001c70>
10559.0 <TimingClock object at 20002630>
10559.0 <TimingClock object at 200027e0>
10559.0 <TimingClock object at 20002d70>
10559.0 <TimingClock object at 20003590>
10559.0 <TimingClock object at 20003b60>
10559.1 <TimingClock object at 20004690>
10559.1 <TimingClock object at 20001e70>
10559.1 <TimingClock object at 20002960>
10559.1 <TimingClock object at 200030a0>
10559.1 <TimingClock object at 20003690>
10559.1 <TimingClock object at 20003d60>
10559.2 <TimingClock object at 20004520>
10559.2 <TimingClock object at 20001ec0>
10559.2 <TimingClock object at 20002750>
10559.2 <TimingClock object at 20003220>
10559.3 <TimingClock object at 20003790>
10559.3 <TimingClock object at 200040b0>
10559.3 <TimingClock object at 20001720>
10559.3 <TimingClock object at 200024f0>
10559.3 <TimingClock object at 20002fc0>
10559.4 <TimingClock object at 20003750>
10559.4 <TimingClock object at 20003e20>
10559.4 <TimingClock object at 20004640>
10559.4 <TimingClock object at 20002050>
10559.4 <TimingClock object at 20002ad0>
10559.5 <TimingClock object at 20003270>
10559.5 <TimingClock object at 20003cc0>
10559.5 <Stop object at 20004010>

@kevinjwalters
Copy link

The CC numbers look fine and work, here's global volume and mod wheel on my Axiom 25 going to CPX:

Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit CircuitPlayground Express with samd21g18
>>>
>>> import adafruit_midi
>>> import usb_midi
>>> import time
>>> from adafruit_midi.control_change import ControlChange
>>> from adafruit_midi.control_change_values import *
>>> midi = adafruit_midi.MIDI(midi_in=usb_midi.ports[0], in_channel=0)
>>> while True:
...     msg = midi.receive()
...     if isinstance(msg, ControlChange):
...         if msg.control == MOD_WHEEL:
...             print("MOD_WHEEL", msg.value)
...         elif msg.control == VOLUME:
...             print("VOLUME", msg.value)
...
...
...
VOLUME 9
VOLUME 19
VOLUME 28
VOLUME 35
VOLUME 39
VOLUME 40
VOLUME 35
VOLUME 26
VOLUME 18
VOLUME 9
VOLUME 0
MOD_WHEEL 79
MOD_WHEEL 76
MOD_WHEEL 72
MOD_WHEEL 65
MOD_WHEEL 56
MOD_WHEEL 44
MOD_WHEEL 29
MOD_WHEEL 15
MOD_WHEEL 0

@ladyada ladyada merged commit 012ce21 into adafruit:master Apr 11, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 15, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.6.1 from 2.6.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_BME280#46 from jposada202020/improving_docs

Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 5.3.0 from 5.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#78 from ViennaMike/axis_remap

Updating https://github.com/adafruit/Adafruit_CircuitPython_IRRemote to 4.0.6 from 4.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#46 from kevinjwalters/tx-var-bits
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_SHTC3 to 1.0.6 from 1.0.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_SHTC3#7 from jposada202020/improving_docs
  > "Increase duplicate code check threshold "
  > Merge pull request adafruit/Adafruit_CircuitPython_SHTC3#6 from FoamyGuy/pylintrc_and_versions

Updating https://github.com/adafruit/Adafruit_CircuitPython_MIDI to 1.4.0 from 1.3.5:
  > Added copyright information
  > Merge pull request adafruit/Adafruit_CircuitPython_MIDI#27 from gamblor21/add_control_values

Updating https://github.com/adafruit/Adafruit_CircuitPython_SimpleMath to 2.0.0 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_SimpleMath#2 from lesamouraipourpre/unconstrained-map-range
  > Added tests check to pre commit config
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_Colorsys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants