# # # # # # # # # #
# Say Constants
# # # # # # # # # #

# the path to where the say command exists
SAY_EXECUTABLE = "/usr/bin/say"

SAY_FILE_FORMATS = ["wav", "aiff"]

# voices which respect [[TUNE]] input
SAY_TUNED_VOICES = ["Alex", "Fred", "Victoria"]

# opening tag for tuned input to say
SAY_TUNE_TAG = "[[inpt TUNE]]"

# colors which can used to style the interactive output
SAY_COLORS = ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"]

# values for --data-format to determine the endianess
SAY_ENDIANESS = ["BE", "LE"]

# values for --data-format to determine the data type
SAY_DATA_TYPES = ["F", "I", "UI"]

# values for --data-format to determine the sample size
SAY_SAMPLE_SIZES = [8, 16, 24, 32, 64]

# this is the max sample rate, anything above this will
# generate upsampled audio
# from: https://stackoverflow.com/questions/9729153/error-on-say-when-output-format-is-wave
SAY_MAX_SAMPLE_RATE = 22050

# # # # # # # # # #
# Phoneme Constants
# # # # # # # # # #
# Taken from: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/SpeechSynthesisProgrammingGuide/Phonemes/Phonemes.html#//apple_ref/doc/uid/TP40004365-CH9-SW1

# these phonemes can create continuous pitches
SAY_ALL_PHONEMES = [
    "AE",
    "EY",
    "AO",
    "AX",
    "IY",
    "EH",
    "IH",
    "AY",
    "IX",
    "AA",
    "UW",
    "UH",
    "UX",
    "OW",
    "AW",
    "OY",
    "b",
    "C",
    "d",
    "D",
    "f",
    "g",
    "h",
    "J",
    "k",
    "l",
    "m",
    "n",
    "N",
    "p",
    "r",
    "s",
    "S",
    "t",
    "T",
    "v",
    "w",
    "y",
    "z",
    "Z",
]

# generated by running scripts/classify_phonemes.py
SAY_PHONEME_CLASSES = ["drone", "noise", "note"]
SAY_PHONEME_VOICE_CLASSES = {
    "Alex": {
        "drone": [
            "AE",
            "EY",
            "AO",
            "AX",
            "IY",
            "EH",
            "IH",
            "AY",
            "IX",
            "UW",
            "OW",
            "OY",
            "h",
            "l",
            "m",
            "n",
            "N",
            "r",
        ],
        "noise": ["C", "d", "D", "f", "J", "k", "p", "s", "S", "t", "T", "v", "z"],
        "note": ["AA", "UH", "UX", "AW", "b", "g", "w", "y", "Z"],
    },
    "Fred": {
        "drone": [
            "AE",
            "EY",
            "AO",
            "AX",
            "IY",
            "EH",
            "IH",
            "AY",
            "IX",
            "AA",
            "UW",
            "UH",
            "UX",
            "OW",
            "AW",
            "OY",
            "D",
            "l",
            "m",
            "n",
            "N",
            "r",
            "v",
            "w",
            "y",
            "z",
            "Z",
        ],
        "note": [  # all of Fred's drones work as notes.
            "AE",
            "EY",
            "AO",
            "AX",
            "IY",
            "EH",
            "IH",
            "AY",
            "IX",
            "AA",
            "UW",
            "UH",
            "UX",
            "OW",
            "AW",
            "OY",
            "D",
            "l",
            "m",
            "n",
            "N",
            "r",
            "v",
            "w",
            "y",
            "z",
            "Z",
        ],
        "noise": ["b", "C", "d", "f", "g", "h", "J", "k", "p", "s", "S", "t", "T"],
    },
    "Victoria": {
        "drone": [
            "AE",
            "EY",
            "AO",
            "AX",
            "IY",
            "EH",
            "IH",
            "AY",
            "IX",
            "AA",
            "UW",
            "UH",
            "UX",
            "AW",
            "OY",
            "l",
            "m",
            "n",
            "N",
            "r",
            "v",
            "w",
            "y",
        ],
        "noise": ["C", "d", "D", "f", "h", "k", "p", "s", "S", "t", "T", "z", "Z"],
        "note": ["OW", "b", "g", "J"],
    },
}

SAY_PHONEME_SILENCE = "%"

# this is about the number of
# milliseconds for an individual phoneme
# at which the duration of output stops changing
SAY_PHONEME_MAX_DURATION = 1200

# the midi velocity values above which
# we add an emphasis to a phoneme
SAY_EMPHASIS_VELOCITY_STEPS = [75, 100]
