preset drawing bug vertical slider!!

For general discussion related FlowStone
Post Reply
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

preset drawing bug vertical slider!!

Post by Nubeat7 »

hallo, i found a preset drawing bug in the vertical slider, after presetchange it draws the slider upsidedown, the value is ok but the slider is on the wrong side, i think it has something to do with the opposite valuedirection to the drawdirection - value = 0 down / 1 up, but you always draw from the top to the bottom.. the horizontal slider works fine - here you draw in the same direction then the value goes, 0 at the left up to the right... sadly my programmingskills are not enough for that....just watch the fsm i commented inside..
Attachments
SliderDrawBug.fsm
(12.09 KiB) Downloaded 1278 times
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: preset drawing bug vertical slider!!

Post by Nubeat7 »

Nubeat7 wrote:hallo, i found a preset drawing bug in the vertical slider, after presetchange it draws the slider upsidedown, the value is ok but the slider is on the wrong side, i think it has something to do with the opposite valuedirection to the drawdirection - value = 0 down / 1 up, but you always draw from the top to the bottom.. the horizontal slider works fine - here you draw in the same direction then the value goes, 0 at the left up to the right... sadly my programmingskills are not enough for that....just watch the fsm i commented inside..



ok i found an easy way to solve the problem, just delete the 1- at the "output 0,1-@value" -line in the "mouseMoveCaptured" definition and put it outside the code after the "preset" before the "min max" and it works fine with the presetmanager...
Attachments
SliderDrawBugSolved.fsm
(10.38 KiB) Downloaded 1326 times
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: preset drawing bug vertical slider!!

Post by trogluddite »

Well spotted!

A slightly better solution would be to keep the output 0,1-@value and then reverse the value when the Ruby 'event' method gets an input...
@value = [0,1-v,1].sort[1]

SliderDrawBug-2A.fsm
(12.15 KiB) Downloaded 1353 times

This seems to do the same thing, but it has two advantages...
1) VST automation. Putting the reversal after the preset means that VST host automation lanes will be upside down - which could be a bit confusing.
2) you might want a slider where you can set the value from outside the module - for linked together controls, for example. So moving the reversal to the Ruby input event will make sure that this works as expected.

EDIT)
Three advantages...
3) The MIDI CC receiver is also inside the preset - so my code change will put the MIDI CC the right way around too.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: preset drawing bug vertical slider!!

Post by Nubeat7 »

Thanks trog, i knew you were the right man for it :)
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: preset drawing bug vertical slider!!

Post by trogluddite »

FYI
Reported this to Malc so that the toolbox can be updated for the next release.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Post Reply