Skip to content

Commit

Permalink
Beta 2.0 (#12)
Browse files Browse the repository at this point in the history
New features and improvements:
	- Added support for the Ensoniq ESQ-M and SQ-80M synthesizer modules
	- Added support for Ensoniq ESQ-1s with an OS version lower than 3.00
	- Added support for SQ/ESQs with a MIDI channel other than 1
	- Reduced delay while modifying program after clicking on a control

Bug fixes:
	- Fixed an occasional crash when opening the software
  • Loading branch information
VincyZed authored Jan 11, 2025
1 parent f123033 commit 0ecf7fa
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 155 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ name: Clang-Format Check Workflow

on:
pull_request:
paths:
- '**/*.cpp'
- '**/*.hpp'
- '**/*.c'
- '**/*.h'

jobs:
clang-format:
Expand Down
28 changes: 6 additions & 22 deletions .github/workflows/cmake-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,42 +62,26 @@ jobs:
- name: Build
run: cmake --build build --config ${{env.BUILD_TYPE}}

- name: Zip binary (Windows)
if: matrix.os == 'windows-latest'
run: |
powershell Compress-Archive -Path build/SideQick_artefacts/Release/SideQick.exe -DestinationPath build/SideQick_artefacts/Release/SideQick-win64.zip
- name: Zip binary (macOS)
if: matrix.os == 'macos-latest'
run: |
cd build/SideQick_artefacts/Release/
zip -r SideQick-macOS.zip SideQick.app
- name: Zip binary (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
zip -j build/SideQick_artefacts/Release/SideQick-linux.zip build/SideQick_artefacts/Release/SideQick
- name: Upload binary (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: SideQick-win64.zip
path: build/SideQick_artefacts/Release/SideQick-win64.zip
name: SideQick-win64
path: build/SideQick_artefacts/Release/SideQick.exe

- name: Upload binary (macOS)
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: SideQick-macOS.zip
path: build/SideQick_artefacts/Release/SideQick-macOS.zip
name: SideQick-macOS
path: build/SideQick_artefacts/Release/SideQick.app

- name: Upload binary (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: SideQick-linux.zip
path: build/SideQick_artefacts/Release/SideQick-linux.zip
name: SideQick-linux
path: build/SideQick_artefacts/Release/SideQick

create-pre-release:
name: Create Pre-Release
Expand Down
73 changes: 53 additions & 20 deletions Source/DeviceResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,32 @@ using namespace juce;

enum Status { CONNECTED, DISCONNECTED, SYSEX_DISABLED, MODIFYING_PROGRAM, REFRESHING };
const StringArray STATUS_MESSAGES = {"Connected", "Di5connected", "5y5ex Di5abled", "Modifying Program . . .", "Refre5hing . . ."};
enum SynthModel { SQ80, ESQ1, UNKNOWN, UNCHANGED };
const StringArray SYNTH_MODELS = {"5Q-80", "E5Q-1", "Unknown", "Unchanged"};
const unsigned int NB_OF_WAVES[2] = {75, 32};
enum SynthModel { SQ80, ESQ1, ESQM, SQ80M, UNKNOWN, UNCHANGED };
const StringArray SYNTH_MODELS = {"5Q-80", "E5Q-1", "E5Q-M", "5Q80M", "Unknown", "Unchanged"};
const unsigned int NB_OF_WAVES[4] = {75, 32, 32, 75};

const unsigned int ESQ1_HIDDEN_WAVES_MIN_VERSION = 350;
const int SQ_ESQ_FAMILY_ID = 0x02;
// Model codes. The SQ-80M has the same code as the ESQ-M
const int ESQ1_ID = 0x01;
const int ESQM_ID = 0x02;
const int SQ80_ID = 0x03;

// We subtract 2 to exclude the SysEx header and footer
const int DEVICE_ID_SIZE = 15 - 2;

// Indexes for corresponding nibbles in the SysEx message, we subtracted 1 for all of these to remove the SysEx header
const int RESPONSE_CHANNEL_IDX = 1;
const int FAMILY_IDX = 5;
const int MODEL_IDX = 7;
const int OS_VERSION_IDX[2] = {11, 12};
enum VersionNumber { MINOR, MAJOR };

class DeviceResponse {
public:
String status = STATUS_MESSAGES[DISCONNECTED];
unsigned int model = UNKNOWN;
unsigned int osVersion = 0;
String osVersion[2];
bool supportsHiddenWaves = true;

MidiMessage currentProgram;

Expand All @@ -49,24 +64,42 @@ class DeviceResponse {
this->currentProgram = currentProgram;

const uint8_t* deviceIdData = deviceIdMessage.getSysExData();
// Check if a supported model responded to the DeviceInquiry request
if (deviceIdMessage.getSysExDataSize() == DEVICE_ID_SIZE) {

osVersion[MAJOR] = static_cast<String>(deviceIdData[OS_VERSION_IDX[MAJOR]]);
osVersion[MINOR] = static_cast<String>(deviceIdData[OS_VERSION_IDX[MINOR]]);
unsigned int combinedOsVersion = deviceIdData[OS_VERSION_IDX[MAJOR]] * 100 + deviceIdData[OS_VERSION_IDX[MINOR]];

// TODO: Replace the literal values with constants
if (deviceIdData[ENSONIQ_FAMILY] == 0x02 && deviceIdData[ENSONIQ_MODEL] == 0x03)
this->model = SQ80;
else if (deviceIdData[ENSONIQ_FAMILY] == 0x02 && deviceIdData[ENSONIQ_MODEL] == 0x01)
this->model = ESQ1;
else
this->model = UNKNOWN;
if (deviceIdData[FAMILY_IDX] == SQ_ESQ_FAMILY_ID) {
if (deviceIdData[MODEL_IDX] == ESQ1_ID) {
model = ESQ1;
// An ESQ-1 with OS 3.53 will unfortunately report 3.50, so the tooltip must indicate that both are possible
osVersion[MINOR] = osVersion[MAJOR] == "3" && osVersion[MINOR] == "50" ? "50/53" : osVersion[MINOR];
} else if (deviceIdData[MODEL_IDX] == ESQM_ID)
// After looking at the SQ-80M OS's assembly, an SQ-80M with os v1.30 will report 1.30. We can thus distinguish the ESQ-M from the SQ-80M!
combinedOsVersion < 130 ? model = ESQM : model = SQ80M;
else if (deviceIdData[MODEL_IDX] == SQ80_ID) {
model = SQ80;
// An SQ-80 with OS 1.83 will unfortunately report 1.80, so the tooltip must indicate that both are possible
osVersion[MINOR] = osVersion[MAJOR] == "1" && osVersion[MINOR] == "80" ? "80/83" : osVersion[MINOR];
} else
model = UNKNOWN;
} else
model = UNKNOWN;

// This returns an integer corresponding to the OS version, e.g. 353 for version 3.53
this->osVersion = deviceIdData[OS_VERSION[MAJOR]] * 100 + deviceIdData[OS_VERSION[MINOR]];
// TODO: Check this logic in case the ESQ-M or SQ-80M supports hidden waves
if (model == ESQ1 && combinedOsVersion < ESQ1_HIDDEN_WAVES_MIN_VERSION || model == ESQM || model == SQ80M)
supportsHiddenWaves = false;

} else if (deviceIdMessage.getSysExDataSize() == 0) {
// ESQ-1 (since we already received a valid program dump but not an inquiry response) with OS version lower than 3.00 (we can't know the exact version)
model = ESQ1;
osVersion[MAJOR] = "< 3";
osVersion[MINOR] = "00";
}
}

private:
// Indexes in the SysEx message, we subtracted 1 for all of these to remove the SysEx header
const int ENSONIQ_FAMILY = 5;
const int ENSONIQ_MODEL = 7;
const int OS_VERSION[2] = {11, 12};

enum VersionNumber { MINOR, MAJOR };
const unsigned int ESQ1_HIDDEN_WAVES_MIN_VERSION = 350;
};
8 changes: 8 additions & 0 deletions Source/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ void Display::toggleProgramSection(DisplayState state) {
displayLookAndFeel.setColour(Label::textColourId, DISPLAY_COLOURS[state]);
}

void Display::toggleComponent(Component& component, DisplayState state) {
component.setEnabled(state == ON);
component.setColour(ComboBox::outlineColourId, DISPLAY_COLOURS[state]);
component.setColour(ComboBox::textColourId, DISPLAY_COLOURS[state]);
component.setColour(ComboBox::arrowColourId, DISPLAY_COLOURS[state]);
component.repaint();
}

DisplayLookAndFeel::DisplayLookAndFeel() {
displayColour = DISPLAY_COLOURS[ON];
setDefaultSansSerifTypeface(getCustomTypeface());
Expand Down
1 change: 1 addition & 0 deletions Source/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Display : public GroupComponent {
void resized() override;

void toggleProgramSection(DisplayState state);
void toggleComponent(Component& component, DisplayState state);

private:
DisplayLookAndFeel displayLookAndFeel;
Expand Down
Loading

0 comments on commit 0ecf7fa

Please sign in to comment.