Added basic functionality

- gain
- mute
- mixer
- channel setup options
- keybinds and mousebinds
- focus behavior
This commit is contained in:
Brian Hrebec 2026-03-12 23:33:13 -05:00
parent f444daeeca
commit 04060ef5a1
2 changed files with 491 additions and 108 deletions

View file

@ -63,12 +63,21 @@ def set_bitfield(word, val, position, length):
return (word & mask << position) | val
"""
Special level calculation for main/ph outputs
"""
def level_to_db(val):
return 6 + (val - 0xFF) / 2
"""
Special level calculation for main/ph outputs
"""
def db_to_level(val):
return int((val - 6) * 2) + 0xFF
def fader_to_db(val):
return 6 + (abs(val) - 0xFF) / 2
def db_to_fader(db):
return int(10 ** (db / 20) * 0x40000)
def format_db(val, min_db=-120):
@ -76,3 +85,9 @@ def format_db(val, min_db=-120):
return ''
else:
return format(val, '.1f')
def map_range(val, min_, max_, low, high):
return ((clamp(val, min_, max_) - min_) / (max_ - min_)) * (high - low) + low
def clamp(val, low, high):
return max(min(val, high), low)