What's new

Controlling Value edit from multi script

raidmarji

New Member
HI all
I HAVE A VALUE EDIT FROM -120 TO + 120 IN THE MAIN INSTRUMENT
I WANT TO CONTROL IT FROM A MULTISCRIPT
I ASSUME THAT I HAVE TO USE 2 MIDI CC NUMBERS FOR THIS PURPOSE, YES?
HOW TO DO IT IN MULTISCRIPT? AND IN THE MAIN INSTRUMENT?
MANY THANKS
 

Tod

Senior Member
Hi raidmarji, I'm sorry nobody has answered you, and I'm afraid I don't have an answer for you either. I've written a few multi scripts and I've used value edits in the multi script it self, but I've never tried to control something like a value edit from the multi script.

Perhaps it can't be done, but I'm not sure about that.
 
OP
R

raidmarji

New Member
Hi raidmarji, I'm sorry nobody has answered you, and I'm afraid I don't have an answer for you either. I've written a few multi scripts and I've used value edits in the multi script it self, but I've never tried to control something like a value edit from the multi script.

Perhaps it can't be done, but I'm not sure about that.
Many thanks Tod for your reply, the problem with multiscript that it is not clear in the manual.
 
Hi!

This is not the most elegant solution, but I would be interested in seeing anyone finding a better workaround.

The trick is to send MIDI signals to a knob on the interface and then have the knob act as a link between the value edit and received midi signal.

1. this is the script for the instrument:
Code:
on init
    declare ui_value_edit $val (-120, 120, 1)
    declare ui_knob $foo (-120, 120, 1)
    {set_control_par(get_ui_id($foo), $CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)}
    make_perfview
end on

on ui_control($foo)
    set_control_par(get_ui_id($val), $CONTROL_PAR_VALUE, $foo) {this line links the knob and the value edit}
end on
2. right-click on the knob, click "Learn MIDI" and move with the controller you would like to adjust the value edit. (my suggestion is to use a controller that lets you assign an unused CC number)

3. this is the multiscript code:
Code:
on init
    $ccnumber := 0
    declare ui_knob $foo (0, 127, 1)
    set_text($foo, "Change value edit value")
end on

on ui_control($foo)
    set_midi($ccnumber, $MIDI_COMMAND_CC, 1, $foo)
end on
4. go back to the instrument. remove the { and } symbols around the "HIDE_WHOLE_CONTROL" line and apply the script - this should make the knob invisible.

I hope that helps!
This would be my approach, but I am always happy to explore new ways.

Best,

Patrik
 
OP
R

raidmarji

New Member
Hi!

This is not the most elegant solution, but I would be interested in seeing anyone finding a better workaround.

The trick is to send MIDI signals to a knob on the interface and then have the knob act as a link between the value edit and received midi signal.

1. this is the script for the instrument:
Code:
on init
    declare ui_value_edit $val (-120, 120, 1)
    declare ui_knob $foo (-120, 120, 1)
    {set_control_par(get_ui_id($foo), $CONTROL_PAR_HIDE, $HIDE_WHOLE_CONTROL)}
    make_perfview
end on

on ui_control($foo)
    set_control_par(get_ui_id($val), $CONTROL_PAR_VALUE, $foo) {this line links the knob and the value edit}
end on
2. right-click on the knob, click "Learn MIDI" and move with the controller you would like to adjust the value edit. (my suggestion is to use a controller that lets you assign an unused CC number)

3. this is the multiscript code:
Code:
on init
    $ccnumber := 0
    declare ui_knob $foo (0, 127, 1)
    set_text($foo, "Change value edit value")
end on

on ui_control($foo)
    set_midi($ccnumber, $MIDI_COMMAND_CC, 1, $foo)
end on
4. go back to the instrument. remove the { and } symbols around the "HIDE_WHOLE_CONTROL" line and apply the script - this should make the knob invisible.

I hope that helps!
This would be my approach, but I am always happy to explore new ways.

Best,

Patrik
Many thanks Patrik, actually it is a smart solution.
is their any way to write the cc number directly to the instrument script? suppose I want it to respond to cc 105?
 
Many thanks Patrik, actually it is a smart solution.
is their any way to write the cc number directly to the instrument script? suppose I want it to respond to cc 105?
You can do that; In the browser (where libraries are shown), click on the "Automation" tab, go to MIDI Audomation and drag the CC number over the knob.
 
Top Bottom