markusschloesser / MackieC4_P3

A Mackie C4 Midi Remote Script for Ableton 11
20 stars 2 forks source link

switching selected device in the GUI causes self.__chosen_device assignment to None #61

Closed BilldarBagdar closed 3 years ago

BilldarBagdar commented 3 years ago

I introduced this recently. The __chosen_device will reload "eventually" if you click around on the device enough, but I'm working on figuring out why it's switching to None when an event occurs elsewhere and there is clearly a selected device (both times)

 # no devices currently on track <False>                      
 # add event <False> delete event <False> change event <True> 
 # found event index <1> and device <Looper>                  
 # for 'change selected' device event handling                
 # switching __chosen_plugin None to device at index 1        
 # __chosen_plugin is now None                                  <----- wrong
 # __chosen_plugin remains None                                <----- also wrong
 # (ch mode) device row row_index 0 current bank offset <0>   
 # (ch mode) device row row_index 1 current bank offset <0>   
 # (ch mode) device row row_index 2 current bank offset <0>   
 # (ch mode) device row row_index 3 current bank offset <0>   
 # (ch mode) device row row_index 4 current bank offset <0>   
 # (ch mode) device row row_index 5 current bank offset <0>   
 # (ch mode) device row row_index 6 current bank offset <0>   
 # (ch mode) device row row_index 7 current bank offset <0>   
markusschloesser commented 3 years ago

yep, see https://github.com/markusschloesser/MackieC4_P3/issues/56#issuecomment-817214541

BilldarBagdar commented 3 years ago

I just pushed a fix for the above

I still am working on these

#  can't decrement selected_device_bank_index: already bank 0
#  can't increment selected_device_bank_index: already on last bank
#  can't decrement selected_device_bank_index: already bank 0
#  can't decrement selected_device_bank_index: already bank 0
#  can't increment selected_device_bank_index: already on last bank

I only have two devices loaded at this point on this track, so above is correct for me, I haven't tried going to "bank 2" with more than 8 devices on a track. below is switching into device mode by jumping from the encoder button click

#  Param 0 tuple name <State>
#  Param 1 tuple name <Speed>
#  Param 2 tuple name <Reverse>
#  Param 3 tuple name <Quantization>
#  Param 4 tuple name <Monitor>
#  Param 5 tuple name <Song Control>
#  Param 6 tuple name <Tempo Control>
#  Param 7 tuple name <Feedback>

below is what I want to eliminate, this is the case when a device has less than 24 parameters exposed I suspect any time the "last/only page of parameters is not "full"

#  vpot_index + preset_bank_index == invalid parameter index
#  vpot_index + preset_bank_index == invalid parameter index
#  vpot_index + preset_bank_index == invalid parameter index
markusschloesser commented 3 years ago

works fine for me (with those errors in the log), but: are those really errors?

BilldarBagdar commented 3 years ago

correct "the vpot_index + preset_bank_index" log line is not an error, it just means there are no more parameters to map but there are still encoders to map. Now that we recognize that "partial page of parameters" situation triggers "correct behavior", we don't need to see the line in the log. We can comment them out.