Skip to content

Commit

Permalink
Merge pull request #240 from shorepine/alles_client
Browse files Browse the repository at this point in the history
Fixes for Alles (client and insert_time)
  • Loading branch information
bwhitman authored Nov 2, 2024
2 parents f1d1b46 + 274f024 commit ef5e2e2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion amy.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
RESET_ALL_OSCS, RESET_TIMEBASE, RESET_AMY = (8192, 16384, 32768)
AMY_LATENCY_MS = 0

# If set, inserts millis() as time for every call to send(). Will not override an explicitly set time
insert_time = False
override_send = None

mess = []
log = False

Expand Down Expand Up @@ -156,7 +159,7 @@ def message(**kwargs):
# Each keyword maps to two chars, first is the wire protocol prefix, second is an arg type code
# I=int, F=float, S=str, L=list, C=ctrl_coefs
kw_map = {'osc': 'vI', 'wave': 'wI', 'note': 'nF', 'vel': 'lF', 'amp': 'aC', 'freq': 'fC', 'duty': 'dC', 'feedback': 'bF', 'time': 'tI',
'reset': 'SI', 'phase': 'PF', 'pan': 'QC', 'client': 'cI', 'volume': 'vF', 'pitch_bend': 'sF', 'filter_freq': 'FC', 'resonance': 'RF',
'reset': 'SI', 'phase': 'PF', 'pan': 'QC', 'client': 'gI', 'volume': 'vF', 'pitch_bend': 'sF', 'filter_freq': 'FC', 'resonance': 'RF',
'bp0': 'AL', 'bp1': 'BL', 'eg0_type': 'TI', 'eg1_type': 'XI', 'debug': 'DI', 'chained_osc': 'cI', 'mod_source': 'LI',
'eq': 'xL', 'filter_type': 'GI', 'algorithm': 'oI', 'ratio': 'IF', 'latency_ms': 'NI', 'algo_source': 'OL', 'load_sample': 'zL',
'chorus': 'kL', 'reverb': 'hL', 'echo': 'ML', 'load_patch': 'KI', 'store_patch': 'uS', 'voices': 'rL',
Expand All @@ -181,6 +184,10 @@ def message(**kwargs):
raise ValueError('You cannot use \'num_partials\' and \'patch\' in the same message.')
if 'wave' not in kwargs or kwargs['wave'] != BYO_PARTIALS:
raise ValueError('\'num_partials\' must be used with \'wave\'=BYO_PARTIALS.')

if(insert_time and 'time' not in kwargs):
kwargs['time'] = millis()

m = ""
for key, arg in kwargs.items():
if arg is None:
Expand Down

0 comments on commit ef5e2e2

Please sign in to comment.