🔥 Lifetime deal! Get Control Surface Studio for Just £67 👉 Click Here To Get It
Time left... mailtimers.com
⚠️ Lifetime licenses are ending soon, get yours before they're gone ⚠️
Your shopping cart is empty.

Input velocity values from inside the user.py

Submitted by mamajuana on Mon, 05/23/2022 - 02:45
mamajuana
Control Surface Studio User

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.

Topic Category: 

3 Responses

Comments

Hugo Kant
Control Surface Studio User
#1

I have the same question..

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

JohnC
Forum Admin
#2

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.

mamajuana
Control Surface Studio User
#3

thanks!