Input velocity values from inside the user.py

48 viewsCSS Questions
0

Hello John!

Pls. I need some help.

Is there any way posible to send MIDI velocity values to a input PADS using the User.py script file?

it Is posible?
Thanks.

admin Changed status to publish May 22, 2024
Attached Files:
0

I have the same question..

I want to send some midi to the controller from the user.py file but i get an error.

admin Changed status to publish May 22, 2024
Attached Files:
0

Hi guys,

(I want to prefix with, I haven’t tried this before so you guys are my guinea pigs!)
The inputs don’t ‘exist’ in the user.py file, so first thing you’ll need to do is either add them in there or pass them in via a reaction.

In the main script.py file, your controller inputs all live in the method named _inputs
2 options:

1. copy and paste the entire _inputs method into the user.py file (making sure the indentation is correct)
Then in the user.py __init__ method (where it says ‘add init code here’)
Call the _input method like this:
self._inputs()
All of your inputs will now be available to send midi data to the same as in the main script.
The problem with that method is every time you change your inputs, you’ll need to copy and paste the _inputs method again.

2. Pass an individual input into a method in the user.py file via a reaction.
Add a reaction which fires when script is initialised (script > script is initialized)
Pass the input into a method in your user.py file
This part of the ‘custom python coding’ tutorial does something similar: https://youtu.be/1bsHKEexXrk?t=632
Once you have passed the input in, you should be able to add .send_value() onto the end of it and send midi data.

admin Changed status to publish May 22, 2024
Attached Files:
0

thanks!

admin Changed status to publish May 22, 2024
Attached Files: