alf45tar / PedalinoMini

Wireless and Bluetooth MIDI Foot Controller
GNU General Public License v3.0
479 stars 84 forks source link

Confused with Control logic after update to 3.0.9 #424

Closed jimhiggs closed 1 year ago

jimhiggs commented 1 year ago

I am using 3 ladders 6 switches for each. Before updating (on 3.0.4) when I defined a press action the switch would send the On CC value on Press and the Off value on the next Press (or so I believed) so I could use the switch as a latch to say turn reverb on on the first press and off on the second press. Since moving to 3.0.9 the action Press no longer allows me to enter an Off value or tag or set the led color. So repeated presses just do the same thing. I tried 2 controls, one Press and one Release and also Press/Release but these send the off as soon as I release the switch. Am I misunderstanding the way it used to work or am I missing something from how it works now? How do I implement a latch type function with a ladder button?

alf45tar commented 1 year ago

Each button of your ladders must be assigned to a control. You will have 18 different controls. Latch type function can be implemented for momentary buttons using Sequences and Step by Step action.

jimhiggs commented 1 year ago

Ok thanks. I think I will run out of sequences then because I have 18 ladder switches and two external i/ps for switches or exp pedals and I think most cases will need a sequence. I have already used 4 of the 16. Can I increase the number in pedalino.h file?

alf45tar commented 1 year ago

Yes, sure.

jimhiggs commented 1 year ago

I do not fully understand step by step functionality. Will need to play with it. One quick question is continuously saving the config bad for the memory? Should I try to use apply and only save less frequently?

alf45tar commented 1 year ago

You can use Apply of course but the EEPROM memory has a specified life of 100,000 write/erase cycles. You cannot reach the limit using the Save button. You should press it around 27 times per day for the next 10 years.

jimhiggs commented 1 year ago

Great, thanks for the extra info. I will close this now.

jimhiggs commented 1 year ago

I should have tried before closing. How can I use latch functionality using a sequence. i am not seeing it.

alf45tar commented 1 year ago

Use "Step by Step+" Action selecting the Sequence with the 2 CC.

jimhiggs commented 1 year ago

Magic. I understand step by step now. Very useful

jimhiggs commented 1 year ago

So I have Tag 1 set to Normal and Tag2 set to Bright in the Action (No :). The contents of Tag2 is shown above the bank name and is shown for both steps set in the sequence. Tag1 set in the Actions is ignored. Also when I started with the Blueboard config, Bright was displayed above the bank name but highlighted when on. I have not been able to achieve that with actions I have created.

alf45tar commented 1 year ago

You are right. Both are limits of the current design.

alf45tar commented 1 year ago

In version 3.0.10 Tag1 is for odd sequence numbers, Tag2 is for even sequence numbers.

jimhiggs commented 1 year ago

Thanks. When building 3.10 I get an Error:The program size (2023402 bytes) is greater than maximum allowed (1900544 bytes)

alf45tar commented 1 year ago

Fixed.

jimhiggs commented 1 year ago

Thanks.

jimhiggs commented 1 year ago

I have a ladder switch configured as both a press and a long press but when I do the long press it does the short press action and then the long press action. is there something I should configure to prevent this ?

jimhiggs commented 1 year ago

Tried double click and it does the same. I should add, the single press action is a 2 step sequence. On long press or double click It is performing the 1st step of the sequence (I can tell by the display showing the cc info, which it does not display usually when I single press) and then it does the long press (or double click action) after.

jimhiggs commented 1 year ago

From monitoring. So it seems where a press action and a log press action is declared for a switch a long press will perform the action of the short press and then the action of the long press. Changing the press to a click action we only get the long press action. Assuming this is how it works we should not have a press action and a long press on the same control and instead use a click and a long press?

Results of monitoring. action set as press on single press [3842687] Pedal/Button: 2/1 EventType: Press ButtonState: 0 Action Delay On....SEQUENCE.....Number 5.....Step 2 CONTROL CHANGE.....Code 28......Value 127.....Channel 1 LED COLOR.....Led 9......RGB Color #001100

[3842850] Pedal/Button: 2/1 EventType: Release ButtonState: 1 [3843252] Pedal/Button: 2/1 EventType: Click ButtonState: 1

on long press [3855926] Pedal/Button: 2/1 EventType: Press ButtonState: 0 Action Delay On....SEQUENCE.....Number 5.....Step 1 CONTROL CHANGE.....Code 28......Value 0.....Channel 1 LED COLOR.....Led 9......RGB Color #000000

[3856427] Pedal/Button: 2/1 EventType: LongPress ButtonState: 0 Action ....BANK+.....10 [3856841] Pedal/Button: 2/1 EventType: LongReleased ButtonState: 1

Action set as click on click [3070132] Pedal/Button: 2/1 EventType: Press ButtonState: 0 [3070247] Pedal/Button: 2/1 EventType: Release ButtonState: 1 [3070647] Pedal/Button: 2/1 EventType: Click ButtonState: 1 Action Delay On....SEQUENCE.....Number 5.....Step 2 CONTROL CHANGE.....Code 28......Value 127.....Channel 1 LED COLOR.....Led 9......RGB Color #001100

on long press [3075457] Pedal/Button: 2/1 EventType: Press ButtonState: 0 [3075957] Pedal/Button: 2/1 EventType: LongPress ButtonState: 0 Action ....BANK+.....10 [3076457] Pedal/Button: 2/1 EventType: RepeatPressed ButtonState: 0 [3076653] Pedal/Button: 2/1 EventType: LongReleased ButtonState: 1_

jimhiggs commented 1 year ago

accidental highlighting, cant edit it off

alf45tar commented 1 year ago

If you want to use Long or Double Press you have to replace Press with Click. The reason is simple. Click is triggered when 2 events occur: a Press and Release within a configurable interval. Once released a long press cannot happen anymore but a double press can. The result you can have 3 non-conflicting events on a single button: Click, Double Press and Long Press. The bad new is that Click can be postponed until the Double Click timeout. If you do not need double press you can disable in Pedals to avoid delay.

jimhiggs commented 1 year ago

Excellent . I am sure that explanation will help others when searching for help.

alf45tar commented 1 year ago

If you interested of latch emulation with momentary switches you get a try to version 3.1.0.

jimhiggs commented 1 year ago

OK will give it a try now. Thanks.

jimhiggs commented 1 year ago

Works great. Easier to configure than Step by Step+ an now i wont need so many sequences.

jimhiggs commented 1 year ago

I spoke too soon. It does not work if you press another button in between (in the same ladder). So if I latch a switch on, the next time I press it will latch off. OK But if I press on switch A (on) then press on a different switch in the same ladder it fires the release of the second switch and not the press. If I then press the first switch again it fires the press, not the release. So basically if you press on buttons 1 to 6 in a ladder in a row it will alternate between press and release actions rather than a on press for each (assuming they were all in an off state). Hope I have explained this right.

alf45tar commented 1 year ago

Fixed in version 3.1.1

jimhiggs commented 1 year ago

Confirmed. Will carry on testing.