Skip to content

Commit

Permalink
Merging in Phazerville
Browse files Browse the repository at this point in the history
  • Loading branch information
benirose committed Feb 2, 2024
2 parents c6fee43 + 32d88b5 commit b1d4a43
Show file tree
Hide file tree
Showing 195 changed files with 35,161 additions and 4,462 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/custom.yml
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
# })
45 changes: 45 additions & 0 deletions .github/workflows/firmware.yml
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
1 change: 1 addition & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
platformio
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ shelved/
Hemisphere\ Suite.cpp
builds
.pio
.vscode
79 changes: 79 additions & 0 deletions API-notes.md
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*

12 changes: 0 additions & 12 deletions Hemisphere_Suite.ino

This file was deleted.

63 changes: 39 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,60 @@
Benisphere Suite is Retired!
===

I’m sorry to say that I have stopped working on this firmware. If you want the latest and greatest of what the o_C has to offer, I recommend checking out the [Phazerville fork](https://github.com/djphazer/O_C-BenisphereSuite). It includes all of the work I put into Benispheres and then some!
[![PlatformIO CI](https://github.com/djphazer/O_C-BenisphereSuite/actions/workflows/firmware.yml/badge.svg)](https://github.com/djphazer/O_C-BenisphereSuite/actions/workflows/firmware.yml)

I have extreme gratitude for everyone’s support and enthusiasm over the years, it has meant a lot to me. Contributing to a meaningful open source project has been a goal of mine since I started my career as a developer. Thank you for giving me an opportunity to achieve that dream! I’m sure I will work on modular projects again in the future, feel free to follow me on instagram [@benirosemusic](https://www.instagram.com/benirosemusic/) or my [YouTube channel](https://www.youtube.com/c/benirosemusic) to stay updated on all of my projects and music, and don’t be afraid to reach out! It has been a true blessing to be a part of this community.

## A (previously) active fork expanding upon Hemisphere Suite.
Phazerville Suite - an active o_C firmware fork
===
[![SynthDad's video overview](http://img.youtube.com/vi/XRGlAmz3AKM/0.jpg)](http://www.youtube.com/watch?v=XRGlAmz3AKM "Phazerville; newest firmware for Ornament and Crime. Tutorial and patch ideas")

To download and install the latest release, head to [releases](https://github.com/benirose/O_C-BenisphereSuite/releases).
Watch SynthDad's **video overview** (above) or check the [**Wiki**](https://github.com/djphazer/O_C-BenisphereSuite/wiki) for more info.

To learn more about what makes this fork different than the original Hemisphere Suite, head to [the wiki](https://github.com/benirose/O_C-BenisphereSuite/wiki).
[Download a **Release**](https://github.com/djphazer/O_C-BenisphereSuite/releases) or [Request a **Custom Build**](https://github.com/djphazer/O_C-Phazerville/discussions/38).

Benisphere takes the Hemisphere Suite in a new direction, adding new applets and some enhancements to existing ones, while also removing o_C style apps to make space for these changes.
## Stolen Ornaments

### An alternate firmware to an alternate firmware??
Using [**Benisphere**](https://github.com/benirose/O_C-BenisphereSuite) as a starting point, this branch takes the **Hemisphere Suite** in new directions, with several new applets and enhancements to existing ones. I wanted to collect all the bleeding-edge features from other clever developers, with the goal of cramming as much functionality and flexibility into the nifty dual-applet design as possible!

Yes! This fork was an opportunity for me add stuff I wanted to see on my o_C without having to worry about running up against any legacy issues for other Hemipshere users. When I shared some of the progress I was making in my fork, people seemed excited and interested in trying it out, so I have made it an official fork rather than just my own personal project. I try to give back any improvements I make to the [main Hemispheres repo](https://github.com/Chysn/O_C-HemisphereSuite) when possible, but 1) it is not clear if that repo is still active and 2) there is barely any room remaining on the Teensy for improvements. By deciding that this version of the suite will only contain Hemisphere applets I was able to make room for new applets and other improvements. I do accept feature request issues and pull request, but the things that will make it in to this fork are still largely up to my discression.
I've also included **all of the stock O&C firmware apps** plus a few others, but they don't all fit in one .hex. As a courtesy, I provide **pre-built .hex files** with various combinations of Apps in my [**Releases**](https://github.com/djphazer/O_C-BenisphereSuite/releases). You can also tell a robot to make a [**Custom Build**](https://github.com/djphazer/O_C-Phazerville/discussions/38) for you...

### Ok, so what's changed?
...or clone the repo, customize the `platformio.ini` file, and build it yourself! ;-)
I think the beauty of this module is the fact that it's relatively easy to modify and build the source code to reprogram it. You are free to customize the firmware, similar to how you've no doubt already selected a custom set of physical modules.

As of v1.0, I have added two new applets inspired by very popular modules ([Mutable Instruments Grids](https://mutable-instruments.net/modules/grids/) and [Noise Engineering Mimetic Digitalis](https://noiseengineering.us/products/mimetic-digitalis)) as well as some minor improvements to existing apps. I've also removed all of the full-width o_C style apps to make space for these changes. To see all of the changes in detail, visit the [wiki](https://github.com/benirose/O_C-BenisphereSuite/wiki).
### New Crimes

### How do I try it?
* 4 Presets in the new [**Hemisphere Config**](https://github.com/djphazer/O_C-BenisphereSuite/wiki/Hemisphere-Config)
* Modal-editing style cursor navigation (and other usability tweaks)
* Expanded internal [**Clock Setup**](https://github.com/djphazer/O_C-BenisphereSuite/wiki/Clock-Setup)
* New Apps: [**Scenes**](https://github.com/djphazer/O_C-BenisphereSuite/wiki/Scenes) and [**Calibr8or**](https://github.com/djphazer/O_C-BenisphereSuite/wiki/Calibr8or)
* **[DualTM](https://github.com/djphazer/O_C-BenisphereSuite/wiki/DualTM)** - two 32-bit shift registers. Assignable I/O.
* **[EbbAndLfo](https://github.com/djphazer/O_C-BenisphereSuite/wiki/Ebb-&-LFO)** (via [qiemem](https://github.com/qiemem/O_C-HemisphereSuite/tree/trig-and-tides)) - mini implementation of MI Tides, with v/oct tracking
* **[EuclidX](https://github.com/djphazer/O_C-BenisphereSuite/wiki/EuclidX)** - AnnularFusion got a makeover, now includes padding, configurable CV input modulation - (credit to [qiemem](https://github.com/qiemem/O_C-HemisphereSuite/tree/expanded-clock-div) and [adegani](https://github.com/adegani/O_C-HemisphereSuite))
* LoFi Tape has been transformed into **LoFi Echo** - a crazy bitcrushing digital delay line - (credit to [armandvedel](https://github.com/armandvedel/O_C-HemisphereSuite_log) for the initial idea)
* Sequence5 -> **SequenceX** (8 steps max) (from [logarhythm](https://github.com/Logarhythm1/O_C-HemisphereSuite))

Head over to the [releases](https://github.com/benirose/O_C-BenisphereSuite/releases) section and download the latest release. Follow the ["Method A" instructions](https://ornament-and-cri.me/firmware/#method_a) from the Ornament and Crime website, except use the hex file you downloaded from the releases section.
Plus lots of other small tweaks + experimental applets.

Alternatively, you can follow instructions in [this video](https://www.youtube.com/watch?v=dg_acylaMZU).
### How To Hack It

Note: you can reload any other previous firmware you had installed (stock o_C or Hemisphere Suite) just as easily.
This firmware fork is built using Platform IO, a Python-based build toolchain, available as either a [standalone CLI](https://docs.platformio.org/en/latest/core/installation/methods/installer-script.html) or a [full-featured IDE](https://platformio.org/install/ide), as well as a plugin for VSCode and other existing IDEs.

### How do I build it?
The project lives within the `software/o_c_REV` directory. From there, you can Build the desired configuration and Upload via USB to your module:
```
pio run -e oc_stock2_flipped -t upload
```
Have a look inside `platformio.ini` for alternative build environment configurations - VOR, Buchla, flipped screen, etc. To build all the defaults consecutively, simply use `pio run`

You can download this repo and build the code following the ["Method B" instruction](https://ornament-and-cri.me/firmware/#method_b) from the Ornament and Crime website. Very specific legacy versions of the Arduino IDE and Teensyduino add-on are required to build, and are not installable on 64-bit only systems, like Mac OS. You must use an older version (Mojave or before) or a VM to install these versions.
_**Pro-tip**_: If you decide to fork the project, and enable GitHub Actions on your own repo, GitHub will build the files for you... ;)

### What's with the name?
## Credits

Beta tester [@jroo](https://github.com/jroo) jokingly called it that, and it kind of stuck! It's supposed to be a bit tongue in cheek, so I hope it's not taken too seriously! Also it has a nicer ringer than "Hemisphere Suite BR Fork".
Many minds before me have made this project possible. Attribution is present in the git commit log and within individual files.
Shoutouts:
* **[Logarhythm1](https://github.com/Logarhythm1)** for the incredible **TB-3PO** sequencer, as well as **Stairs**.
* **[herrkami](https://github.com/herrkami)** and **Ben Rosenbach** for their work on **BugCrack**.
* **[benirose](https://github.com/benirose)** also gets massive props for **DrumMap**, **Shredder** and the **ProbDiv / ProbMelo** applets.
* **[qiemem](https://github.com/qiemem)** (Bryan Head) for the **Ebb&LFO** applet and its _tideslite_ backend, among other things.

### Credits
And, of course, thank you to **[Chysn](https://github.com/Chysn)** for the clever applet framework from which we've all drawn inspiration.

This is a fork of [Hemisphere Suite](https://github.com/Chysn/O_C-HemisphereSuite) by Jason Justian (aka chysn). I could not have built Hemisphere Suite, so a million thanks to Jason for doing the true hard work and keeping it open source.
This is a fork of [Benisphere Suite](https://github.com/benirose/O_C-BenisphereSuite) which is a fork of [Hemisphere Suite](https://github.com/Chysn/O_C-HemisphereSuite) by Jason Justian (aka chysn).

ornament**s** & crime**s** is a collaborative project by Patrick Dowling (aka pld), mxmxmx and Tim Churches (aka bennelong.bicyclist) (though mostly by pld and bennelong.bicyclist). it **(considerably) extends** the original firmware for the o_C / ASR eurorack module, designed by mxmxmx.

Expand Down
34 changes: 34 additions & 0 deletions TODO.md
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 added hardware/OCP/TH_O_C_MAIN0_1_0.pdf
Binary file not shown.
Binary file added hardware/OCP/TH_O_C_UI-1_0.pdf
Binary file not shown.
Loading

0 comments on commit b1d4a43

Please sign in to comment.