"""Analog LFO"""
from enum import Enum
[docs]
LFO_RANGES = {
"shape": (0, 5),
"rate": (0, 127),
"fade": (0, 127),
"sync": (0, 1),
"sync_note": (0, 19),
"pitch": (-63, 63),
"filter": (-63, 63),
"amp": (-63, 63),
"key_trig": (0, 1),
}
[docs]
LFO_TEMPO_SYNC_NOTES = [
"16", # 0
"12", # 1
"8", # 2
"4", # 3
"2", # 4
"1", # 5
"3/4", # 6
"2/3", # 7
"1/2", # 8
"3/8", # 9
"1/3", # 10
"1/4", # 11
"3/16", # 12
"1/6", # 13
"1/8", # 14
"3/32", # 15
"1/12", # 16
"1/16", # 17
"1/24", # 18
"1/32", # 19
]
[docs]
class AnalogLFOShape(Enum):
"""Analog LFO waveform shapes"""
[docs]
TRIANGLE = 0 # Triangle wave
[docs]
SAW = 2 # Sawtooth wave
[docs]
SQUARE = 3 # Square wave
[docs]
SAMPLE_HOLD = 4 # Sample & Hold
@property
[docs]
def display_name(self) -> str:
"""Get display name for LFO shape"""
names = {0: "TRI", 1: "SIN", 2: "SAW", 3: "SQR", 4: "S&H", 5: "RND"}
return names.get(self.value, "???")
[docs]
class AnalogLFOTempoSyncNote(Enum):
"""LFO tempo sync note values"""