Skip to content

Commit

Permalink
Merge pull request #243 from shorepine/voicestelljuno6
Browse files Browse the repository at this point in the history
voices tells juno6 to change the UI instead of only on activate()
  • Loading branch information
bwhitman authored Jun 25, 2024
2 parents 65ba00b + 2502ddc commit b3597ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tulip/shared/py/juno6.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,13 @@ def midi_event_cb(m):
def refresh_with_new_music_map():
"""Called when the active midid channels changes, so we can update menu."""
channel_selector.update_items(get_active_midi_channels_as_str())
setup_from_midi_chan_str(str(midi_channel))


# called when switching to me. update stuff
def activate(screen):
# Make sure the channel selector is in sync with current system state.
channel_selector.update_items(get_active_midi_channels_as_str())
# Make sure patch is in sync with current channel.
setup_from_midi_chan_str(str(midi_channel))


def deactivate(screen):
Expand Down Expand Up @@ -645,3 +644,6 @@ def run(screen):
screen.refresh_with_new_music_map = refresh_with_new_music_map

midi.add_callback(midi_event_cb)

# Make sure patch is in sync with current channel.
setup_from_midi_chan_str(str(midi_channel))
1 change: 0 additions & 1 deletion tulip/shared/py/midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def music_map(self, channel, patch_number=0, voice_count=None):
else:
# Setting up a new channel.
self.add_synth(channel, patch_number, voice_count)

def get_active_channels(self):
"""Return numbers of MIDI channels with allocated synths."""
return list(self.synth_per_channel.keys())
Expand Down

0 comments on commit b3597ca

Please sign in to comment.