Led feedback

Submitted by Blair on Tue, 01/29/2019 - 19:28
Blair
Control Surface Studio User

Hi guys I have currently got most of my controller working however the led lights are not working properly. My lights seem to either all stay on weather they are pressed or not. I would like them to be on while the action is happening and off when not. For example when I press mute the led light up then when mute is off the light goes off etc. is it possible to control the lights ? If so could someone give an example of how to do so please

Topic Category: 

41 Responses

Comments

John Carney
Forum Admin
#1

This tutorial on Reactions should help to answer your question:
https://remotify.io/tutorials/sending-custom-led-feedback-your-midi-cont...

Blair
Control Surface Studio User
#2

Wow John thankyou for that tutorial that’s great I was able to map some of my leds to work correctly last night. Just a question on reactions how would I do a reaction to set a loop in and loop length on a highlighted track not the arrangement punch in and out. For eg when djing I need to loop a section of a track so while the track is highlighted I want to set the loop in with one button and hit another button to set the loop length them a third button to turn the loop on and off. Is that done in reactions

Blair
Control Surface Studio User
#3

Hi John how are you ment to know what text to write in the boxes if it’s not a device ? For example the stop button or play?

John Carney
Forum Admin
#4

That's a good point, unless you know the inner workings of the LOM (Live Object Model) you will not know.
We probably need a reference page for this. I'll get to work on it soon.

"how would I do a reaction to set a loop in and loop length on a highlighted track"
This should be possible with Reactions but I'll need to figure it out. Let me get back to you.

John Carney
Forum Admin
#5

I just found a reference to clip loops that I, ye know, just had laying around :p

This should set the Loop Start position of the currently highlighted clip.
In the the Reactions section of your Reaction. select 'view' then in the input box add:
.highlighted_clip_slot.clip.loop_start
Then select '='
Input
And In the second input box, add a value such as 0.25
I can't remember what the value means so will requires some experimentation (maybe report your findings here?)

Loop End is the same as loop start except, you use this string in the first input box:
.highlighted_clip_slot.clip.loop_end
And you can use the position of your loop start position as a variable in the second input box:
self.loopstart + 0.25
This means that your end loop position will always be 0.25 further along than the loop start.

Loop Length should also be similar but use:
.highlighted_clip_slot.clip.loop_length

Here's a few more:

Turn Looping on & off for selected clip:
.highlighted_clip_slot.clip.looping = True
.highlighted_clip_slot.clip.looping = False

Start Marker & End Marker
(Be careful with these, I kept getting an ‘StartMarker out of range’ error)
.highlighted_clip_slot.clip.start_marker = 1.0
.highlighted_clip_slot.clip.end_marker = 2.0

Create a Clip 4 bars in length
(Note that this uses parenthesis and not equals)
.highlighted_clip_slot.create_clip(4.0)

Blair
Control Surface Studio User
#6

Hi John please give an example of what this would look like in control surface pro. Listener is the button, condition is view? Then what goes in the reaction boxes?

John Carney
Forum Admin
#7

Yes, Listener is the button.
Condition can be empty (delete any conditions in there)
In Reaction: Select 'view' then in the input box add:
.highlighted_clip_slot.clip.loop_start
select '='
Input
Then in the text field try adding
0.25

See the attached image

Blair
Control Surface Studio User
#8

Great thanks John I’ll try it today

Blair
Control Surface Studio User
#9

Ok so I’ve tried all these examples in control studio as the screen shot shows as well but can’t get any thing to work? With the loop

Blair
Control Surface Studio User
#10

Has anyone else been able to get the loop start and end to work on a highlighted clip? Loop on and off also. I’ve had no luck?

John Carney
Forum Admin
#11

Hey,

So I just tested this and work for me.
See this demo: https://youtu.be/ywpi7tx0j98

One thing to note, the button you are using needs to also be attached to another mapping otherwise the required code doesn't exist which the Reaction hooks into.
Reactions were designed to add feedback, you're adding new functionality (which is fine but requires a bit of a work around).

The attached screenshot are the settings for the above demo.
I attached 'button 1' to the metronome so that the Reaction can hook into it.
The first Reaction sets Loop start to 0.25
The second Reaction sets Loop End to 0.75

Blair
Control Surface Studio User
#12

Where is the screen shot your referring to? So if I set the same button to the metronome for example then do I need to link it in any way to the reaction. Because I tried it and got the metronome to work no problem but not the loop start

