Skip to content

Commit

Permalink
Merge pull request #6 from xivilay/lumi-support-experimental
Browse files Browse the repository at this point in the history
feat: multiple changes related to minor improvements, bug fixes, and lumi keys support
  • Loading branch information
xivilay committed Feb 15, 2023
2 parents 77a86a7 + 79559d6 commit fad1be2
Show file tree
Hide file tree
Showing 17 changed files with 440 additions and 34 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

- name: Set Up Node.js
uses: actions/setup-node@v2
with:
node-version: 16

- name: Set Up Yarn
run: npm install -g yarn
Expand All @@ -44,10 +46,24 @@ jobs:
run: |
sudo apt-get update && sudo apt install libasound2-dev libcurl4-openssl-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Patch Blocks
working-directory: ./external/roli_blocks_basics
run: git apply --reject --whitespace=fix -v ../../scripts/patches/roli.patch

- name: Patch React-Juce
working-directory: ./external/react-juce
run: git apply --reject --whitespace=fix -v ../../scripts/patches/react.patch

- name: Configure CMake for Standalone
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PLUGIN_IS_STANDALONE=1

- name: Build Standalone
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Configure CMake for Plugins
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PLUGIN_IS_STANDALONE=0

- name: Build
- name: Build Plugins
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Zip
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "external/juce"]
path = external/juce
url = https://github.com/juce-framework/JUCE
[submodule "external/roli_blocks_basics"]
path = external/roli_blocks_basics
url = https://github.com/WeAreROLI/roli_blocks_basics
21 changes: 17 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,29 @@
{
"type": "lldb",
"request": "launch",
"name": "CMake Standalone",
"program": "${command:cmake.launchTargetPath}",
"name": "LLDB - Launch Debug",
"program": "${workspaceRoot}/build/ScaleRemapperDev_artefacts/Debug/Standalone/ScaleRemapperDev.exe",
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "attach",
"name": "Attach to AudioHost",
"pid": "${command:pickMyProcess}"
"name": "LLDB - Attach to AudioHost",
"program": "AudioPluginHost.exe"
},
{
"name": "VSDB - Launch Debug",
"type": "cppvsdbg",
"cwd": "${workspaceRoot}",
"request": "launch",
"program": "${workspaceRoot}/build/ScaleRemapperDev_artefacts/Debug/Standalone/ScaleRemapperDev.exe"
},
{
"name": "VSDB - Attach to AudioHost",
"type": "cppvsdbg",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
69 changes: 69 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@
"detail": "webpack --mode=production",
"hide": true
},
{
"type": "npm",
"script": "build-dev",
"path": "ui",
"problemMatcher": [],
"label": "yarn build ui debug",
"detail": "webpack --mode=development",
"hide": true
},
{
"type": "process",
"command": "xcopy",
"args": ["/y", "${workspaceRoot}\\ui\\build\\js", "${workspaceRoot}\\build\\ScaleRemapperDev_artefacts\\Debug\\Standalone\\js\\"],
"problemMatcher": [],
"label": "copy js assets",
"dependsOn": ["yarn build ui debug"],
"hide": true
},
{
"type": "process",
"command": "cmake",
Expand All @@ -30,6 +48,26 @@
"problemMatcher": [],
"hide": true
},
{
"type": "process",
"command": "cmake",
"args": [
"-A",
"x64",
"../",
"-D",
"CMAKE_BUILD_TYPE=Debug"
],
"label": "cmake prepare build debug",
"options": {
"cwd": "${workspaceRoot}/build"
},
"dependsOn": [
"copy js assets"
],
"problemMatcher": [],
"hide": true
},
{
"type": "process",
"command": "cmake",
Expand All @@ -49,6 +87,25 @@
],
"hide": true
},
{
"type": "process",
"command": "cmake",
"args": [
"--build",
".",
"--config",
"Debug"
],
"label": "cmake build debug",
"options": {
"cwd": "${workspaceRoot}/build"
},
"problemMatcher": [],
"dependsOn": [
"cmake prepare build debug"
],
"hide": true
},
{
"type": "process",
"command": "./ScaleRemapper_artefacts/Release/Standalone/ScaleRemapper.exe",
Expand All @@ -60,6 +117,18 @@
"dependsOn": [
"cmake build"
]
},
{
"type": "process",
"command": "./ScaleRemapperDev_artefacts/Debug/Standalone/ScaleRemapperDev.exe",
"label": "build & run executable (debug)",
"options": {
"cwd": "${workspaceRoot}/build/"
},
"problemMatcher": [],
"dependsOn": [
"cmake build debug"
]
}
]
}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# Change Log
All notable changes to this project will be documented in this file.

## [0.7.0] - 2023-02-15

### Fixed

* LV2 plugins didn't work due to incorrect URL
* [ui] incorrect sizing of list elements

### Added

