Arp Force Repaint?



  • I have a button to invert the notes on the arp FloatingTile, it works as expected, but sometimes doesn't repaint the FloatingTile, and requires multiple clicks to do so (even though the notes are changing).

    Is there any way to force a repaint for a FloatingTile?

    inline function onButton_ArpNotesInvertControl(component, value)
    {
    	if (value)
        {     
            local notes = [];
            for (s=0; s<SliderPack_ArpNotes.getNumSliders(); s++)
            {
                notes.push(SliderPack_ArpNotes.getSliderValueAt(s));
                SliderPack_ArpNotes.setSliderAtIndex(s, 0-notes[s]);
                SliderPack_ArpNotes.changed();
            }           
        }
    };
    

    Update: I believe the repaint issue is with the Arp's FloatingTile, not the front end one. Regular scripts work but this inversion one just doesn't for some reason.



  • Quick question:

    Doesn't it do that when the arp is running?
    When the arp is not running everything goes well!?



  • @MikeB So while the arp running it won't repaint at all, after noteOff it takes 2-3 clicks (which work, just don't repaint) and then it repaints every click after that.

    Also I said FloatingTile in the post but I obviously mean SliderPacks 😉



  • Here's a quick video to demonstrate what I mean

    I think it has something to do with both getting and setting sliders in the same script.



  • Okay some more weirdness:

    After hitting the button and having it not update, if I right click on either the front-end sliderpack or the arp's one, it calls the repaint and moves the sliders as expected.

    Update: Okay, if the Arp Loop finishes, the repaint works on click. It also works normally as long as I don't call getSliderValueAt() anywhere in the script...



  • SUCCESS!

    var arpNotes = [];
    
    inline function onButton_ArpNotesInvertControl(component, value)
    { 
        if (value)
        {     
            for (s=0; s<SliderPack_ArpNotes.getNumSliders(); s++)
            {
                arpNotes[s] = SliderPack_ArpNotes.getSliderValueAt(s);
            } 
        }
        
        else
        {
            for (n=0; n<SliderPack_ArpNotes.getNumSliders(); n++)
            {
                SliderPack_ArpNotes.setSliderAtIndex(n, 0-arpNotes[n]);
            } 
        }
        SliderPack_ArpNotes.changed();
    };
    

    Make sure the Button is momentary, this splits the script and calls the getValue in the on state, then changes the sliders in the off state.



  • Wonderful 👍

    I noticed that too - that when the arp is running almost no changes are made to the sliderpack.
    That's why I'm trying to somehow separate the sliderpack (graphics) from the arp (audio).



  • @MikeB I guess a scriptpanel with custom paintroutine would solve everything, but it would take a lot of coding which I don't really want to do if I can avoid it 😂


Log in to reply
 

7
Online

1.3k
Users

4.1k
Topics

36.5k
Posts