Skip to content

Commit

Permalink
Sync manifest and midi changes with main.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpwe committed Apr 15, 2024
2 parents 168c12c + 8b64848 commit f284e80
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
1 change: 1 addition & 0 deletions tulip/esp32s3/boards/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
require("umqtt.simple")
freeze("$(MPY_DIR)/../tulip/shared/py")
freeze("$(MPY_DIR)/../amy", "amy.py")
freeze("$(MPY_DIR)/../amy", "juno.py")
#freeze("$(MPY_DIR)/lib/micropython-lib/micropython/utarfile", "utarfile.py")
1 change: 1 addition & 0 deletions tulip/ios/variants/manifest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include("$(MPY_DIR)/extmod/asyncio")
freeze("$(MPY_DIR)/../tulip/shared/py")
freeze("$(MPY_DIR)/../amy", "amy.py")
freeze("$(MPY_DIR)/../amy", "juno.py")

1 change: 1 addition & 0 deletions tulip/linux/variants/manifest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include("$(MPY_DIR)/extmod/asyncio")
freeze("$(MPY_DIR)/../tulip/shared/py")
freeze("$(MPY_DIR)/../amy", "amy.py")
freeze("$(MPY_DIR)/../amy", "juno.py")

1 change: 1 addition & 0 deletions tulip/macos/variants/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
include("$(MPY_DIR)/extmod/asyncio")
freeze("$(MPY_DIR)/../tulip/shared/py")
freeze("$(MPY_DIR)/../amy", "amy.py")
freeze("$(MPY_DIR)/../amy", "juno.py")

40 changes: 19 additions & 21 deletions tulip/shared/py/midi.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,25 @@ def get_sustained_notes_set(channel):
sustained_notes_dict[channel] = set()
return sustained_notes_dict[channel]

def pitch_bend(channel, val):
# get the active voices for this channel
if channel not in voices_for_channel:
return
v_str = ""
for v in voices_for_channel[channel]:
if v in voices_active: v_str = v_str + "%d," % (v)
if(len(v_str)):
amy.send(voices=v_str[:-1], pitch_bend=val)

def sustain_pedal(channel, value):
if value:
set_in_sustain(channel, True)
else:
set_in_sustain(channel, False)
sustained_notes = get_sustained_notes_set(channel)
for midinote in sustained_notes:
note_off(channel, midinote)
sustained_notes.remove(midinote) # Modifies the global.

# TODO - REPLACE WITH Synth
# Get the voice for this chan/note
Expand Down Expand Up @@ -227,27 +246,6 @@ def find_voice(channel, midinote):
note_for_voice[v] = midinote
return v

def pitch_bend(channel, val):
# get the active voices for this channel
if channel not in voices_for_channel:
return
v_str = ""
for v in voices_for_channel[channel]:
if v in voices_active: v_str = v_str + "%d," % (v)
if(len(v_str)):
amy.send(voices=v_str[:-1], pitch_bend=val)

def sustain_pedal(channel, value):
if value:
set_in_sustain(channel, True)
else:
set_in_sustain(channel, False)
sustained_notes = get_sustained_notes_set(channel)
for midinote in sustained_notes:
note_off(channel, midinote)
sustained_notes.remove(midinote) # Modifies the global.

# TODO - REPLACE WITH Synth
def note_on(channel, midinote, vel):
global arpeg
# Drum channel is special
Expand Down

0 comments on commit f284e80

Please sign in to comment.