John Carney
Forum Admin
#13

Sorry it didn't upload for some reason.
I've attached the screen shot and to make life easier for you, I've attached the script.json file, import it into your CSS.

In answer to your question above, no you don't need to link it except for selecting the same button for Metonome and the Reactions.

Blair
Control Surface Studio User
#14

Ok John sorry to be a pain but is there a way to use the play head as the value? So as I’m playing a track that’s highlighted the I press the clip loop start it sets it from where the play head is then when I press the loop end it sets it again at where the play head is at and it loops that amount. At the way it’s set up as above those end values set the loop at set points. Dose that make sense? Sorry my explanation is not great but I want to be able to loop like a cdj for example

John Carney
Forum Admin
#15

This is untested but yes you should be able to set the loop start to the loop's playing position using this value:
self.song().view.highlighted_clip_slot.clip.playing_position

And you could do stuff like place the loop end at the playing position plus an amount, like this:
self.song().view.highlighted_clip_slot.clip.playing_position + 0.50

Did you get the loop start / end to work then?

Blair
Control Surface Studio User
#16

great ill give it a try and yes thanks i did get the loop start and end to work

Blair
Control Surface Studio User
#17

no i couldnt get it to work but do i just change the text in the box then leave the end box empty for the clip start. should there be a loop referance in there?

Blair
Control Surface Studio User
#18

So it’s loop position and loop length in relation to the play head that I’m after.

John Carney
Forum Admin
#19

The first box should contain the code for loop_start: .highlighted_clip_slot.clip.loop_start
The second box should contain the code for playing position:
self.song().view.highlighted_clip_slot.clip.playing_position

Everything else should stay the same as in my previous screen shot.

When you press the button, this will set the loop start to playing_position

Blair
Control Surface Studio User
#20

Thanks for explaining that John I’ll give it a go tonight.

Blair
Control Surface Studio User
#21

Hi John after playing around for a while I have got the loop function working but not quite how I want it to. It seems that the loop start command seems to move the clip start marker. What I want is to work like I’m pressing the position set button which is under the clip button in ableton. I tried replacing the loop_start with loop_position but that didn’t work? Any ideas of how to set that loop position set? It also activates the loop if it’s off. This so I can loop tracks while playing then loop again when I get to different parts of the track with out it jumping back to the first loop spot

Blair
Control Surface Studio User
#22

I’d also like to know how to use one button to toggle the loop on then the same button for off? Is that a condition on is true and off is fauls

Blair
Control Surface Studio User
#23

Hi John I have tried adding the word position in that script but can’t seem to just activate just the loop brace as in the position and length. They are available in Ableton MIDI mapping so they should be accessible through the script. Do you have any ideas?

John Carney
Forum Admin
#24

Hi Blair,

Try replacing loop_start with:
start_marker
or
end_marker

They should control the 'set' the positions that you're after.

To use the same button to toggle the Loop on and off, you need to add a Condition to your 2 Reactions.

For this example i'm assuming your button is 'Button 1' and sends Velocity Values '127' for On and '0' for Off.

You only want Loop On to fire when your Button is pressed On (127), so in the Loop On Reaction, add a condition which says:
Button 1 || .value || == || Input || 127

Now your Loop On Reaction will only fire when your Button sends a Velocity Value of 127.

You can do the same for your Loop Off Reaction but use Velocity Value of 0.

Blair
Control Surface Studio User
#25

Thanks John I’ll give the a try it funny because you would think that start_marker and end_marker would be for the clip but I’ll try that and let you know. Thanks for your help I really appreciate it

John Carney
Forum Admin
#26

No problem :)

"you would think that start_marker and end_marker would be for the clip"
Yes it is for the clip, I thought from your previous comments that's what you were looking for? am I wrong?

Blair
Control Surface Studio User
#27

Hi John ive tried plenty of different ways but not having any luck it loop will come on if i have no conditions so i cant turn iton and off from one button. and i cant get that loop brace to work at all with the start_marker? i added my file to see if that looks right for you

upload files: 
Blair
Control Surface Studio User
#28

