documentation, cleanup

This commit is contained in:
Mikayla Dobson
2023-04-10 17:12:21 -05:00
parent 212bf11216
commit 4c91814545
3 changed files with 65 additions and 11 deletions

28
main.py
View File

@@ -1,8 +1,21 @@
# PICOSYNTH
# open source semi-modular synthesizer model
# developer: Mikayla Dobson
# github: github.com/innocuous-symmetry
""" " " " " " " " " " " " " " " " " " " " " " "
IMPORTS
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """
from machine import Pin, ADC, PWM
from random import randint
from math import floor, ceil
from time import sleep
""" " " " " " " " " " " " " " " " " " " " " " "
CONSTANTS
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """
__SYSTEM_PWM_FREQUENCY__ = 1000
HIGH = 65535
@@ -80,6 +93,9 @@ SYNTH_CONFIG = {
}
}
""" " " " " " " " " " " " " " " " " " " " " " "
INDEPENDENT FUNCTIONS FOR TESTING, COMMON USE CASES
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """
def blink(controller: type[ADC], target=Pin(25, Pin.OUT), sleep_duration = 1000):
if not controller: pass
@@ -98,7 +114,7 @@ def blink(controller: type[ADC], target=Pin(25, Pin.OUT), sleep_duration = 1000)
""" " " " " " " " " " " " " " " " " " " " " " "
" BEGIN CLASS DEFINITIONS FOR BASIC HARDWARE BEHAVIORS
" CLASS DEFINITIONS FOR BASIC HARDWARE BEHAVIORS
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """
# for representing and interacting with waveform data
@@ -227,9 +243,19 @@ class Synthesizer:
def __init__(self, config):
self.config = config
""" " " " " " " " " " " " " " " " " " " " " " "
SYNTHESIZER DEFINITION AND PIN/COMPONENT ASSIGNMENTS
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """
gate_out = PWMOutput(15, 0)
voct_out = PWMOutput(16, 0)
""" " " " " " " " " " " " " " " " " " " " " " "
START
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """
while True:
random_value = VOCT_PITCH_VALUES[randint(0, len(VOCT_PITCH_VALUES) - 1)] * 65535
print(int(random_value))