Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit fb74041

Browse files
authored
Merge pull request #1 from dcooperdalrymple/dev
Merging new features from dev for v0.2.0.
2 parents de76342 + 0c536bb commit fb74041

39 files changed

+1207
-482
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ _autosave-*
1717
*-save.pro
1818
*-save.kicad_pcb
1919
fp-info-cache
20+
*.swp
2021

2122
# Netlist files (exported from Eeschema)
2223
*.net

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ LIB = pico_synth_sandbox
99
LIB_SRCS := \
1010
__init__ \
1111
tasks \
12+
board \
1213
display \
1314
encoder \
1415
audio \

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ A few of the provided examples use pre-recorded audio samples for playback. Thes
4242
Installation
4343
------------
4444

45-
1. Download and install CircuitPython bootloader: `instructions & UF2 file <https://circuitpython.org/board/raspberry_pi_pico/>`_.
45+
1. Download and install CircuitPython bootloader: `instructions & UF2 file <https://circuitpython.org/board/raspberry_pi_pico/>`_. Requires version 9.0.0-alpha6 or greater.
4646
2. Ensure that your device is connected and mounted as `CIRCUITPYTHON`.
4747
3. Copy `requirements.txt` to the root folder of your device, make sure that the `circup` tool is installed in your environment with `pip3 install circup`, and run `circup update` to install all necessary libraries onto your device.
4848
4. Copy the desired code example to the root folder of your device as `code.py` and perform a software reset to run the code.

bin/mpy-cross

-1.19 MB
Binary file not shown.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Features
3131
* Device-level settings using ``settings.toml`` file to generate audio driver, display, MIDI, and other hardware objects
3232
* Keyboard handling for key priority and voice allocation
3333
* :class:`pico_synth_sandbox.arpeggiator.Arpeggiator` and :class:`pico_synth_sandbox.sequencer.Sequencer` classes based on :class:`pico_synth_sandbox.timer.Timer` class with support for bpm, step, and gate
34-
* :class:`pico_synth_sandbox.waveform.Waveform` generator to quickly create numpy arrays
34+
* `pico_synth_sandbox.waveform` generators to quickly create numpy arrays
3535
* Voice based structure to simplify note and parameter management among multiple :class:`synthio.Note` instances
3636
* Multiple :class:`pico_synth_sandbox.voice.Voice` types available:
3737

docs/software.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Software Installation
22
=====================
33

4-
1. Download and install CircuitPython bootloader: `instructions & UF2 file <https://circuitpython.org/board/raspberry_pi_pico/>`_.
4+
1. Download and install CircuitPython bootloader: `instructions & UF2 file <https://circuitpython.org/board/raspberry_pi_pico/>`_. Requires version 9.0.0-alpha6 or greater.
55
2. Ensure that your device is connected and mounted as ``CIRCUITPYTHON``.
66
3. Copy ``requirements.txt`` to the root folder of your device, make sure that the ``circup`` tool is installed in your environment with ``pip3 install circup``, and run ``circup update`` to install all necessary libraries onto your device.
77
4. Copy the desired code example to the root folder of your device as ``code.py`` and perform a software reset to run the code.

examples/basic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
# GPL v3 License
44

55
import time
6+
from pico_synth_sandbox.board import get_board
67
from pico_synth_sandbox.audio import get_audio_driver
78
from pico_synth_sandbox.synth import Synth
89
from pico_synth_sandbox.voice.oscillator import Oscillator
910

10-
audio = get_audio_driver()
11+
board = get_board()
12+
audio = get_audio_driver(board)
1113
synth = Synth(audio)
1214
synth.add_voice(Oscillator())
1315

examples/display-bar-horizontal.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
# GPL v3 License
44

55
import pico_synth_sandbox.tasks
6+
from pico_synth_sandbox.board import get_board
67
from pico_synth_sandbox.display import Display
78
from pico_synth_sandbox.encoder import Encoder
89

9-
display = Display()
10+
board = get_board()
11+
12+
display = Display(board)
1013
display.enable_horizontal_graph()
1114

1215
value = 0
@@ -22,7 +25,7 @@ def update_value():
2225
)
2326
update_value()
2427

25-
encoder = Encoder()
28+
encoder = Encoder(board)
2629
def increment():
2730
global value
2831
if value < 100:

examples/display-bar-vertical.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
# GPL v3 License
44

55
import pico_synth_sandbox.tasks
6+
from pico_synth_sandbox.board import get_board
67
from pico_synth_sandbox.display import Display
78
from pico_synth_sandbox.encoder import Encoder
89

9-
display = Display()
10+
board = get_board()
11+
12+
display = Display(board)
1013
display.enable_vertical_graph()
1114

1215
value = 0
@@ -22,7 +25,7 @@ def update_value():
2225
)
2326
update_value()
2427

25-
encoder = Encoder()
28+
encoder = Encoder(board)
2629
def increment():
2730
global value
2831
if value < 100:

examples/drums.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# GPL v3 License
44

55
import pico_synth_sandbox.tasks
6+
from pico_synth_sandbox.board import get_board
67
from pico_synth_sandbox.display import Display
78
from pico_synth_sandbox.encoder import Encoder
89
from pico_synth_sandbox.audio import get_audio_driver
@@ -11,12 +12,14 @@
1112
from pico_synth_sandbox.keyboard import get_keyboard_driver
1213
from pico_synth_sandbox.arpeggiator import Arpeggiator
1314

14-
display = Display()
15+
board = get_board()
16+
17+
display = Display(board)
1518
display.write("PicoSynthSandbox", (0,0))
1619
display.write("Loading...", (0,1))
1720
display.update()
1821

19-
audio = get_audio_driver()
22+
audio = get_audio_driver(board)
2023
synth = Synth(audio)
2124
synth.add_voice(Kick())
2225
synth.add_voice(Snare())
@@ -26,7 +29,7 @@
2629
synth.add_voice(closed_hat)
2730
synth.add_voice(open_hat)
2831

29-
keyboard = get_keyboard_driver()
32+
keyboard = get_keyboard_driver(board)
3033
arpeggiator = Arpeggiator()
3134
keyboard.set_arpeggiator(arpeggiator)
3235

@@ -47,7 +50,7 @@ def release(notenum, keynum=None):
4750
keyboard.set_release(release)
4851

4952
mod_value = 64
50-
encoder = Encoder()
53+
encoder = Encoder(board)
5154
def update_envelope():
5255
closed_hat.set_time(float(mod_value) / 127.0)
5356
open_hat.set_time(float(mod_value) / 127.0)

0 commit comments

Comments
 (0)