forked from Chysn/O_C-HemisphereSuite
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
195 changed files
with
35,161 additions
and
4,462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Custom Build | ||
|
||
on: | ||
discussion_comment: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
name: Build Custom Firmware | ||
if: contains(github.event.comment.body, '/buildthis') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: phazerville | ||
|
||
- name: Setup env | ||
env: | ||
GH_COMMENT: ${{ github.event.comment.body }} | ||
run: | | ||
echo "OC_ARTIFACT_TAG=custom_${GITHUB_ACTOR}-$(software/o_c_REV/resources/oc_build_tag.sh)" | tr '/' '_' >> $GITHUB_ENV | ||
echo "CUSTOM_BUILD_FLAGS=$(python software/o_c_REV/resources/parse_build_request.py)" >> $GITHUB_ENV | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.platformio | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
cache: 'pip' | ||
cache-dependency-path: '**/requirements.txt' | ||
|
||
- run: | | ||
pip3 install --upgrade pip | ||
pip3 install -r .github/workflows/requirements.txt | ||
- name: Build firmware | ||
working-directory: software/o_c_REV/ | ||
run: | | ||
pio run -e custom | ||
- name: Copy artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: o_C-${{env.OC_ARTIFACT_TAG}} | ||
path: software/o_c_REV/.pio/build/*/*.hex | ||
|
||
# TODO: this will only work with Issues or Pull Requests... | ||
# - name: Add follow-up comment to discussion | ||
# uses: actions/github-script@v6 | ||
# if: always() | ||
# with: | ||
# script: | | ||
# const name = '${{ github.workflow }}'; | ||
# const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'; | ||
# const success = '${{ job.status }}' === 'success'; | ||
# const body = `${name}: ${success ? 'succeeded ✅' : 'failed ❌'}\n${url}`; | ||
# | ||
# await github.rest.issues.createComment({ | ||
# issue_number: context.issue.number, | ||
# owner: context.repo.owner, | ||
# repo: context.repo.repo, | ||
# body: body | ||
# }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: PlatformIO CI | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'software/o_c_REV/**' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup env | ||
run: | | ||
echo "OC_ARTIFACT_TAG=${GITHUB_REF_NAME}-$(software/o_c_REV/resources/oc_build_tag.sh)" | tr '/' '_' >> $GITHUB_ENV | ||
- name: Cache PlatformIO | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.platformio | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
cache: 'pip' | ||
cache-dependency-path: '**/requirements.txt' | ||
|
||
- run: | | ||
pip3 install --upgrade pip | ||
pip3 install -r .github/workflows/requirements.txt | ||
- name: Build firmware | ||
working-directory: software/o_c_REV/ | ||
run: | | ||
pio run | ||
- name: Copy artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: o_C-${{env.OC_ARTIFACT_TAG}} | ||
path: software/o_c_REV/.pio/build/*/*.hex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
platformio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ shelved/ | |
Hemisphere\ Suite.cpp | ||
builds | ||
.pio | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
API Notes | ||
=== | ||
|
||
### Basics | ||
|
||
The o_C firmware operates with several "concurrent" threads. | ||
(really they interrupt each other I guess) | ||
|
||
There is a main _loop_ as well as an _ISR_ that fires from a timer. | ||
The _loop_ acts as a watchdog while the _ISR_ does all the work. | ||
UI events are on a seperate _ISR_ timer. | ||
The display driver and input polling are also on independent interrupts. | ||
So that's at least 4? separate processes happening in a cascade | ||
for every cycle, which is 60us (nanoseconds) or 16.666khz | ||
|
||
That's the general idea. | ||
|
||
Anyway, we have top-level *Apps* and then there are *Applets* as implemented | ||
in the _Hemisphere_ *App*. An *Applet* inherits the base class _HemisphereApplet_ | ||
and gains the superpowers necessary to live on half of your module's screen. | ||
|
||
### Base Classes | ||
|
||
The two primary interfaces in the Hemisphere API are _HSApplication_ and _HemisphereApplet_. | ||
They both have many similarly named methods for I/O and graphics, with | ||
_HemisphereApplet_ taking extra considerations for offsetting both in the right side. | ||
|
||
All of the hardware details are neatly abstracted under these two interfaces. If you | ||
simply want to make an applet that does some stuff, these APIs are your starting point. | ||
|
||
### Applets | ||
|
||
There are a few different things an Applet must do: | ||
* Controller - the main logic computed every tick (every time the ISR fires) | ||
* View - draw the pixels on the screen (there are many helpful _gfx*_ functions) | ||
* UI Event Handling: | ||
* OnButtonPress - what to do when the encoder button is pressed | ||
* OnEncoderMove - what to do when the encoder rotated | ||
* OnDataRequest / OnDataReceive - how to save / load state | ||
|
||
There is also a `Start()` function for initializing things at runtime, | ||
plus some Help text. That's about it. | ||
|
||
You can easily try it out by copying the `HEM_Boilerplate.ino.txt` file into place, | ||
and then adding your computations to its skeleton. | ||
|
||
### Applet Functions | ||
|
||
Function? or Method? Either way, this is how you do the things. | ||
|
||
#### I/O Functions | ||
The main argument of each is the channel to operate on - each half of the | ||
screen gets 2 channels. So _n_ is typically either 0 or 1. | ||
|
||
**Input**: | ||
* Clock(n) - has the digital input received a new clock pulse? | ||
* Gate(n) - is the digital input held high? | ||
* In(n) - Raw value of the CV input | ||
* DetentedIn(n) - this one reads 0 until it's past a threshold ~ a quartertone | ||
|
||
**Output**: | ||
* ClockOut(n) - hold the output high for a pulse length | ||
* GateOut(n, on_off) - set the output high or low | ||
* Out(n, raw) - set the output to an explicit value | ||
|
||
I've added a standard case function for modulating a parameter with a certain input. | ||
* Modulate(param, n, min, max) - automatically scales the input and modifies param | ||
|
||
#### gfx Functions | ||
There are many strategies for drawing things on the screen, and therefore, many | ||
graphics related functions. You can see them for yourself in `HemisphereApplet.h` | ||
All of them typically take _x_ and _y_ coordinates for the first two arguments, | ||
followed by _width_ and _height_, or another _x,y_ pair. | ||
_x_ is how many pixels from the left edge of the screen. | ||
_y_ is how many pixels from the top edge of the screen. | ||
|
||
Some essentials: *gfxPrint*, *gfxPixel*, *gfxLine*, *gfxCursor*, | ||
*gfxFrame*, *gfxBitmap*, *gfxInvert* | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
TODO | ||
=== | ||
|
||
* Fully merge "abandoned/refactoring" branch from pld | ||
* Auto-tuner floor/ceiling detection (fail gracefully) | ||
* Move calibration routines to a proper App | ||
* Runtime filtering/hiding of Applets | ||
* Flexible input remapping for Hemisphere | ||
- generalize applet params for assignment | ||
* global quantizer settings in Hemisphere Config | ||
* Update Boilerplates | ||
* Automatic stop for internal Clock? | ||
* Polyphonic MIDI input tracking | ||
* MIDI output for all apps? | ||
|
||
[APP IDEAS] | ||
* QUADRANTS | ||
* Two Spheres | ||
* Snake Game | ||
|
||
[DONE] | ||
* add swing/shuffle to internal clock | ||
* applet with modal interchange - MultiScale or ScaleDuet | ||
* Add auto-tuner to Calibr8or | ||
* ProbMeloD - alternate melody on 2nd output | ||
* Fix FLIP_180 calibration | ||
* Add Clock Setup to Calibr8or | ||
* Calibr8or screensaver | ||
* Pull in Automatonnetz | ||
* Sync-Start for internal Clock | ||
* General Config screen (long-press right button) | ||
* better MIDI input message delegation (event listeners?) | ||
* import alternative grids_resources patterns for DrumMap2 | ||
* Add Root Note to DualTM |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.