Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Midi Handshake #365

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
970312a
Configurable brightness
jackpf Mar 24, 2021
266f653
Working brightness
jackpf Mar 25, 2021
b0ee933
Refactor
jackpf Mar 25, 2021
4cee3ce
Basic screensaver
jackpf Mar 25, 2021
e0ff202
Generic settings
jackpf Mar 27, 2021
03ce930
Not working
jackpf Mar 28, 2021
9a9628a
Generic type settings
jackpf Mar 28, 2021
d33d327
Refactor
jackpf Mar 28, 2021
f409215
Refactor
jackpf Mar 28, 2021
ed2ae9a
Refactor
jackpf Mar 28, 2021
90bb14a
Refactor
jackpf Mar 28, 2021
522538f
Fixes
jackpf Mar 28, 2021
5fd3cc1
Handle encoder setting & fix setting index bounds
jackpf Mar 28, 2021
a3060f7
Refactors
jackpf Mar 28, 2021
231aabc
Merge pull request #1 from jackpf/generic
jackpf Aug 7, 2022
dcc8808
Refactored colours
jackpf Mar 28, 2021
b83e6e4
Refactor color enum
jackpf Mar 28, 2021
b512c5a
Fix tester
jackpf Mar 28, 2021
f031edc
Merge pull request #2 from jackpf/refactored-colours
jackpf Aug 7, 2022
2412e0d
Highlight active footer rather than fill
jackpf Mar 28, 2021
511bd66
Dim sequence
jackpf Mar 28, 2021
f4f661a
Merge pull request #3 from jackpf/unfilled-footer
jackpf Aug 7, 2022
00b34e6
Wake mode (#4)
jackpf Aug 7, 2022
29df9f5
Shape improvements (v2) (#8)
jackpf Aug 7, 2022
1a7a9ef
Send midi program change messages (#10)
jackpf Aug 7, 2022
7b2c643
Merge branch 'westlicht:master' into master
jackpf Aug 7, 2022
0ad8045
Dont always sync patterns if sequencer is not running (#15)
jackpf Aug 8, 2022
e61bc4d
Another fix for always sync
jackpf Aug 8, 2022
f1fdbb3
Improvement docs (#21)
jackpf Aug 18, 2022
a4a6373
Fix doc
jackpf Aug 18, 2022
015c13b
Fix UI bug with fill amount (#22)
jackpf Aug 18, 2022
d72af37
Malekko integration (#17)
jackpf Aug 18, 2022
2f61c55
Midi program change receive (#16)
jackpf Aug 19, 2022
a9e8c4a
Song mode send pattern change (#25)
jackpf Aug 19, 2022
6606e77
Handle prehandled midi events when sent after prehandle tick (#27)
jackpf Aug 19, 2022
dc5c60e
Add comment
jackpf Aug 19, 2022
54eea21
Test fix linux workflow
jackpf Sep 19, 2022
d5c9a83
Fix first step max when resetting multistep shape (#32)
jackpf Sep 19, 2022
38a0141
Fix wrapping program changes > 16 (#33)
jackpf Sep 21, 2022
219c538
Properly change pattern & edit pattern when receiving midi program ch…
jackpf Sep 22, 2022
0b39dff
Forward received program change messages to output (#35)
jackpf Sep 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
submodules: recursive
- name: Install Dependencies
run: sudo apt install -y libsdl2-dev libasound2-dev mesa-common-dev python3.7 python3.7-dev
run: sudo apt update && sudo apt install -y libsdl2-dev libasound2-dev mesa-common-dev python3.7 python3.7-dev
- name: Setup
run: make setup_sim
- name: Build
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
![Build Status](https://github.com/westlicht/performer/actions/workflows/ci.yml/badge.svg?branch=master)
Build Status: ![Build Status](https://github.com/jackpf/performer/actions/workflows/ci.yml/badge.svg?branch=master)
Upstream Build Status: ![Upstream Build Status](https://github.com/westlicht/performer/actions/workflows/ci.yml/badge.svg?branch=master)

# Improvements

This is a fork of the [original repository](https://github.com/westlicht/performer), with some improvements that I personally find essential.

To find out more about improvements changes, check the table below.

| Change | Documentation |
|-------------------- |-------------------------------------------------- |
| Noise reduction | [docs](./doc/improvements/noise-reduction.md) |
| Shape improvements | [docs](./doc/improvements/shape-improvements.md) |
| MIDI improvements | [docs](./doc/improvements/midi-improvements.md) |

--- original documentation below ---

# PER|FORMER

Expand Down
22 changes: 22 additions & 0 deletions doc/improvements/midi-improvements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Improvement: MIDI Improvements

This change improves MIDI integration of the performer.

## Program Change Messages

The performer can now send and receive program change messages.

Note:

- Program change messages must be enabled in the project settings
- Program change messages are only sent when changing all patterns to the same pattern (changing patterns individually will not trigger program change messages)
- Program change messages are currently always sent on channel 0
- Program change messages are sent slightly before the end of the sequence in sync mode (this allows the receiving hardware some time to acknowledge the program change request)

## Always Sync Patterns

Enabled in project settings. This isn't strictly a MIDI improvement, but it works well with program changes.

When enabled, pattern changes are synced by default, rather than having to press **SYNC** before selecting a pattern.

Not very exciting, but very useful for live performance when you want things to always be synced.
30 changes: 30 additions & 0 deletions doc/improvements/noise-reduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Improvement: Noise Reduction

The OLED screen that the performer uses is inherently noisy. It generates noise on the power bus, and also on its outputs,
meaning any other module that is connected to the performer will pick up this noise (particularly VCOs & filters).

It's not very noticeable, unless you amplify, compress or overdrive the output, but it's definitely there.

The issue with some further information on the original original repository is [here](https://github.com/westlicht/performer/issues/304).

The problem is not entirely solvable by software (since it's a hardware issue), but basically the amount of noise is directly
related to the pixels that are lit up on the OLED screen.

This change provides some settings to reduce the noise as much as possible (I think I achieved around 20dB reduction).

## Guide

1. Open up the **System** page (**PAGE** + **SYSTEM**)
2. Press **SETTINGS** (**F5**)

## Settings

| Setting | Description |
|-------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Brightness | Reduces the overall brightness of the display. Lower brightness will reduce noise. |
| Screensaver | Turns the screen off after the specified time, or "off" to disable. When the screen is off, the noise is completely gone. This is useful in a studio setting, when you'd like to record something completely noise-free. |
| Wake Mode | Determines when the screen should "wake up" from the screensaver. "always" will wake the screen on any key press. "required" allows the screen to stay off when performing tasks that don't really require the screen, e.g. modifying a sequence (since the LEDs describe the current sequence). This is also a pseudo "screen-less" mode for the sequencer, which can be nice :) |
| Dim Sequence | The sequence page is particularly noisy if a lot of steps are enabled from the steps currently displayed on-screen. With dim sequence on, the squares are slightly darker than normal, which reduces noise on the sequence page substantially. |

One change that is not added as a setting is changing the footer UI elements (the text relating the the **F** keys)
so that the active function is bold instead of highlighted. This reduces noise drastically.
36 changes: 36 additions & 0 deletions doc/improvements/shape-improvements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Improvement: Shape Improvements

This change improves curve sequencing.

## Curves spanning multiple steps

Adds the ability to make a curve span over multiple steps.

### Guide

1. Open a curve track
2. Select multiple steps (**SHIFT** + **Sx**)
3. Hold **SHIFT** and turn the encoder to select a shape

The shape will be spread across the selected steps.

Not holding **SHIFT** will result in the original behaviour - all selected steps are set to the same shape.

### Extra features

- While holding **SHIFT** with multiple steps selected, pressing the encoder will reverse the shape across the selected steps

## Extra shapes

Adds more shapes.

Added shapes:

- Half ramp up: same as ramp up, but half a step
- Half ramp down: same as ramp down, but half a step
- Half exponential up: same as exponential up, but half a step
- Half exponential down: same as exponential down, but half a step
- Half log up: same as log up, but half a step
- Half log down: same as log down, but half a step
- Half smooth up: same as smooth up, but half a step
- Half smooth down: same as smooth down, but half a step
2 changes: 2 additions & 0 deletions src/apps/sequencer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ set(sources
model/Track.cpp
model/Types.cpp
model/UserScale.cpp
model/UserSettings.cpp
# ui
ui/Controller.cpp
ui/ControllerManager.cpp
Expand All @@ -56,6 +57,7 @@ set(sources
ui/Page.cpp
ui/PageManager.cpp
ui/Ui.cpp
ui/Screensaver.cpp
# ui/controllers/launchpad
ui/controllers/launchpad/LaunchpadController.cpp
ui/controllers/launchpad/LaunchpadDevice.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/apps/sequencer/Sequencer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static CCMRAM_BSS Profiler profiler;

static Model model;
static CCMRAM_BSS Engine engine(model, clockTimer, adc, dac, dio, gateOutput, midi, usbMidi);
static CCMRAM_BSS Ui ui(model, engine, lcd, blm, encoder);
static CCMRAM_BSS Ui ui(model, engine, lcd, blm, encoder, model.settings());


static constexpr uint32_t TaskAliveCount = 4;
Expand Down
2 changes: 1 addition & 1 deletion src/apps/sequencer/SequencerApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct SequencerApp {
SequencerApp() :
volume(sdCard),
engine(model, clockTimer, adc, dac, dio, gateOutput, midi, usbMidi),
ui(model, engine, lcd, blm, encoder)
ui(model, engine, lcd, blm, encoder, model.settings())
{
MidiMessage::setPayloadPool(midiMessagePayloadPool, sizeof(midiMessagePayloadPool));

Expand Down
22 changes: 11 additions & 11 deletions src/apps/sequencer/asteroids/Asteroids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void Player::draw(Canvas &canvas) {
if (_killed) {
return;
}
canvas.setColor(0xf);
canvas.setColor(Color::Bright);
Mat3 transform = Mat3::transform2D(_position, _angle, 1.f);
drawShape(canvas, transform, playerShape);
}
Expand All @@ -237,7 +237,7 @@ void Asteroid::update(float dt) {
}

void Asteroid::draw(Canvas &canvas) {
canvas.setColor(0x7);
canvas.setColor(Color::Medium);
Mat3 transform = Mat3::transform2D(_position, _angle, _scale);
drawShape(canvas, transform, asteroidShapes[_shape]);
}
Expand All @@ -263,7 +263,7 @@ void Projectile::update(float dt) {
void Projectile::draw(Canvas &canvas) {
const Vec2 &a = _position;
Vec2 b = a + _direction * 3.f;
canvas.setColor(0xf);
canvas.setColor(Color::Bright);
canvas.line(a.x, a.y, b.x, b.y);
}

Expand Down Expand Up @@ -293,7 +293,7 @@ void Particle::draw(Canvas &canvas) {
const Vec2 &a = _position;
Vec2 b = a + _direction * 3.f;
uint8_t color = static_cast<uint8_t>((1.f - _time / _params->lifeTime) * 0xf);
canvas.setColor(color);
canvas.setColorValue(color);
canvas.line(a.x, a.y, b.x, b.y);
}

Expand Down Expand Up @@ -456,7 +456,7 @@ void Game::update(float dt, Inputs &inputs, Outputs &outputs) {

void Game::draw(Canvas &canvas) {
canvas.setBlendMode(BlendMode::Set);
canvas.setColor(0);
canvas.setColor(Color::None);
canvas.fill();

canvas.setBlendMode(BlendMode::Add);
Expand Down Expand Up @@ -551,25 +551,25 @@ void Game::divideAsteroid(Asteroid &asteroid) {

void Game::drawTexts(Canvas &canvas, const char *title, const char *msg) {
canvas.setFont(Font::Small);
drawShadowText(canvas, (ScreenWidth - canvas.textWidth(title)) / 2, 30, 0xf, title);
drawShadowText(canvas, (ScreenWidth - canvas.textWidth(title)) / 2, 30, Color::Bright, title);

canvas.setFont(Font::Tiny);
drawShadowText(canvas, (ScreenWidth - canvas.textWidth(msg)) / 2, 44, 0x7, msg);
drawShadowText(canvas, (ScreenWidth - canvas.textWidth(msg)) / 2, 44, Color::Medium, msg);
}

void Game::drawHUD(Canvas &canvas) {
canvas.setFont(Font::Tiny);

FixedStringBuilder<16> level("Level %d", _level);
drawShadowText(canvas, 2, 7, 0xf, level);
drawShadowText(canvas, 2, 7, Color::Bright, level);

FixedStringBuilder<16> score("Score %d", _player.score());
drawShadowText(canvas, ScreenWidth - 2 - canvas.textWidth(score), 7, 0xf, score);
drawShadowText(canvas, ScreenWidth - 2 - canvas.textWidth(score), 7, Color::Bright, score);
}

void Game::drawShadowText(Canvas &canvas, int x, int y, uint8_t color, const char *str) {
void Game::drawShadowText(Canvas &canvas, int x, int y, Color color, const char *str) {
canvas.setBlendMode(BlendMode::Sub);
canvas.setColor(0x7);
canvas.setColor(Color::Medium);

for (int dx = -1; dx <= 1; dx += 1) {
for (int dy = -1; dy <= 1; dy += 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/apps/sequencer/asteroids/Asteroids.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ class Game {
private:
void drawTexts(Canvas &canvas, const char *title, const char *msg);
void drawHUD(Canvas &canvas);
void drawShadowText(Canvas &canvas, int x, int y, uint8_t color, const char *str);
void drawShadowText(Canvas &canvas, int x, int y, Color color, const char *str);

static void initAsteroidShapes();

Expand Down
Loading