Source code for jdxi_editor.midi.data.lfo.lfo

"""LFO data"""

from enum import Enum


[docs] class LFOSyncNote(Enum): """LFO sync note values"""
[docs] BAR_16 = 0 # 16 bars
[docs] BAR_12 = 1 # 12 bars
[docs] BAR_8 = 2 # 8 bars
[docs] BAR_4 = 3 # 4 bars
[docs] BAR_2 = 4 # 2 bars
[docs] BAR_1 = 5 # 1 bar
[docs] BAR_3_4 = 6 # 3/4 bar
[docs] BAR_2_3 = 7 # 2/3 bar
[docs] BAR_1_2 = 8 # 1/2 bar
[docs] BAR_3_8 = 9 # 3/8 bar
[docs] BAR_1_3 = 10 # 1/3 bar
[docs] BAR_1_4 = 11 # 1/4 bar
[docs] BAR_3_16 = 12 # 3/16 bar
[docs] BAR_1_6 = 13 # 1/6 bar
[docs] BAR_1_8 = 14 # 1/8 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
[docs] RANDOM = 0x05 # Random
@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, "???")