Metadata-Version: 2.4
Name: FoxDotCC
Version: 0.1.0
Summary: MIDI Control Change Message
License: CC-BY-SA-4.0
License-File: LICENSE
Author: taconi
Author-email: igor.taconi@protonmail.com
Requires-Python: ~=3.11
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: python-rtmidi (>=1.5.8,<2.0.0)
Description-Content-Type: text/markdown

# FoxDotCC - MIDI Control Change Messages

## Instalation

``` shell
pip install FoxDotCC
# or
pip install git+https://codeberg.org/FoxDotExtensions/FoxDotCC
```

## Usage

Import lib

``` python
from FoxDot.lib.Extensions import CC
```

See which MIDI's are available

``` python
CC.list_ports()
```

Create a connection

``` python
cc = CC.connect(0)                                # index
cc = CC.connect('MIDI Mix:MIDI Mix MIDI 1 28:0')  # literal string
```

Add a function to see which events are received

``` python
cc(lambda msg: print(msg.control_number))
```

or use a decorator

``` python
@cc
def _(msg: cc.Msg):
	print(msg.control_number)
```

Alternate between values, useful for the buttons

``` python
d1 >> play('x.', amp=cc(1).switch(1,0))
```

Use Knobs/Fader to control values with Range

``` python
d2 >> bass('s...', lpf=cc(18).range(500, 5000))
```

Map your own functions

``` python
@cc(1)
def _(msg):
	d1.amp = not d1.amp
	d2.amp = not d2.amp
	if d2.amp:
		d3 >> play('x-')
```

Close the connection

``` python
cc.close()
```

