Home Forums General Programming IncDec continuous problem

This topic contains 17 replies, has 2 voices, and was last updated by goodweather goodweather 6 months, 1 week ago.

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
  • #72630

    human fly

    ok, so i figured out how to make inc/dec buttons with lua.

    inc = function(midiMessage)
    --inc by 1
    toneNumber = panel:getModulatorByName("toneNumber"):getModulatorValue()	
    if toneNumber >= 0 and toneNumber <63 then			
    function incToneNmber(midiMessage)		panel:getModulatorByName("toneNumber"):setModulatorValue((toneNumber)+1, false, true, true)

    and then thought i would try the retrigger event property,
    set to 200ms, to see if it would do continuous scrolling,
    and it does if you select ‘trigger on mouse down’
    it will not count up/down in single steps anymore if you do that:
    it seems minimum is 2 step skip, so you can’t do +/-1 anymore.
    looks like it’s triggering twice on single events. anyone know
    of a way to fix this? (or else i’ll have to leave it out)


    Same question on this one: what do you want to achieve?
    I don’t understand the “complexity” in this one…
    – you have different modulators with values
    – you click on a modulator to make it the current one (OnMouseDown method containing a variable assignation modCurrentModulator = mod
    – you make a generic Inc button and a generic Dec button
    – you track “On value change” and in that method you read the value of modCurrentModulator then increment or decrement it. You can also check the limits of modCurrentModulator (min and max values)

    Let me know…


    human fly

    sorry D, have had bad internet here, and my reply cut out the
    other day – try again:i was curious about inc/dec functions a
    little while back, because my -/+ buttons weren’t working out
    anymore (as linked modulators? i just had them on the same
    VST index LOL …beginner’s confusions..)

    so i had a quick look at this again the other day, and produced
    this panel, having looking at the inc/dec functions in one of
    the jp8000 panels. didn’t even remember i=i+1 etc.

    *what surprised me* here is that continuous scrolling by holding
    down the button -ie: retriggers at xxx mS intervals- (which i
    decided to try out to achieve this) makes single clicks *jump
    2 values*. and there does not seem to be any way to eliminate
    this unfortunately. the button will trigger twice with a single
    click. maybe one down, one up, don’t know yet.

    incidentally: with this method, if i remove those ‘bounds’
    comparison operators, it doesn’t work correctly anymore.

    so yeah: yet again, one of my little side test panels for
    figuring something out. not a serious project. i shall try
    something now with i=i+1 type of thing.


    just curious: what are you using the VST index for? I have never bother about that until now because I didn’t made a VST from my panel and never got any issue…
    Maybe some luck?


    human fly

    just trying to be VST-ready 😉

    in fact… i’ve found a good way of organising the Modulator List
    with a synth with multiple lines of vcf/eg/vca etc.

    if i have my parameter name at the beginning, ie: cutoff
    and put the partial/osc/operator etc after, followed by the
    part number ie: cutoff_p1pt1 … listing by name will group
    all same param names together, consecutively per partial and part.

    this made it easier to renumber: i numbered the first partial,
    going ie: 001, 101 201 301 (knowing i haven’t more than 100 params
    par partial) – and now i can list modulators numerically too.
    so i can check my modulator list and find modulators and errors
    fairly quickly and much more reliably. if you screw up and some
    modulator disappears, it doesn’t take long to find it in the list
    and type in new coordinates, or just remove a stray tabs or groups
    ownership entry that shouldn’t be there. save and restart project,
    and your object/s reappear where they should be.

    i renumber for VST just as i want to know what my parameter numbers
    are, and what place they’ll have in the bulk data table/s.
    i’m aware i still don’t know what i’ll find when i look at the
    D-110 bulk dump: there are 8 temporary Tone buffers, 8 temp Timbre
    buffers, that can all have live edits until Patch is refreshed/changed/
    saved. it is one of the first multitimbral modules, i think, certainly
    from Roland, so the implementation..probably got more sophisticated
    in later units. have a look at the manual and the different sections
    of the sysex implementation – so im proceding with caution, as best
    policy, and if i keep order, the VST Index list will shape up as i go.
    i’m very proud of it at the moment, it’s very neat 🙂

    but i’ll give you a shout as soon as i do a bulk dump from the D-110.
    full system dump with everything should be quite interesting: 64 tones,
    128 timbres, 128 multi’patch’ setups. …

    i really need to start thinking how im going to organise my data:
    the units are: ‘partial’ – you can copy any partial from any part
    to any partial on any part / ‘tone’ – the preset: 12 ‘common’ params,
    (of which one is 4 on/off buttons, each needing own VST Index number..)
    and 4x 58 partial parameters/ then there’s ‘timbre’, 11 parameters, as
    an entity belonging to the Timbre memories list, – but Timbre params also
    exists as part of a ‘Patch’, which is the ‘multi’ setup.

    im wondering if i need multiple tables, or if i just figure out what the
    range is and do getRange – havent done this yet but it looks straightforward.
    copy partial is for later. i think i just want to get the current Tone first,
    for now, so at least i can do updating of panel values to match the tone
    being edited. – with an 8 part module, lots of extras steps, so i’ve
    originally planned it principally as a Tone Editor, with a multi setup
    and rhythm setup, which will be a reasonable workaround. i did build it
    as a full 8 part thing just before i started the rebuild, and you *have
    to do some careful planning* to avoid loads of horribly repetitive work.


    OK. I see. I bought a D110 long time ago but sold it several years after for almost nothing. I would have kept it if I would have known I would be back having fun with synths. Same with my JX3P and DX7 (one of the first produced)…


    human fly

    cheapness was what brought the D-110 to me. nobody has wanted them,
    because it’s a pita to program. i had never checked out ‘LA synthesis’
    and haven’t even tried a D-50/550. it is now one of my digital cheapies:
    tx81z/K1r/vz8m …things i’ve come across over the years and they’re too
    funky to get rid of.

    i’ve never tried the Atari editor for it, but none of the other old ones
    for PC are 100%.

    hey did you sell the jx3p? i’ve had ju-60/106/alpha but never that one,
    always thought it looked ‘less’, until i realised much later what it’s
    capable of. do you think the polyphonic dave smiths can cover that sound?


    Sold the JX3P long time ago and when looking 2 years ago for the P12, I didn’t find the sound. I think it is due to the usage of the Curtis filter (+ digital osc for the P12 instead of DCO). On my Pro2 it is already much better due to better filter but to find back the JX3P maybe it is more the OB6 (P6 has a Curtis filter if I’m not wrong – OB6 has the same filter has Pro2) or maybe Deep Mind 12. Of course, worth also listening to the Roland ACB stuff System8 or JD-XA. Probable than the new Roland will be the closest to the old Roland 😉
    Anyway, it’s all a matter of ears and sound taste + type of music.
    For me it is ambient and I like hybrid synths. My next one will most probably be the Waldorf Quantum…


    human fly

    another serious looking synth.

    i really wonder what the boutiques can be like, i have
    not had a chance to try one.


    human fly

    incidentally, we haven’t talked about this doubletrigger
    problem with the buttons 🙂

    here i’m talking about inc/dec buttons being held, to step
    up/down 1 at a time – but i get 2 steps minimum when held down,
    for the first count, however slow the retrigger.

    i get something similar triggering a hexstring to console:
    (with a single click button)
    result is displayed twice.
    and, some time back, monitoring the midi showed messages
    being sent twice.
    (how to ‘debounce’ the button?)

    …okay, so now i’ve moved the method from valueChange to
    mouseDown, and it doesn’t retrigger at all. will try this
    again later. looks like it might need a method to operate
    properly? or i’ve missed one setting somewhere.
    *edit: hahaa > have just discovered ‘mouse down and drag’,
    that could be very useful, it’s quite slick, if i can find
    a way of disabling selection menu on a combo, then have
    drag left/right or up/down to scroll…


    OK. So what you want is:
    – a button
    – short click then inc or dec
    – if kept pressed then continue inc or dec until released

    I’ll give it a thought 🙂


    Did you try a simple uiSlider with type IncDecButtons?


    human fly

    yeah, so long ago i’d forgotten where to find them 🙂
    i didn’t yet try to make them do repeating inc/dec.

    curious, though, that the first inc/decrement is a
    2 step jump, even if the others are then single-step.

    i think there’s a behaviour in the button logic:
    for example: if you make a momentary button:
    -toggle/2state (best if you want a detail to change
    on the button when pressed)
    -takes effect on mouse down (last property)

    and lock it, it will sometimes get stuck in the wrong
    state, ie: downstate/on, so you have to unlock it to
    get it to reset.

    and so if it is triggering twice, it is doing it as it
    *changes value* … ?? … i tried to associate the
    method with mouseDown but it doesn’t work anymore.


    Some remarks:

    • you can increment/decrement sliders with a mouse scroll. So you turn or move the slider for big movement then you adjust by 1 using the wheel
    • I didn’t succeed to achieve your long trigger with classical uiButton. The main reason is that there is an event catcher onMouseDown but not onMouseUp. Otherwise it would have been easy to start a timer inc/dec a modulator as long as a variable is true and to stop it by onMouseUp making it false
    • you can make an uiSlider look as Inc/Dec buttons by setting the slider style to IncDecButtons

    So, here is a little panel that should do the job
    You click on a slider to make it current. Its name and current value are shown.
    Then you can adjust it my moving the slider itself or by using the Inc/Dec buttons.
    I found a bug (I’m using 5.3.174) that a slider can go below its min value or higher its max value (the value itself while its displayed value label is limited ) so I had to include a test for max or min.
    Also, the IncDec buttons are used for all sliders so you must allow them to go wide in values. I set -1000 to +1000. That should be enough clicks…

    Have fun 🙂

    You must be logged in to view attached files.

    human fly

    cool! thanks, downloading now.


    human fly

    (offtopic: it appears that the VolcaFM CAN receive individual
    sysex messages – i had understood it couldn’t. if you can handle
    having a DX7 with 3 note polyphony. i am tempted, but i’ll have
    to do an editor for it … *from the TX ctrlr panels* – i’m really
    into these little synths.. but i want to find ONE that cuts it)


    human fly

    ok am looking at it (with sunglasses on 🙂 > white background )

    great example of ‘current’ modulator use, i have been meaning
    to have a closer look.

    especially ‘getOwner()’ – click on the ‘component’ and get its
    ‘modulator’, right? (does it ever in any way refer to ‘owner’
    in the same way with groups and tabs?…) – this looks *very*

    i note you use ‘on change’ and ‘mouse down’, 2 identical methods,
    so that it updates ‘onClick’, and does the same thing with a
    slider movement. (you lose the ‘spare’ method slot that way 🙂
    wonder if this same commbination, ie: click+move can be invoked
    in a single method…anyway: ‘other topic’/for another time 😉 …)

    however – LOL – it doesn’t know what to do when you open the panel
    and instinctively click on +/- 🙂 -but that’s just layout

    yes, that’s working: the fader is a bit ‘coarse’, misses some values,
    but you can ‘fine’ one step at a time with the inc/dec. it bugged
    one time after i opened panel/had a look at lua, and inc/dec stopped
    doing anything. ok on reload. now i must see how to work this into
    my panel. thanks !


    I’m using OnClick (OnMouseDown) and onChange as you want sometimes to know/display something without actually changing the value.
    Yep, I didn’t make this test panel full proof. Was just to show what was possible.
    Did you try the mouse scroll to inc/dec?

Viewing 18 posts - 1 through 18 (of 18 total)

You must be logged in to reply to this topic.

Comments are closed.