GETTING STARTED
Coding on SPOKE
SPOKE runs on CircuitPython — a beginner-friendly version of Python. You don't need to be a programmer. Most of the time, changing just a few numbers is enough to completely change what your SPOKE does.
THE CODE FILE
All the code lives on your SPOKE in a single file called code.py. When you power up the board, it automatically runs this file — so always make sure your edits are saved as code.py.
How the file is laid out:
Comments — Lines starting with # are ignored by the board. They're just notes for you to read.
Libraries — Import lines load shortcuts ("libraries") so you don't have to write everything from scratch.
MIDI notes — Numbers here set which MIDI note each touch pad plays. Change the number, change the note — it's that simple.
Main loop — The part that keeps running, watching for touches and sending the right signals.
The golden rule: you only ever need to edit the MIDI note numbers to change what your SPOKE plays. Everything else can stay exactly as it is. In the SPOKE Code Playground there are other examples and templates for you to play around with. Watch this video here for more info.
WAYS TO EDIT THE CODE
Pick whichever feels right. The playground and CircuitPython editor both show you errors if something goes wrong, which is handy when you're learning.
SPOKE Playground (Recommended)
Code and test directly in your browser. No setup needed.
https://tom-vulpes.github.io/SpokeWebMidi/playground.html
CircuitPython Editor (Web-based)
Official online editor with error output.
https://code.circuitpython.org
Thonny (Desktop app)
Free IDE with a built-in console to catch errors.
Notepad / TextEdit (Quickest)
Any basic text editor works. No error display, but totally fine for simple edits.
For a more in-depth look at the code, along with lessons and examples, please try out the SPOKE-Learning interactive page listed here.
After this we have the setup for what MIDI notes our touch pins are going to play. Editing these numbers will edit what midi note gets played. It’s that simple!
SPOKE can do way more than just send single MIDI notes. It can send chords, arpeggiate, send sequences of notes, act as a step sequencer and probably more we’ve not tried yet! There is a github page here with example code, all you need to do is copy and paste the code into the board and hit save! https://github.com/Tom-Vulpes/Spoke/tree/main/MIDI%20
SPOKE can also work as a Human Interface Device, a HID, and act as a keyboard or a mouse. There are example code for that on the Github page too.