[SOLVED] procedure OnEncoderInputToggle

It’s me again.
I use a novation launchpad and use some functions in a script.
I use the function “procedure OnEncoderInputToogle”. But counter to other functions, there is no way to have a function when encoder is on and another when encoder is off.
It should allow me to change the LED status of my launchpad.

Regards
Matthieu

if Encoder.GetConnections.GetItem(0).GetState = ecsConnected then
MidiOut ( 1, 144, 75, 127 ) ;
if Encoder.GetConnections.GetItem(0).GetState = ecsDisconnected then
MidiOut ( 1, 144, 75, 00 ) ;

(Midi codes need to be changed to your device)

Hi Ferry,

I’ve tried

procedure OnEncoderInputToggle(Input: TEncoderInput; NewState: boolean); begin if Encoder.GetConnections.GetItem(0).GetState = ecsConnected then MidiOut (Launchpad_Device,176, SessionButtons[5],cBlinkRed) ; if Encoder.GetConnections.GetItem(0).GetState = ecsDisconnected then MidiOut (Launchpad_Device,176, SessionButtons[5],cHighGreen) ; end;
but it doesn’t work

I’ve tried :

procedure OnEncoderInputToggle(Input: TEncoderInput; NewState: boolean); begin if Encoder.GetConnections.GetItem(0).GetState = ecsConnected then begin MidiOut (Launchpad_Device,176, SessionButtons[5],cBlinkRed) ; end; if Encoder.GetConnections.GetItem(0).GetState = ecsDisconnected then begin MidiOut (Launchpad_Device,176, SessionButtons[5],cHighGreen) ; end; end;
It doesn’t work neither… any idea ?

Regards
Matthieu

You have to activate the midi port and Timer

[code]procedure OnLoad;
begin

MidiOutOpen(1);
EnableTimer (1000);

end;

procedure OnTimer;
begin

if Encoder.GetConnections.GetItem(0).GetState = ecsConnected then
MidiOut ( 1, 144, 75, 127 ) ;
if Encoder.GetConnections.GetItem(0).GetState = ecsDisconnected then
MidiOut ( 1, 144, 75, 00 ) ;
[/code]

Hi Ferry,

It works ! Thanks a lot !
i’m not very skill with this kind of script. Where could i find some documentation ?

Regards
Matthieu