* [ui] colors mode for remapped keyboard
* buttons to cycle through the modes with the same keys selected
* icon for standalone app
* [LUMI keys](https://roli.com/products/blocks/lumi-keys-studio-edition) hardware support (4 modes, if plugin is disabled it will only highlight the key, otherwise it will highlight remapped keys, power button is changing color mode)
* custom scales override is possible if `scales.txt` is placed near the plugin binary file. Text file should list scales in format `intervals scaleName`, ex:

```
2 1 2 2 2 2 1 Melodic Minor
2 1 2 2 1 3 1 Harmonic Minor
```

### Changed

* updated JUCE to 7.0.5
* [ui] updated minor deps

## [0.6.1] - 2023-02-08

### Changed
Expand Down
42 changes: 31 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,66 @@ if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(PROJECT_NAME "${PROJECT_NAME}Dev")
endif()

set(VERSION "0.6.1")
set(JUCE_DIR "external/juce")
set(SRC_DIR "./src")
set(FORMATS "Standalone" "LV2" "VST3")
set(VERSION "0.7.0")

set(FORMATS "")

set(SRC_DIR "./src")
set(JUCE_DIR "external/juce")
set(REACT_JUCE "react_juce")
# see https://github.com/nick-thompson/react-juce/tree/master/react_juce
set(REACT_JUCE_DIR "external/react-juce/${REACT_JUCE}") # path to REACT JUCE
set(ROLI_BLOCKS "roli_blocks_basics")
set(BLOCKS_DIR "external/${ROLI_BLOCKS}")
set(REACT_JUCE_DIR "external/react-juce/${REACT_JUCE}")
set(JS_BUNDLE_PATH "./ui/build/js/bundle.js")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(CMAKE_PLUGIN_IS_STANDALONE)
message(STATUS "Building as STANDALONE")
list(APPEND FORMATS "Standalone")
else()
message(STATUS "Building as Plugin")
list(APPEND FORMATS "LV2")
list(APPEND FORMATS "VST3")
endif()

project(${PROJECT_NAME} VERSION ${VERSION})

add_subdirectory(${JUCE_DIR} "juce")

juce_add_module(${BLOCKS_DIR})
juce_add_module(${REACT_JUCE_DIR})

if(WIN32)
if(WIN32 AND CMAKE_PLUGIN_IS_STANDALONE)
message(STATUS "Building for Windows...")
set(ASIO_DIR "sdk/asio")
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${ASIO_DIR})
set(BUILD_ASIO 1)
endif()
endif(WIN32)
endif()

set(VST2_DIR "sdk/vst2")
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${VST2_DIR})
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/${VST2_DIR} AND NOT CMAKE_PLUGIN_IS_STANDALONE)
set(BUILD_VST2 1)
juce_set_vst2_sdk_path(${VST2_DIR})
list(APPEND FORMATS "VST")
endif()

target_compile_definitions(${REACT_JUCE} INTERFACE REACTJUCE_USE_DUKTAPE=1)

message(STATUS "Formats added: ${FORMATS}")

juce_add_plugin(${PROJECT_NAME}
COMPANY_NAME XivilaY
PRODUCT_NAME "${PROJECT_NAME}"
NEEDS_MIDI_INPUT TRUE
NEEDS_MIDI_OUTPUT TRUE
PLUGIN_MANUFACTURER_CODE XivY
PLUGIN_CODE Xiv8
LV2URI "https://github.com/xivilay/scale-remapper"
VST3_CATEGORIES "Instrument Tools"
ICON_SMALL "${SRC_DIR}/icons/small.png"
FORMATS ${FORMATS}
)

Expand All @@ -67,10 +84,12 @@ target_sources(${PROJECT_NAME} PRIVATE
target_compile_definitions(${PROJECT_NAME} PRIVATE
JUCE_USE_CURL=0
JUCE_WEB_BROWSER=0
P_WIDTH=550
P_HEIGHT=750
)

if(WIN32 AND NOT CMAKE_PLUGIN_IS_STANDALONE)
target_compile_definitions(${PROJECT_NAME} PRIVATE JUCE_USE_WINRT_MIDI=1)
endif()

if(BUILD_VST2)
message(STATUS "Adding VST2...")
target_compile_definitions(${PROJECT_NAME} PUBLIC JUCE_VST3_CAN_REPLACE_VST2=1)
Expand Down Expand Up @@ -102,6 +121,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
juce::juce_gui_basics
juce::juce_gui_extra

${ROLI_BLOCKS}
${REACT_JUCE}
BinaryData
)
2 changes: 1 addition & 1 deletion external/juce
Submodule juce updated 773 files
1 change: 1 addition & 0 deletions external/roli_blocks_basics
Submodule roli_blocks_basics added at 9a6df1
Binary file modified screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions scripts/patches/react.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40dd357..4cfa1ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,6 @@ option(JUCE_BUILD_EXTRAS "Build JUCE Extras" OFF)
set(REACTJUCE_JS_LIBRARY DUKTAPE CACHE STRING "The JS Engine to use: either HERMES or DUKTAPE")


-add_subdirectory(ext/juce)

# Adding any custom modules you might have:
juce_add_module(react_juce)
22 changes: 22 additions & 0 deletions scripts/patches/roli.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/topology/internal/roli_MIDIDeviceDetector.cpp b/topology/internal/roli_MIDIDeviceDetector.cpp
index 4b77ff0..191c7e5 100644
--- a/topology/internal/roli_MIDIDeviceDetector.cpp
+++ b/topology/internal/roli_MIDIDeviceDetector.cpp
@@ -112,7 +112,7 @@ struct MIDIDeviceDetector : public PhysicalTopologySource::DeviceDetector
{
MidiInputOutputPair pair;
pair.input = input;
-
+ auto inputId = input.identifier; // winRT workaround
juce::String cleanedInputName = cleanBlocksDeviceName (input.name);

int inputOccurences = 0;
@@ -124,7 +124,7 @@ struct MIDIDeviceDetector : public PhysicalTopologySource::DeviceDetector

for (const auto& output : midiOutputs)
{
- if (cleanBlocksDeviceName (output.name) == cleanedInputName)
+ if (cleanBlocksDeviceName (output.name) == cleanedInputName || output.identifier == inputId)
{
if (outputOccurences == inputOccurences)
{
Loading

0 comments on commit fad1be2

Please sign in to comment.