Skip to content

Commit

Permalink
Update build action, handle new data stream encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Dempsey committed Jun 9, 2024
1 parent c34a296 commit b2065b8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Get Rack-SDK
run: |
pushd $HOME
wget -O Rack-SDK.zip https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}-mac-${{ matrix.platform }}.zip
wget -O Rack-SDK.zip https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}-mac-x64%2barm64.zip
unzip Rack-SDK.zip
- name: Build plugin
run: |
Expand Down
16 changes: 16 additions & 0 deletions src/HC-1/HC-1-midi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,22 @@ void Hc1Module::onChannel16Message(const midi::Message& msg)
}
break;

// FW 10.34
case MidiStatus_PolyKeyPressure:
if (in_preset && !broken) {
switch (data_stream) {
case EM_StreamType::Name:
preset0.build_name(msg.bytes[1]);
preset0.build_name(msg.bytes[2]);
break;
case EM_StreamType::ConText:
preset0.build_text(msg.bytes[1]);
preset0.build_text(msg.bytes[2]);
break;
}
}
break;

case MidiStatus_ChannelPressure:
if (in_preset && !broken) {
switch (data_stream) {
Expand Down
14 changes: 7 additions & 7 deletions src/em_midi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,20 +472,20 @@ inline int MessageBytes(uint8_t status_byte)
}

union uMidiMessage {
uint64_t dwData;
uint32_t data;
uint8_t bytes[4];
uMidiMessage() : dwData(0) {}
uMidiMessage(uint64_t dw) : dwData(dw) {}
uMidiMessage(uint8_t b1, uint8_t b2) : dwData(0) {
uMidiMessage() : data(0) {}
uMidiMessage(uint64_t dw) : data(dw) {}
uMidiMessage(uint8_t b1, uint8_t b2) : data(0) {
bytes[0] = b1;
bytes[1] = b2;
}
uMidiMessage(uint8_t b0, uint8_t b1, uint8_t b2) : dwData(0) {
uMidiMessage(uint8_t b0, uint8_t b1, uint8_t b2) : data(0) {
bytes[0] = b0;
bytes[1] = b1;
bytes[2] = b2;
}
uMidiMessage(const midi::Message& msg) : dwData(0) {
uMidiMessage(const midi::Message& msg) : data(0) {
size_t i = 0;
for (auto b: msg.bytes) {
bytes[i++] = b;
Expand Down Expand Up @@ -523,7 +523,7 @@ union uMidiMessage {
inline uint8_t channel() { return bytes[0] & 0x0f; }
inline uint8_t b1() { return bytes[1]; }
inline uint8_t b2() { return bytes[2]; }
inline uint64_t raw() { return dwData; }
inline uint64_t raw() { return data; }
};

inline uint8_t Status(uint64_t msg) { return uMidiMessage(msg).status(); }
Expand Down

0 comments on commit b2065b8

Please sign in to comment.