Yep I want the loop position and loop length because they control the loop brace start and end so I can loop a section of the the track on the fly like on a cdj. Now when I put loop_start and loop_end as you suggest earlier it actually moves the clip start and end? Then if I put start_marker and end_marker nothing happens. But it’s the loop markers I want to set and that is done by pressing the loop position set box below the loop on off box and to set the other end I press the loop length set box. I can of course midi learn it and it works but that defeats the idea kind of.

Blair
Control Surface Studio User
#29

I would have thought that loop_start and loop_end would be correct for adjusting the loop brace makers but it moves the clip start and end

John Carney
Forum Admin
#30

If clip's loop is turned off, loop_start & loop_end control the start and markers.
If clips's loop is on: loop_start and loop_end control the loop start/end as expected.

start_marker and end_marker always control start/end markers.

danicroitor
Pro User
#31

Hey John, Have you take a look at my questions about led feedback?
I kinda struggle with finding a solution. As Blair here I'm trying to get led feedback from when I press transport buttons. The led feedback from when i turn on/off devices works perfectly. And I would need something similar for transport buttons, mute tracks.

For mute track I can make the LED to turn on but I don't know how to turn it off. The tutorial you gave with listening to a button and send specific values just does not work. Even for the LED to turn on I had to have no condition but I'm guessing that for the same led to turn off I would need a condition.

Please give me some direction here. I have a gig tomorrow and I would love to use the new script I made with CSS but with no led feedback I have to stick to the old Web App Script

Blair
Control Surface Studio User
#32

Hi John I have nearly got the clip loop to work properly apart from the loop on and off. I understand about the condition how ever as soon as I add a condition it stops working? My button puts out a midi value of 127 while you press it and 0 when you finger is off. But when you press it a second time ie to turn the loop off it fires 127 value. Can I still do it from that button? The script has a true setting for on and a false for off do I need that in the condition? I’ve tried with how you have written it above however as soon as I add a condition the script stops working.

Blair
Control Surface Studio User
#33

Hi John I want loop on and loop off to work off the same button. Button 64
No condition
Reaction : view .highlighted_clip_slot.clip.looping = true then the end box is empty. This works and turns the loop on.
If I add the condition button 64 .value == input 127
The loop stops working? That’s the correct value I’ve checked. So what am I missing? I need the loop to work on and off on the one button 64 but any condition I put in stops it?

John Carney
Forum Admin
#34

Are you getting errors in your Error Log?

You will need 2 separate Reaction Mappings, 1 for turning the loop on and another for turning it off.
Each Reaction Mapping should contain 1 Condition each.

Blair
Control Surface Studio User
#35

'ConfigurableButtonElement' object has no attribute 'value'
this is the fault it logs John. i have 2 reaction mappings

John Carney
Forum Admin
#36

Yes it seems that Buttons / knobs etc don't actually have .value.
My fault sorry!
You could try using .cur_val instead, this will probably send an error to your log on first press (as it doesn't exist until after first press) but will work after.

For your Condition it would be better to test if the Loop is True/False.
If the Loop is true, set to to False and vice versa for the other Reaction.

Blair
Control Surface Studio User
#37

Button 64 .cur_val = false 127 ?
Loop on is true so is ubove what you mean

John Carney
Forum Admin
#38

Just replace .value with .cur_val to make it this:
Button 64 .cur_val == 127

Blair
Control Surface Studio User
#39

2019-03-07T16:41:54.251590: info: RemoteScriptError: 'ConfigurableButtonElement' object has no attribute 'cur_val'
this is what i get now? any ideas John

Blair
Control Surface Studio User
#40

2019-03-07T18:58:41.865590: info: RemoteScriptError: File "/Applications/Ableton Live 10 Suite.app/Contents/App-Resources/MIDI Remote Scripts/css_volume/css_volume.py", line 525, in midi_note_ch_12_val_84_mode1_listener

2019-03-07T18:58:41.865753: info: RemoteScriptError:
2019-03-07T18:58:41.865780: info: RemoteScriptError: if (self.midi_note_ch_12_val_84.cur_val == 127):

2019-03-07T18:58:41.865813: info: RemoteScriptError: AttributeError
2019-03-07T18:58:41.865836: info: RemoteScriptError: :
2019-03-07T18:58:41.865860: info: RemoteScriptError: 'ConfigurableButtonElement' object has no attribute 'cur_val'
2019-03-07T18:58:41.865882: info: RemoteScriptError:

Blair
Control Surface Studio User
#41

with out the condition it will turn on but when ever i add the condition nothing happens