Skip to content

Commit

Permalink
Beta 2.1 (#22)
Browse files Browse the repository at this point in the history
* Add hidden waves support for the SQ-80M

* Removed unnecessary model check

* Greatly speed up scanning of ESQ-1s with OS < 3.00

* Compressed plastic texture

* Added CMakeCache to gitignore, included BinaryData in MainComponent

* Set status to "Refreshing..." when auto-scanning on launch
  • Loading branch information
VincyZed authored Jan 19, 2025
1 parent 0b29e2b commit 9a057b6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ cmake-stamp
# CMake
build/
cmake-build*/
CMakeCache.txt
CMakeFiles/


# Juce (a submodule should be added)
libs/juce-*
Expand Down
Binary file modified Assets/plastic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Source/DeviceResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DeviceResponse {
model = UNKNOWN;

// 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)
if (model == ESQ1 && combinedOsVersion < ESQ1_HIDDEN_WAVES_MIN_VERSION || model == ESQM)
supportsHiddenWaves = false;

} else if (deviceIdMessage.getSysExDataSize() == 0) {
Expand Down
8 changes: 4 additions & 4 deletions Source/MainComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

#include "MainComponent.h"
#include "BinaryData.h"
#include "DeviceResponse.h"
#include "MidiSysexProcessor.h"
#include "PannelButton.h"
Expand Down Expand Up @@ -74,7 +75,7 @@ MainComponent::MainComponent() : refreshButton(refreshButtonColours[getCurrentSy
createLabel(modelLabel, statusSection, "", 580, 5, 300, 30);
sysexDisabledUnderline.setVisible(false);

refreshButton.setTooltip("Scan for a connected Ensoniq SQ-80 or ESQ-1");
refreshButton.setTooltip("Scan for a connected Ensoniq SQ-80 or ESQ-1 and for MIDI device changes");
refreshButton.onClick = [this] {
attemptConnection();
refreshMidiDevices();
Expand Down Expand Up @@ -284,7 +285,7 @@ void MainComponent::showContextMenu() {
menu.showMenuAsync(PopupMenu::Options(), [this](int result) {
if (result == 2) {
AlertWindow::showMessageBoxAsync(AlertWindow::NoIcon, "SideQick",
"Ensoniq SQ-80/ESQ-1 Expansion Software\nVersion Beta 2.0\n\nCopyright Vincent Zauhar, 2025\nReleased under the "
"Ensoniq SQ-80/ESQ-1 Expansion Software\nVersion Beta 2.1\n\nCopyright Vincent Zauhar, 2025\nReleased under the "
"GNU GPL v3 license\n\nhttps://github.com/VincyZed/SideQick");
} else if (result == 3)
JUCEApplication::getInstance()->systemRequestedQuit();
Expand Down Expand Up @@ -346,8 +347,7 @@ void MainComponent::updateStatus(DeviceResponse response) {
if (currentModel == ESQ1)
waveMenus[osc].setTooltip("Hidden waveforms are only accessible with OS version 3.5 and above on the ESQ-1");
else
waveMenus[osc].setTooltip("Hidden waveforms are not supported on the " +
String(SYNTH_MODELS[currentModel] == SYNTH_MODELS[ESQM] ? "ESQ-M" : "SQ80-M"));
waveMenus[osc].setTooltip("Hidden waveforms are not supported on the ESQ-M");
}
}

Expand Down
19 changes: 10 additions & 9 deletions Source/MidiSysexProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ DeviceResponse MidiSysexProcessor::requestDeviceInquiry() {
return getConnectionStatus(sqEsqMessages.getFirst());

} else
return DeviceResponse(STATUS_MESSAGES[DISCONNECTED]);
// On launch, the program will try to connect to the synth automatically, so this displays the "refreshing" message
return DeviceResponse(STATUS_MESSAGES[REFRESHING]);
}

MidiMessage MidiSysexProcessor::requestProgramDump() {
MidiMessage MidiSysexProcessor::requestProgramDump(int delay) {
// Send the program dump request
if (selectedMidiOut != nullptr) {
selectedMidiOut->sendMessageNow(MidiMessage::createSysExMessage(requestPgmDumpMsg, sizeof(requestPgmDumpMsg)));
}

Thread::sleep(SYSEX_DELAY);
Thread::sleep(delay);

// Read the incoming SysEx message
auto program = receivedSysExMessages.getFirst();
Expand All @@ -94,15 +95,15 @@ void MidiSysexProcessor::sendProgramDump(HeapBlock<uint8_t>& progData) {

DeviceResponse MidiSysexProcessor::getConnectionStatus(MidiMessage deviceIdMessage) {

MidiMessage currentProg = requestProgramDump();
MidiMessage currentProg = requestProgramDump(SYSEX_DELAY);
bool receivedValidDeviceId = deviceIdMessage.getSysExDataSize() == DEVICE_ID_SIZE;
bool receivedValidProgram = currentProg.getSysExDataSize() == SQ_ESQ_PROG_SIZE;

// This is to set the right MIDI channel for the ESQ-1 with OS < 3.00
if (!receivedValidDeviceId && !receivedValidProgram) {
for (int channel = 0; channel < 16 && !receivedValidProgram; channel++) {
setChannel(channel);
currentProg = requestProgramDump();
currentProg = requestProgramDump(SYSEX_DELAY / 4);
receivedValidProgram = currentProg.getSysExDataSize() == SQ_ESQ_PROG_SIZE;
}
}
Expand All @@ -119,7 +120,7 @@ DeviceResponse MidiSysexProcessor::getConnectionStatus(MidiMessage deviceIdMessa
}

DeviceResponse MidiSysexProcessor::changeOscWaveform(int oscNumber, int waveformIndex) {
auto currentProg = requestProgramDump();
auto currentProg = requestProgramDump(SYSEX_DELAY);
const uint8_t* progData = currentProg.getSysExData();

// Check if we received a valid program dump from the synth
Expand All @@ -144,7 +145,7 @@ DeviceResponse MidiSysexProcessor::changeOscWaveform(int oscNumber, int waveform

DeviceResponse MidiSysexProcessor::changeOscPitch(int oscNumber, int octave, int semitone, bool inLowFreqRange) {

auto currentProg = requestProgramDump();
auto currentProg = requestProgramDump(SYSEX_DELAY);
const uint8_t* progData = currentProg.getSysExData();

// Check if we received a valid program dump from the synth
Expand Down Expand Up @@ -202,7 +203,7 @@ DeviceResponse MidiSysexProcessor::toggleLowFrequencyMode(int oscNumber, bool lo
// It sets the oscillator in a different frequency range, a bit like what toggleSelfOscillation() does for resonance.
// Here we set it to OCT-2 by default because OCT-3 is still a very high frequency but from a different waveform, because... reasons.

auto currentProg = requestProgramDump();
auto currentProg = requestProgramDump(SYSEX_DELAY);
const uint8_t* progData = currentProg.getSysExData();

// Check if we received a valid program dump from the synth
Expand Down Expand Up @@ -242,7 +243,7 @@ DeviceResponse MidiSysexProcessor::toggleLowFrequencyMode(int oscNumber, bool lo
}

DeviceResponse MidiSysexProcessor::toggleSelfOscillation(ToggleButton& selfOscButton) {
auto currentProg = requestProgramDump();
auto currentProg = requestProgramDump(SYSEX_DELAY);
const uint8_t* progData = currentProg.getSysExData();

// Check if we received a valid program dump from the synth
Expand Down
2 changes: 1 addition & 1 deletion Source/MidiSysexProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MidiSysexProcessor {
void processIncomingMidiData(MidiInput* source, const MidiMessage& message);

DeviceResponse requestDeviceInquiry();
MidiMessage requestProgramDump();
MidiMessage requestProgramDump(int delay);
void sendProgramDump(HeapBlock<uint8_t>& progData);
DeviceResponse toggleSelfOscillation(ToggleButton& selfOscButton);
DeviceResponse changeOscWaveform(int oscNumber, int waveformIndex);
Expand Down

0 comments on commit 9a057b6

Please sign in to comment.