How to avoid jumping faders
  • Josine
    junior Member
    Posts: 3
    Joined: Fri Nov 23, 2012 7:20 pm

    How to avoid jumping faders

    by Josine » Fri Nov 23, 2012 8:13 pm

    Hey VJs,

    I recently bought an AKAI APC20 midi controller.
    I've mapped each fader to the alpha of different layers. (fader 1 to the alpha of layer 1, fader 2 to the alpha of layer 2 and so on... )
    Works fine :)

    When I change the layer order, sometimes it can occur that the value of the fader isn't the same as the actual value of the layer.
    So then if I move the fader, I get an ugly jump.

    I would like the alpha not to react on the fader until the fader has the same value as the alpha. Would this be possible by writing a module? How can I do that..?

    Thanks in advance,
    Josine

    (I hope my explanation was clear enough :) )
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    Re: How to avoid jumping faders

    by anomad » Sat Nov 24, 2012 10:53 pm

    Josine wrote:I would like the alpha not to react on the fader until the fader has the same value as the alpha. Would this be possible by writing a module? How can I do that..?


    . yes - you would want to create a module using the module editor.

    . in the past, i've dabbled w/this and my solution was to create a dictionary of the control, layer and value. then when a MIDI knob or slider was assigned to a UI element, i'd determine the name and active layer then change the associated element in the code


    -james
    (a nomad. )
  • Josine
    junior Member
    Posts: 3
    Joined: Fri Nov 23, 2012 7:20 pm

    Re: How to avoid jumping faders

    by Josine » Tue Nov 27, 2012 12:37 pm

    Hi,

    Thanks for your reply.

    I'm quite new to writing modules. I read the modules manual for Modul8, but i still don't know how to start writing a dictionary..
    Do I use something like this in it: 'ctrl_layer_alpha', 1.0, 1 ?

    Thanks,
    Josine
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    Re: How to avoid jumping faders

    by anomad » Tue Nov 27, 2012 3:37 pm

    . a dictionary is a data type that uses keys instead of indices.. http://www.tutorialspoint.com/python/py ... ionary.htm

    . basically a way to organize your data.


    -james
    (a nomad. )
  • Lutz
    member
    Posts: 10
    Joined: Wed Oct 12, 2011 2:38 pm

    Re: How to avoid jumping faders

    by Lutz » Sat Dec 08, 2012 11:43 am

    Hi,
    as James already mentioned - you need to to this in a module.
    The midi-mapping feature in M8 is - well lets say 'fuzzy', if not worse...
    I posted a solution for your problem a while ago here:
    http://forum.garagecube.com/viewtopic.php?f=12&t=7900
    No need to do this with a dictionary (I find dictionaries more complicated to understand...)
    Lutz
  • lamepantallas
    super8 member
    Posts: 198
    Joined: Sun Apr 15, 2007 1:09 am
    Location: Honduras
    Contact:

    Re: How to avoid jumping faders

    by lamepantallas » Sun Dec 23, 2012 8:45 pm

    Have the same problem constantly and really unpleasant in the middle of a show, I end up using the mouse and keyboard and its not nice.

    Would Osculator work for establishing a more stable midi mapping? I dont know anything about writing scripts, so I am pretty much in the dark. How do I tell M8 not to use its automatic midi mapping structure and have my own for example, at least to establish a more stable mapping?

    What solutions are there?

    Thanks and cheers!
    No se quien soy, pero se de que huyo. M.Montaigne
    Twitter: @popversus / @esegabbo
  • anomad
    master
    Posts: 412
    Joined: Sun Oct 21, 2007 10:07 pm
    Location: north cakalacky, usa
    Contact:

    Re: How to avoid jumping faders

    by anomad » Mon Dec 24, 2012 8:30 pm

    lamepantallas wrote:How do I tell M8 not to use its automatic midi mapping structure and have my own for example, at least to establish a more stable mapping?

    What solutions are there?

    Thanks and cheers!


    . not sure what you're asking in the question above... you can assign MIDI mapping via the main interface or you can write a module that listens for MIDI in DirectEvent()..

    . a module seems to be the best way to go b/c you will be able to read all of the current values for everything (?) in modul8 and transmit them to your controller (if it is capable of receiving the information) so it shows the current state (for things like TouchOSC, maschine, etc.).

    . if the controller doesn't have any way of showing the 'state' of the current parameter you're changing, then a module will know the current value and you can 'listen' to the incoming MIDI/OSC messages and not actually update the values in modul8 until it is in sync... so, don't create a one to one relationship w/a slider and and ctrl_layer_alpha from the main window... instead, create a module that has a slider in it and assign the MIDI controller to it. then in the module, you can compare the incoming value to the current stored value and only start changing it once you've passed the relevant threshold.

    . as a rough example :
    . using ctrl_layer_alpha on three layers - layer 1 at 1.00 (100%), layer 2 at 0.50 (50%) and layer 3 at 0.75 (75%)

    . and you have one slider (current value is 0.25) in your module. you change your module to update layer 2 ctrl_layer_alpha.... you could use something like this pseudo code (which i'm sure a more adept programmer could implement better :) - this is meant as more of illustration):

    Code: Select all

    lockedOn = False   # not a one to one relationship yet...
    lastCheck = ''      # the last known state of the MIDI controller vs. modul8 value ('high' or 'low')

    myM8Val = modul8.getValue(keyword and layer we're changing)
    myMidiVal = module.getValue(element in the module and layer that is assigned to your MIDI controller)

    if lockedOn == False :   # they are not in sync
       if myMidiVal < myM8Val :
          if lastCheck == 'high' :
             lockedOn = True   # if the MIDI was less than the m8 value and now it is more - we've crossed our threshold
          lastCheck ='low'
       elif myMidiVal > myM8Val :
                if lastCheck == 'low' :
             lockedOn = True   # if the MIDI was greater than the m8 value and now it is less - we've crossed our threshold
          lastCheck = 'high'

    if lockedOn:      ## this means we're locked on
       modul8.setValue(modul8 keyword, layer, module.getvalue(module keyword + layer) )



    . so, when you start moving your MIDI controller (@ 0.25 ) lastCheck will equal 'low' until it becomes greater than the value for the ctrl_layer_alpha (0.50 in this example) then when you hit 0.51 - myMidiVal will be greater than myM8Val, lastCheck will equal 'low' -so lockedOn would get set to 'True' - and in the second logic block it should assign the current slider value to the modul8 parameter.

    . i'm sure this could use some tweaking, but this is they way i've always approached it.

    . good luck ! :D


    -james
    (a nomad. )
  • Josine
    junior Member
    Posts: 3
    Joined: Fri Nov 23, 2012 7:20 pm

    Re: How to avoid jumping faders

    by Josine » Mon Jan 14, 2013 10:37 pm

    Hi James,

    Thanks for your help on this one :)

    I used the code from your last post. I made a module with one slider named ''fader1''. I put this code in directevent.

    Code: Select all

    lockedOn = False
    lastCheck = ''

    myM8Val = modul8.getValue('ctrl_layer_alpha', 1)
    myMidiVal = module.getValue('fader1', 0)

    if lockedOn == False :   # they are not in sync
       if myMidiVal < myM8Val :
          if lastCheck == 'high' :
             lockedOn = True   
             lastCheck = 'low'
       elif myMidiVal > myM8Val :
          if lastCheck == 'low' :
             lockedOn = True   
             lastCheck = 'high'

    if lockedOn:      ## this means we're locked on
       modul8.setValue('ctrl_layer_alpha', 1, module.getValue('fader1', 0) )


    But it isn't working.. the value of the slider in the module doesn't get updated to the first layer in modul8..
    I tried a few things, but i'm quite new to programming.. any ideas on what i have to change to get this working?

    Thanks in advance :)
  • Lutz
    member
    Posts: 10
    Joined: Wed Oct 12, 2011 2:38 pm

    Re: How to avoid jumping faders

    by Lutz » Wed Jan 16, 2013 7:01 pm

    Hi Josine,
    put your code into MessageEvent().
    Thats where you communicate with the user interface.
    Use DirectEvent() for 'direct' (!) communication with your hardware (midi, dmx, keyboard)

    Lutz
  • raylab
    junior Member
    Posts: 2
    Joined: Fri Jan 18, 2013 1:30 pm

    Re: How to avoid jumping faders

    by raylab » Fri Jan 18, 2013 1:35 pm

    Just shared a modified version of UDART Two way module in public library, see (raylab) Hybrid Two Way MIDI (UDART).
    Original version requires devices that support MIDI feedback, this one also works with any cheap controller by locking the sloder/knob values until match.

    Added:
    1. Extensions to handle devices or controls that do not support MIDI feedback: module will lock the incoming values until they match the current value of Modul8 control (sliders en knobs), so they wan’t jump when switching between layers. Use ‘feedback’ checkbox to choose. If checked, feedback is sent to control (original behaviour). If unchecked, module will lock the incoming value until match.
    2. Togggle option for buttons (very useful)
    3. Save/Load current midi map to/from file. Loading simply overwrites the current map.

    This is beta, please test before using in production!
  • Kerena104
    junior Member
    Posts: 2
    Joined: Fri Jan 09, 2015 5:20 pm

    Re: How to avoid jumping faders

    by Kerena104 » Fri Jan 09, 2015 5:28 pm

    In Windows Embedded 8 Standard (Standard 8), you can create custom modules to easily and automatically deploy custom software and device drivers to your device. By creating modules in Module Designer (MOD), you can add files and programs to your module and specify how these files are installed on the device. After you create your custom module, you can import the module directly into Image Configuration Editor (ICE) and Image Builder Wizard (IBW) so that you can easily incorporate your software with the other operating system modules that make up your device configuration.
    Kerena

Who is online

Users browsing this forum: No registered users and 3 guests