"""LFO data"""
from enum import Enum
[docs]
class LFOSyncNote(Enum):
"""LFO sync note values"""
[docs]
BAR_3_16 = 12 # 3/16 bar
[docs]
BAR_3_32 = 15 # 3/32 bar
[docs]
BAR_1_12 = 16 # 1/12 bar
[docs]
BAR_1_16 = 17 # 1/16 bar
[docs]
BAR_1_24 = 18 # 1/24 bar
[docs]
BAR_1_32 = 19 # 1/32 bar
@staticmethod
[docs]
def get_display_name(value: int) -> str:
"""Get digital name for sync note value"""
names = {
0: "16",
1: "12",
2: "8",
3: "4",
4: "2",
5: "1",
6: "3/4",
7: "2/3",
8: "1/2",
9: "3/8",
10: "1/3",
11: "1/4",
12: "3/16",
13: "1/6",
14: "1/8",
15: "3/32",
16: "1/12",
17: "1/16",
18: "1/24",
19: "1/32",
}
return names.get(value, "???")
@staticmethod
[docs]
def get_all_display_names() -> list:
"""Get list of all digital names in order"""
return [LFOSyncNote.get_display_name(i) for i in range(20)]
@staticmethod
[docs]
def display_name(value: int) -> str:
"""Get digital name for sync note value"""
names = {
0: "16",
1: "12",
2: "8",
3: "4",
4: "2",
5: "1",
6: "3/4",
7: "2/3",
8: "1/2",
9: "3/8",
10: "1/3",
11: "1/4",
12: "3/16",
13: "1/6",
14: "1/8",
15: "3/32",
16: "1/12",
17: "1/16",
18: "1/24",
19: "1/32",
}
return names.get(value, "???")
[docs]
class LFOShape(Enum):
"""LFO waveform shapes"""
[docs]
TRIANGLE = 0x00 # Triangle wave
[docs]
SINE = 0x01 # Sine wave
[docs]
SAW = 0x02 # Sawtooth wave
[docs]
SQUARE = 0x03 # Square wave
[docs]
SAMPLE_HOLD = 0x04 # Sample & Hold
@staticmethod
[docs]
def get_display_name(value: int) -> str:
"""Get digital name for LFO shape"""
names = {0: "TRI", 1: "SIN", 2: "SAW", 3: "SQR", 4: "S&H", 5: "RND"}
return names.get(value, "???")