├── .github └── workflows │ └── project.yml ├── .gitignore ├── .vscode └── launch.json ├── LICENSE ├── README.md ├── cherokee-out.aif ├── rnbo-command-line ├── README.md ├── export │ ├── am-mod.cpp │ ├── description.json │ └── rnbo │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── RNBO.cpp │ │ ├── RNBO.h │ │ ├── adapters │ │ ├── juce │ │ │ ├── RNBO_JuceAudioProcessor.cpp │ │ │ ├── RNBO_JuceAudioProcessor.h │ │ │ ├── RNBO_JuceAudioProcessorEditor.cpp │ │ │ ├── RNBO_JuceAudioProcessorEditor.h │ │ │ ├── RNBO_JuceAudioProcessorUtils.cpp │ │ │ ├── RNBO_JuceAudioProcessorUtils.h │ │ │ └── staticplugin │ │ │ │ ├── AUInfo.plist.in │ │ │ │ ├── PkgInfo │ │ │ │ ├── UnityInfo.plist.in │ │ │ │ ├── VST3Info.plist.in │ │ │ │ ├── au.cpp │ │ │ │ ├── common.cpp │ │ │ │ ├── unity.cpp │ │ │ │ └── vst3.cpp │ │ ├── max │ │ │ ├── RNBO_MaxPresetAdapter.cpp │ │ │ ├── RNBO_MaxPresetAdapter.h │ │ │ ├── external │ │ │ │ └── rnbo_external_wrapper │ │ │ │ │ └── rnbo_external_wrapper.cpp │ │ │ ├── rnbo_bufferref.cpp │ │ │ └── rnbo_bufferref.h │ │ └── wasm │ │ │ └── RNBO_WebAssembly.cpp │ │ ├── cmake │ │ ├── CCache.cmake │ │ ├── MinGWSTDThreads.cmake │ │ ├── RNBOConan.cmake │ │ ├── RNBODescriptionHeader.cmake │ │ ├── RNBOJuce.cmake │ │ ├── SCCache.cmake │ │ ├── conan.cmake │ │ └── rnbo_description.h.in │ │ ├── common │ │ ├── RNBO_Array.h │ │ ├── RNBO_AudioSignal.h │ │ ├── RNBO_BaseInterface.h │ │ ├── RNBO_CMath.h │ │ ├── RNBO_Common.h │ │ ├── RNBO_CompilerMacros.h │ │ ├── RNBO_DataRef.h │ │ ├── RNBO_Debug.h │ │ ├── RNBO_EngineInterface.h │ │ ├── RNBO_EngineLink.h │ │ ├── RNBO_EventTarget.h │ │ ├── RNBO_ExternalBase.h │ │ ├── RNBO_ExternalPtr.h │ │ ├── RNBO_List.h │ │ ├── RNBO_ListHelpers.h │ │ ├── RNBO_Logger.h │ │ ├── RNBO_MIDIHelper.h │ │ ├── RNBO_Math.h │ │ ├── RNBO_MathFast.h │ │ ├── RNBO_ParameterInterface.h │ │ ├── RNBO_PatcherEventTarget.h │ │ ├── RNBO_PatcherFactory.h │ │ ├── RNBO_PatcherInterface.h │ │ ├── RNBO_PatcherInterfaceImpl.h │ │ ├── RNBO_PatcherStateInterface.h │ │ ├── RNBO_PlatformInterface.h │ │ ├── RNBO_ProbingInterface.h │ │ ├── RNBO_ProcessInterface.h │ │ ├── RNBO_Std.h │ │ ├── RNBO_String.h │ │ ├── RNBO_TimeConverter.h │ │ ├── RNBO_Types.h │ │ ├── RNBO_UniquePtr.h │ │ └── RNBO_Version.h │ │ ├── externals │ │ ├── RNBO_DllExternal.h │ │ ├── RNBO_External.h │ │ └── ext_rnbo.h │ │ ├── src │ │ ├── 3rdparty │ │ │ ├── MPark_variant │ │ │ │ └── variant.hpp │ │ │ ├── concurrentqueue │ │ │ │ ├── .gitignore │ │ │ │ ├── LICENSE.md │ │ │ │ ├── blockingconcurrentqueue.h │ │ │ │ ├── concurrentqueue.h │ │ │ │ ├── internal │ │ │ │ │ └── concurrentqueue_internal_debug.h │ │ │ │ └── lightweightsemaphore.h │ │ │ ├── json │ │ │ │ └── json.hpp │ │ │ └── readerwriterqueue │ │ │ │ ├── .gitignore │ │ │ │ ├── LICENSE.md │ │ │ │ ├── atomicops.h │ │ │ │ └── readerwriterqueue.h │ │ ├── RNBO_AudioBufferConverter.h │ │ ├── RNBO_BeatTimeEvent.h │ │ ├── RNBO_ClangInterface.h │ │ ├── RNBO_ClockEvent.h │ │ ├── RNBO_Config.h │ │ ├── RNBO_CoreObject.cpp │ │ ├── RNBO_CoreObject.h │ │ ├── RNBO_DataBuffer.cpp │ │ ├── RNBO_DataBuffer.h │ │ ├── RNBO_DataRefEvent.h │ │ ├── RNBO_DataRefList.cpp │ │ ├── RNBO_DataRefList.h │ │ ├── RNBO_DynamicPatcherFactory.cpp │ │ ├── RNBO_DynamicPatcherFactory.h │ │ ├── RNBO_DynamicSymbolRegistry.h │ │ ├── RNBO_EmptyEvent.h │ │ ├── RNBO_Engine.cpp │ │ ├── RNBO_Engine.h │ │ ├── RNBO_EngineCore.h │ │ ├── RNBO_EventList.h │ │ ├── RNBO_EventQueue.h │ │ ├── RNBO_EventSender.h │ │ ├── RNBO_EventVariant.h │ │ ├── RNBO_ExternalData.h │ │ ├── RNBO_ExternalLoader.cpp │ │ ├── RNBO_ExternalLoader.h │ │ ├── RNBO_FileChangeWatcher.cpp │ │ ├── RNBO_FileChangeWatcher.h │ │ ├── RNBO_HardwareDevice.h │ │ ├── RNBO_List.cpp │ │ ├── RNBO_Logger.cpp │ │ ├── RNBO_MaxClang.cpp │ │ ├── RNBO_MaxClang.h │ │ ├── RNBO_MessageEvent.h │ │ ├── RNBO_MidiEvent.h │ │ ├── RNBO_MidiStreamParser.h │ │ ├── RNBO_NullPatcher.h │ │ ├── RNBO_OutletEvent.h │ │ ├── RNBO_ParameterEvent.h │ │ ├── RNBO_ParameterEventInterface.h │ │ ├── RNBO_ParameterEventQueue.h │ │ ├── RNBO_ParameterInterfaceAsync.cpp │ │ ├── RNBO_ParameterInterfaceAsync.h │ │ ├── RNBO_ParameterInterfaceAsyncImpl.h │ │ ├── RNBO_ParameterInterfaceSync.cpp │ │ ├── RNBO_ParameterInterfaceSync.h │ │ ├── RNBO_PatcherEventSender.h │ │ ├── RNBO_PatcherFactory.cpp │ │ ├── RNBO_PatcherState.cpp │ │ ├── RNBO_PatcherState.h │ │ ├── RNBO_PatcherStateDummy.h │ │ ├── RNBO_PlatformInterfaceImpl.cpp │ │ ├── RNBO_PresetEvent.h │ │ ├── RNBO_PresetList.cpp │ │ ├── RNBO_PresetList.h │ │ ├── RNBO_Presets.h │ │ ├── RNBO_RemoteParameterClient.cpp │ │ ├── RNBO_ServiceNotification.h │ │ ├── RNBO_StartupEvent.h │ │ ├── RNBO_TempoEvent.h │ │ ├── RNBO_TimeSignatureEvent.h │ │ ├── RNBO_TransportEvent.h │ │ ├── RNBO_UnitTests.cpp │ │ ├── RNBO_UnitTests.h │ │ ├── RNBO_UniversalEvent.h │ │ ├── RNBO_Utils.h │ │ ├── RNBO_Vector.h │ │ └── platforms │ │ │ ├── nostdlib │ │ │ ├── RNBO_LoggerNoStdLib.cpp │ │ │ └── RNBO_PlatformInterfaceNoStdLib.cpp │ │ │ └── stdlib │ │ │ └── RNBO_PlatformInterfaceStdLib.h │ │ ├── test │ │ └── main.cpp │ │ └── version.cmake ├── patches │ └── am-tester.maxpat ├── src-finish │ ├── .gitignore │ ├── CMakeLists.txt │ ├── cherokee.aif │ ├── export │ │ ├── README.md │ │ ├── effect.cpp │ │ └── rnbo.pitchshifter.cpp │ └── main.cpp └── src │ ├── .gitignore │ ├── CMakeLists.txt │ ├── cherokee.aif │ ├── export │ └── README.md │ └── main.cpp ├── rnbo-custom-vst ├── README.md ├── export │ ├── README.md │ ├── dependencies.json │ ├── description.json │ ├── presets.json │ ├── rnbo │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── RNBO.cpp │ │ ├── RNBO.h │ │ ├── adapters │ │ │ ├── juce │ │ │ │ ├── RNBO_JuceAudioProcessor.cpp │ │ │ │ ├── RNBO_JuceAudioProcessor.h │ │ │ │ ├── RNBO_JuceAudioProcessorEditor.cpp │ │ │ │ ├── RNBO_JuceAudioProcessorEditor.h │ │ │ │ ├── RNBO_JuceAudioProcessorUtils.cpp │ │ │ │ ├── RNBO_JuceAudioProcessorUtils.h │ │ │ │ └── staticplugin │ │ │ │ │ ├── AUInfo.plist.in │ │ │ │ │ ├── PkgInfo │ │ │ │ │ ├── UnityInfo.plist.in │ │ │ │ │ ├── VST3Info.plist.in │ │ │ │ │ ├── au.cpp │ │ │ │ │ ├── common.cpp │ │ │ │ │ ├── unity.cpp │ │ │ │ │ └── vst3.cpp │ │ │ ├── max │ │ │ │ ├── RNBO_MaxPresetAdapter.cpp │ │ │ │ ├── RNBO_MaxPresetAdapter.h │ │ │ │ ├── external │ │ │ │ │ └── rnbo_external_wrapper │ │ │ │ │ │ └── rnbo_external_wrapper.cpp │ │ │ │ ├── rnbo_bufferref.cpp │ │ │ │ └── rnbo_bufferref.h │ │ │ └── wasm │ │ │ │ └── RNBO_WebAssembly.cpp │ │ ├── cmake │ │ │ ├── CCache.cmake │ │ │ ├── MinGWSTDThreads.cmake │ │ │ ├── RNBOConan.cmake │ │ │ ├── RNBODescriptionHeader.cmake │ │ │ ├── RNBOJuce.cmake │ │ │ ├── SCCache.cmake │ │ │ ├── conan.cmake │ │ │ └── rnbo_description.h.in │ │ ├── common │ │ │ ├── RNBO_Array.h │ │ │ ├── RNBO_AudioSignal.h │ │ │ ├── RNBO_BaseInterface.h │ │ │ ├── RNBO_CMath.h │ │ │ ├── RNBO_Common.h │ │ │ ├── RNBO_CompilerMacros.h │ │ │ ├── RNBO_DataRef.h │ │ │ ├── RNBO_Debug.h │ │ │ ├── RNBO_EngineInterface.h │ │ │ ├── RNBO_EngineLink.h │ │ │ ├── RNBO_EventTarget.h │ │ │ ├── RNBO_ExternalBase.h │ │ │ ├── RNBO_ExternalPtr.h │ │ │ ├── RNBO_List.h │ │ │ ├── RNBO_ListHelpers.h │ │ │ ├── RNBO_Logger.h │ │ │ ├── RNBO_MIDIHelper.h │ │ │ ├── RNBO_Math.h │ │ │ ├── RNBO_MathFast.h │ │ │ ├── RNBO_ParameterInterface.h │ │ │ ├── RNBO_PatcherEventTarget.h │ │ │ ├── RNBO_PatcherFactory.h │ │ │ ├── RNBO_PatcherInterface.h │ │ │ ├── RNBO_PatcherInterfaceImpl.h │ │ │ ├── RNBO_PatcherStateInterface.h │ │ │ ├── RNBO_PlatformInterface.h │ │ │ ├── RNBO_ProbingInterface.h │ │ │ ├── RNBO_ProcessInterface.h │ │ │ ├── RNBO_Std.h │ │ │ ├── RNBO_String.h │ │ │ ├── RNBO_TimeConverter.h │ │ │ ├── RNBO_Types.h │ │ │ ├── RNBO_UniquePtr.h │ │ │ └── RNBO_Version.h │ │ ├── externals │ │ │ ├── RNBO_DllExternal.h │ │ │ ├── RNBO_External.h │ │ │ └── ext_rnbo.h │ │ ├── src │ │ │ ├── 3rdparty │ │ │ │ ├── MPark_variant │ │ │ │ │ └── variant.hpp │ │ │ │ ├── concurrentqueue │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── LICENSE.md │ │ │ │ │ ├── blockingconcurrentqueue.h │ │ │ │ │ ├── concurrentqueue.h │ │ │ │ │ ├── internal │ │ │ │ │ │ └── concurrentqueue_internal_debug.h │ │ │ │ │ └── lightweightsemaphore.h │ │ │ │ ├── json │ │ │ │ │ └── json.hpp │ │ │ │ └── readerwriterqueue │ │ │ │ │ ├── .gitignore │ │ │ │ │ ├── LICENSE.md │ │ │ │ │ ├── atomicops.h │ │ │ │ │ └── readerwriterqueue.h │ │ │ ├── RNBO_AudioBufferConverter.h │ │ │ ├── RNBO_BeatTimeEvent.h │ │ │ ├── RNBO_ClangInterface.h │ │ │ ├── RNBO_ClockEvent.h │ │ │ ├── RNBO_Config.h │ │ │ ├── RNBO_CoreObject.cpp │ │ │ ├── RNBO_CoreObject.h │ │ │ ├── RNBO_DataBuffer.cpp │ │ │ ├── RNBO_DataBuffer.h │ │ │ ├── RNBO_DataRefEvent.h │ │ │ ├── RNBO_DataRefList.cpp │ │ │ ├── RNBO_DataRefList.h │ │ │ ├── RNBO_DynamicPatcherFactory.cpp │ │ │ ├── RNBO_DynamicPatcherFactory.h │ │ │ ├── RNBO_DynamicSymbolRegistry.h │ │ │ ├── RNBO_EmptyEvent.h │ │ │ ├── RNBO_Engine.cpp │ │ │ ├── RNBO_Engine.h │ │ │ ├── RNBO_EngineCore.h │ │ │ ├── RNBO_EventList.h │ │ │ ├── RNBO_EventQueue.h │ │ │ ├── RNBO_EventSender.h │ │ │ ├── RNBO_EventVariant.h │ │ │ ├── RNBO_ExternalData.h │ │ │ ├── RNBO_ExternalLoader.cpp │ │ │ ├── RNBO_ExternalLoader.h │ │ │ ├── RNBO_FileChangeWatcher.cpp │ │ │ ├── RNBO_FileChangeWatcher.h │ │ │ ├── RNBO_HardwareDevice.h │ │ │ ├── RNBO_List.cpp │ │ │ ├── RNBO_Logger.cpp │ │ │ ├── RNBO_MaxClang.cpp │ │ │ ├── RNBO_MaxClang.h │ │ │ ├── RNBO_MessageEvent.h │ │ │ ├── RNBO_MidiEvent.h │ │ │ ├── RNBO_MidiStreamParser.h │ │ │ ├── RNBO_NullPatcher.h │ │ │ ├── RNBO_OutletEvent.h │ │ │ ├── RNBO_ParameterEvent.h │ │ │ ├── RNBO_ParameterEventInterface.h │ │ │ ├── RNBO_ParameterEventQueue.h │ │ │ ├── RNBO_ParameterInterfaceAsync.cpp │ │ │ ├── RNBO_ParameterInterfaceAsync.h │ │ │ ├── RNBO_ParameterInterfaceAsyncImpl.h │ │ │ ├── RNBO_ParameterInterfaceSync.cpp │ │ │ ├── RNBO_ParameterInterfaceSync.h │ │ │ ├── RNBO_PatcherEventSender.h │ │ │ ├── RNBO_PatcherFactory.cpp │ │ │ ├── RNBO_PatcherState.cpp │ │ │ ├── RNBO_PatcherState.h │ │ │ ├── RNBO_PatcherStateDummy.h │ │ │ ├── RNBO_PlatformInterfaceImpl.cpp │ │ │ ├── RNBO_PresetEvent.h │ │ │ ├── RNBO_PresetList.cpp │ │ │ ├── RNBO_PresetList.h │ │ │ ├── RNBO_Presets.h │ │ │ ├── RNBO_RemoteParameterClient.cpp │ │ │ ├── RNBO_ServiceNotification.h │ │ │ ├── RNBO_StartupEvent.h │ │ │ ├── RNBO_TempoEvent.h │ │ │ ├── RNBO_TimeSignatureEvent.h │ │ │ ├── RNBO_TransportEvent.h │ │ │ ├── RNBO_UnitTests.cpp │ │ │ ├── RNBO_UnitTests.h │ │ │ ├── RNBO_UniversalEvent.h │ │ │ ├── RNBO_Utils.h │ │ │ ├── RNBO_Vector.h │ │ │ └── platforms │ │ │ │ ├── nostdlib │ │ │ │ ├── RNBO_LoggerNoStdLib.cpp │ │ │ │ └── RNBO_PlatformInterfaceNoStdLib.cpp │ │ │ │ └── stdlib │ │ │ │ └── RNBO_PlatformInterfaceStdLib.h │ │ ├── test │ │ │ └── main.cpp │ │ └── version.cmake │ └── rnbo_source.cpp ├── img │ ├── envelope-mod.png │ └── voice-counting-logic.png ├── patches │ └── blob-synth.maxpat └── src │ ├── BlobComponent.h │ ├── RNBO_JuceAudioProcessorEditor.cpp │ ├── RNBO_JuceAudioProcessorEditor.h │ ├── RNBO_JuceAudioProcessorEditor_final.cpp │ └── RNBO_JuceAudioProcessorEditor_final.h ├── rnbo-rpi-interface ├── README.md ├── img │ └── fish-head-logic.png ├── patches │ ├── 14112022-fishsynth-simple.maxpat │ └── 19102022-fishsynth.maxpat └── src │ └── gpio.js └── rnbo-web-app ├── README.md ├── export ├── dependencies.json ├── patch.export.json └── patch.export.license ├── index.html ├── patches ├── auto-granulator-start.maxpat └── auto-granulator.maxpat ├── src ├── app-final.js └── app.js └── style └── style.css /.github/workflows/project.yml: -------------------------------------------------------------------------------- 1 | name: Add Issues and PRs to RNBO Project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | pull_request: 8 | types: 9 | - opened 10 | 11 | jobs: 12 | add-to-project: 13 | name: Add to RNBO Project 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/add-to-project@v0.3.0 17 | with: 18 | project-url: https://github.com/orgs/Cycling74/projects/${{ secrets.RNBO_PROJECT_NUMBER }} 19 | github-token: ${{ secrets.RNBO_PROJECT_PAT }} 20 | 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "lldb", 9 | "request": "launch", 10 | "name": "Launch", 11 | "program": "${workspaceFolder}/rnbo-command-line/src-finish/RNBOCommandLine", 12 | "args": [], 13 | "cwd": "${workspaceFolder}" 14 | } 15 | 16 | 17 | 18 | ] 19 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Cycling '74 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rnbo-adc-workshop 2 | How to use RNBO–A workshop for ADC 2022 3 | 4 | ## Rough outline 5 | 6 | - How to get RNBO 7 | -- You've already got RNBO, it's installed in Max 8 8 | -- (Maybe) you can have a short term license for the workshop 9 | 10 | - RNBO Basics 11 | -- Creating a rnbo~ object 12 | -- Getting sound in and out of RNBO 13 | -- Using param to create something that you can modulate from the outside 14 | -- Export this to a VST or something (might take a minute) 15 | 16 | - C++ Export, making a command line tool. 17 | -- I watched A Scanner Darkly on the plane, so I've been thinking about amplitude modulation I guess. 18 | -- You take this very simple patch and export it as a C++ file 19 | -- Modulate a parameter from a C++ program 20 | 21 | - C++ Export, custom VST 22 | -- Moving JUCE stuff around so you can have your way with the code 23 | 24 | - WASM Export 25 | -- Online drum sampler maybe? 26 | 27 | - Raspberry Pi Export 28 | -- Mabye someone else can export to this fish. That would be cool. 29 | 30 | - Hang out and answer questions? 31 | -------------------------------------------------------------------------------- /cherokee-out.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/rnbo-adc-workshop/6bb30058d47eef1e06beec350966805d2d18b593/cherokee-out.aif -------------------------------------------------------------------------------- /rnbo-command-line/README.md: -------------------------------------------------------------------------------- 1 | # rnbo-command-line 2 | 3 | This is a little demo of how you might use RNBO in a command-line app. It's 4 | really hacked together, and only intended to be used for demonstration. 5 | 6 | ## Dependencies 7 | 8 | First and foremost, you'll need RNBO and CMake. This code also depends on a 9 | third party library called libsndfile, and huge thanks to @rmpowell77 for adding 10 | that dependency to CMakeLists so that we don't have to download and build it as 11 | a separate step. So if you've got RNBO and CMake you can skip ahead to Directions. 12 | 13 | ## Directions 14 | 15 | This example is currently pretty limited in what it can do. It processes a stereo file 16 | called "anton.aif" in the src directory, producing a stereo output file called 17 | "anton-out.aif". 18 | 19 | 1. Make a Max patch with stereo inputs and stereo outputs. 20 | 2. Export that patch into `src` 21 | 3. Make a directory in `src` called `build` 22 | 4. `cd build && cmake ..` 23 | 5. `cmake --build .` 24 | 6. This will put an executable `RNBOCommandLine` in `src`. Run this thing to do the thing. 25 | 26 | -------------------------------------------------------------------------------- /rnbo-command-line/export/description.json: -------------------------------------------------------------------------------- 1 | { 2 | "parameters": [], 3 | "numParameters": 0, 4 | "numSignalInParameters": 0, 5 | "numSignalOutParameters": 0, 6 | "numInputChannels": 1, 7 | "numOutputChannels": 1, 8 | "numMidiInputPorts": 0, 9 | "numMidiOutputPorts": 0, 10 | "externalDataRefs": [], 11 | "patcherSerial": 0, 12 | "inports": [], 13 | "outports": [], 14 | "inlets": [ 15 | { 16 | "type": "signal", 17 | "index": 1, 18 | "tag": "in1", 19 | "meta": "" 20 | } 21 | ], 22 | "outlets": [ 23 | { 24 | "type": "signal", 25 | "index": 1, 26 | "tag": "out1", 27 | "meta": "" 28 | } 29 | ], 30 | "paramConversion": { 31 | "applyStepsToNormalizedParameterValue": "function applyStepsToNormalizedParameterValue(normalizedValue, steps) {\n if (steps == 1) {\n if (normalizedValue > 0) {\n normalizedValue = 1.;\n }\n } else {\n let oneStep = 1. / (steps - 1);\n let numberOfSteps = rnbo_fround(normalizedValue / oneStep * 1 / 1) * 1;\n normalizedValue = numberOfSteps * oneStep;\n }\n\n return normalizedValue;\n}", 32 | "convertToNormalizedParameterValue": "function convertToNormalizedParameterValue(index, value) {\n switch (index) {\n default:\n return value;\n }\n}", 33 | "convertFromNormalizedParameterValue": "function convertFromNormalizedParameterValue(index, value) {\n value = (value < 0 ? 0 : (value > 1 ? 1 : value));\n\n switch (index) {\n default:\n return value;\n }\n}", 34 | "getNumParameters": "function getNumParameters() {\n return 0;\n}", 35 | "constrainParameterValue": "function constrainParameterValue(index, value) {\n var v = value;\n\n switch (index) {\n default:\n return value;\n }\n}", 36 | "subpatches": {}, 37 | "isPolyphonic": false 38 | }, 39 | "presetid": "rnbo", 40 | "meta": { 41 | "architecture": "x64", 42 | "filename": "am-tester.maxpat", 43 | "maxversion": "8.5.0", 44 | "rnboversion": "1.0.1" 45 | } 46 | } -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | docs 3 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Cycling '74 2 | 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/RNBO.cpp: -------------------------------------------------------------------------------- 1 | // rnbo_lib.cpp includes all the source files for RNBO 2 | // making it easy to include RNBO as source into a project. 3 | // Simply add this one file to your compilation. 4 | 5 | #include "RNBO.h" 6 | 7 | #include "src/RNBO_PlatformInterfaceImpl.cpp" // comes first to ensure that platform is available 8 | #include "src/RNBO_CoreObject.cpp" 9 | #include "src/RNBO_DataBuffer.cpp" 10 | #include "src/RNBO_DataRefList.cpp" 11 | #include "src/RNBO_DynamicPatcherFactory.cpp" 12 | #include "src/RNBO_Engine.cpp" 13 | #include "src/RNBO_ExternalLoader.cpp" 14 | #include "src/RNBO_FileChangeWatcher.cpp" 15 | #include "src/RNBO_Logger.cpp" 16 | #include "src/RNBO_MaxClang.cpp" 17 | #include "src/RNBO_ParameterInterfaceAsync.cpp" 18 | #include "src/RNBO_ParameterInterfaceSync.cpp" 19 | #include "src/RNBO_PatcherFactory.cpp" 20 | #include "src/RNBO_PatcherState.cpp" 21 | #include "src/RNBO_PresetList.cpp" 22 | #include "src/RNBO_List.cpp" 23 | #include "src/RNBO_UnitTests.cpp" 24 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/RNBO.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO.h 3 | // 4 | // Created by Rob Sussman on 8/4/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_H_ 9 | #define _RNBO_H_ 10 | 11 | #include "src/RNBO_Config.h" 12 | #include "common/RNBO_Types.h" 13 | #include "common/RNBO_ParameterInterface.h" 14 | #include "common/RNBO_BaseInterface.h" 15 | #include "common/RNBO_PatcherFactory.h" 16 | #include "src/RNBO_ParameterEvent.h" 17 | #include "src/RNBO_MidiEvent.h" 18 | #include "src/RNBO_DynamicSymbolRegistry.h" 19 | #include "src/RNBO_CoreObject.h" 20 | 21 | #endif // #ifndef _RNBO_H_ 22 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/RNBO_JuceAudioProcessorEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | RNBO_JuceAudioProcessorEditor.h 5 | Created: 21 Sep 2015 11:50:17am 6 | Author: stb 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #ifndef RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 12 | #define RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 13 | 14 | #include "JuceHeader.h" 15 | #include "RNBO.h" 16 | 17 | namespace RNBO { 18 | 19 | //============================================================================== 20 | /** 21 | 22 | this is mostly a copy of a Juce GenericAudioProcessorEditor, with the important 23 | difference that it can be refreshed via a ParameterInterfacHandle 24 | 25 | */ 26 | class RNBOAudioProcessorEditor : public AudioProcessorEditor, public AsyncUpdater, public RNBO::EventHandler 27 | { 28 | public: 29 | //============================================================================== 30 | RNBOAudioProcessorEditor (AudioProcessor* owner, CoreObject& rnboObject); 31 | ~RNBOAudioProcessorEditor() override; 32 | 33 | //============================================================================== 34 | void paint (Graphics&) override; 35 | void resized() override; 36 | 37 | void handleAsyncUpdate() override; 38 | 39 | void eventsAvailable() override; 40 | void handleParameterEvent(const RNBO::ParameterEvent& event) override; 41 | void handlePresetEvent(const RNBO::PresetEvent& event) override; 42 | 43 | private: 44 | 45 | void updateAllParams(); 46 | 47 | //============================================================================== 48 | PropertyPanel _panel; 49 | CoreObject& _rnboObject; 50 | ParameterEventInterfaceUniquePtr _parameterInterface; 51 | 52 | Array _params; 53 | Array _presetChooserComponents; 54 | }; 55 | 56 | } // namespace RNBO 57 | 58 | #endif // RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 59 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/staticplugin/AUInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${MACOSX_BUNDLE_BUNDLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 12 | CFBundleName 13 | ${MACOSX_BUNDLE_BUNDLE_NAME} 14 | CFBundleDisplayName 15 | ${MACOSX_BUNDLE_BUNDLE_NAME} 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 22 | CFBundleVersion 23 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 24 | NSHumanReadableCopyright 25 | ${MACOSX_BUNDLE_COPYRIGHT} 26 | NSHighResolutionCapable 27 | 28 | AudioComponents 29 | 30 | 31 | name 32 | ${PLUGIN_MANUFACTURER_NAME}: ${PLUGIN_NAME} 33 | description 34 | ${PLUGIN_NAME} 35 | factoryFunction 36 | RNBO_Plugin_AUFactory 37 | manufacturer 38 | ${PLUGIN_MANUFACTURER_CODE} 39 | type 40 | ${AU_PLUGIN_TYPE} 41 | subtype 42 | ${PLUGIN_CODE} 43 | version 44 | 1 45 | resourceUsage 46 | 47 | network.client 48 | 49 | temporary-exception.files.all.read-write 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/staticplugin/PkgInfo: -------------------------------------------------------------------------------- 1 | BNDL???? -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/staticplugin/UnityInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${MACOSX_BUNDLE_BUNDLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 12 | CFBundleName 13 | ${MACOSX_BUNDLE_BUNDLE_NAME} 14 | CFBundleDisplayName 15 | ${MACOSX_BUNDLE_BUNDLE_NAME} 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 22 | CFBundleVersion 23 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 24 | NSHumanReadableCopyright 25 | ${MACOSX_BUNDLE_COPYRIGHT} 26 | NSHighResolutionCapable 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/staticplugin/VST3Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${MACOSX_BUNDLE_BUNDLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 12 | CFBundleName 13 | ${MACOSX_BUNDLE_BUNDLE_NAME} 14 | CFBundleDisplayName 15 | ${MACOSX_BUNDLE_BUNDLE_NAME} 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 22 | CFBundleVersion 23 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 24 | NSHumanReadableCopyright 25 | ${MACOSX_BUNDLE_COPYRIGHT} 26 | NSHighResolutionCapable 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/staticplugin/au.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | //Audio Units entrypoint/factory 3 | 4 | //https://developer.apple.com/documentation/coreservices/componentresult 5 | typedef int32_t ComponentResult; 6 | 7 | extern "C" ComponentResult StaticAUExportEntry(void * params, void* obj); 8 | extern "C" void* StaticAUExportFactory(const void * desc); 9 | 10 | #define COMPONENT_ENTRYX(Name, Suffix) \ 11 | extern "C" __attribute__((visibility("default"))) ComponentResult Name ## Suffix (void* params, void* obj); \ 12 | extern "C" __attribute__((visibility("default"))) ComponentResult Name ## Suffix (void* params, void* obj) \ 13 | { \ 14 | return StaticAUExportEntry(params, obj); \ 15 | } 16 | 17 | #define FACTORY_ENTRYX(Name) \ 18 | extern "C" __attribute__((visibility("default"))) void* Name ## Factory (const void* desc); \ 19 | extern "C" __attribute__((visibility("default"))) void* Name ## Factory (const void* desc) \ 20 | { \ 21 | return StaticAUExportFactory(desc); \ 22 | } 23 | 24 | #define COMPONENT_ENTRY(Name, Suffix) COMPONENT_ENTRYX(Name, Suffix) 25 | #define FACTORY_ENTRY(Name) FACTORY_ENTRYX(Name) 26 | 27 | COMPONENT_ENTRY (RNBO_Plugin_AU, Entry) 28 | FACTORY_ENTRY (RNBO_Plugin_AU) 29 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/staticplugin/common.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" { 4 | const char * JuceStatic_Plugin_Name() { 5 | return PLUGIN_NAME; 6 | } 7 | uint32_t JuceStatic_Plugin_Code() { 8 | return PLUGIN_CODE_HEX; 9 | } 10 | uint32_t JuceStatic_Plugin_VersionCode() { 11 | return PLUGIN_VERSION_NUM; 12 | } 13 | const char * JuceStatic_Plugin_VersionString() { 14 | return PLUGIN_VERSION; 15 | } 16 | 17 | const char * JuceStatic_Plugin_Manufacturer() { 18 | return PLUGIN_MANUFACTURER_NAME; 19 | } 20 | const char * JuceStatic_Plugin_ManufacturerWebsite() { 21 | return PLUGIN_MANUFACTURER_WEBSITE; 22 | } 23 | const char * JuceStatic_Plugin_ManufacturerEmail() { 24 | return PLUGIN_MANUFACTURER_EMAIL; 25 | } 26 | uint32_t JuceStatic_Plugin_ManufacturerCode() { 27 | return PLUGIN_MANUFACTURER_CODE_HEX; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/staticplugin/unity.cpp: -------------------------------------------------------------------------------- 1 | #define UNITY_INTERFACE_EXPORT __attribute__ ((visibility("default"))) 2 | #define UNITY_INTERFACE_API 3 | 4 | //forward decl 5 | extern "C" int UNITY_INTERFACE_API JuceStatic_UnityGetAudioEffectDefinitions (void*** definitionsPtr); 6 | 7 | //entrypoint trampoline to JUCE 8 | extern "C" UNITY_INTERFACE_EXPORT int UNITY_INTERFACE_API UnityGetAudioEffectDefinitions (void*** definitionsPtr) 9 | { 10 | return JuceStatic_UnityGetAudioEffectDefinitions(definitionsPtr); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/juce/staticplugin/vst3.cpp: -------------------------------------------------------------------------------- 1 | //grabed/edited from the VST3 SDK 2 | //https://github.com/steinbergmedia/vst3_pluginterfaces/blob/b8566ef3b2a0cba60a96e3ef2001224c865c8b36/base/fplatform.h 3 | #if defined (_WIN32) 4 | #define PLUGIN_API __stdcall 5 | #define SMTG_EXPORT_SYMBOL __declspec (dllexport) 6 | #elif __gnu_linux__ || __linux__ 7 | #define PLUGIN_API 8 | #define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default"))) 9 | #elif __APPLE__ 10 | #define PLUGIN_API 11 | #define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default"))) 12 | #else 13 | #pragma error unknown platform 14 | #endif 15 | 16 | //forward decl 17 | class IPluginFactory; 18 | extern "C" IPluginFactory* PLUGIN_API JuceStatic_GetPluginFactory(); 19 | 20 | //VST3 entrypoint 21 | extern "C" SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory() 22 | { 23 | return JuceStatic_GetPluginFactory(); 24 | } 25 | 26 | #include 27 | extern "C" { 28 | uint32_t JuceStatic_Plugin_VSTNumMidiInputs() { 29 | return PLUGIN_NUM_MIDI_INPUTS; 30 | } 31 | uint32_t JuceStatic_Plugin_VSTNumMidiOutputs() { 32 | return PLUGIN_NUM_MIDI_OUTPUTS; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/max/RNBO_MaxPresetAdapter.h: -------------------------------------------------------------------------------- 1 | //forward decl 2 | struct _dictionary; 3 | typedef _dictionary t_dictionary; 4 | 5 | namespace RNBO { 6 | class PatcherState; 7 | class CoreObject; 8 | using Preset = PatcherState; 9 | } 10 | 11 | namespace MaxPresetAdapter { 12 | void toDict(const RNBO::Preset& preset, t_dictionary* presetDict); 13 | void fromDict(t_dictionary* presetDict, RNBO::Preset& preset); 14 | //XXX Note, this will block while waiting for the preset 15 | void getObjectPreset(RNBO::CoreObject& o, t_dictionary *presetDict, bool dspIsOn); 16 | void setObjectPreset(RNBO::CoreObject& o, t_dictionary *presetDict); 17 | } 18 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/adapters/max/rnbo_bufferref.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_BUFFERREF_H 2 | #define _RNBO_BUFFERREF_H 3 | 4 | //RNBO.h seems to have to come first in visual studio or std::numeric_limits<_>::max() breaks.. 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | extern "C" { 13 | // the dataref object which is used for managing all references 14 | // to internal Max buffers that are used by RNBO 15 | typedef struct _rnbo_bufferref { 16 | t_object obj; 17 | t_buffer_ref *r_buffer_ref; 18 | t_symbol *r_name; 19 | float *r_lastKnownAddress; // To determine if memory changed 20 | char r_islocked; 21 | } t_rnbo_bufferref; 22 | 23 | void rnbo_bufferref_register(); 24 | t_rnbo_bufferref *rnbo_bufferref_new(t_symbol *buffername); 25 | void rnbo_bufferref_free(t_rnbo_bufferref *x); 26 | t_max_err rnbo_bufferref_notify(t_rnbo_bufferref *x, t_symbol *s, t_symbol *msg, void *sender, void *data); 27 | float *rnbo_bufferref_lock(t_rnbo_bufferref *x); 28 | char rnbo_bufferref_islocked(t_rnbo_bufferref *x); 29 | void rnbo_bufferref_unlock(t_rnbo_bufferref *x); 30 | void rnbo_bufferref_setdirty(t_rnbo_bufferref *x); 31 | void rnbo_bufferref_setname(t_rnbo_bufferref *x, t_symbol * name); 32 | t_symbol * rnbo_bufferref_getname(t_rnbo_bufferref *x); 33 | void rnbo_bufferref_setlastaddress(t_rnbo_bufferref *x, float *lastAddress); 34 | float *rnbo_bufferref_getlastaddress(t_rnbo_bufferref *x); 35 | bool rnbo_bufferref_buffer_exists(t_rnbo_bufferref *x); 36 | } 37 | 38 | namespace RNBO { 39 | void DataRefBindMaxBuffer( 40 | ExternalDataIndex dataRefIndex, 41 | const ExternalDataRef* ref, 42 | t_rnbo_bufferref *dataref, 43 | UpdateRefCallback updateDataRef, 44 | ReleaseRefCallback releaseDataRef 45 | ); 46 | void DataRefUnbindMaxBuffer( 47 | const ExternalDataRef* externalRef, 48 | t_rnbo_bufferref *dataref 49 | ); 50 | }; 51 | #endif 52 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/cmake/CCache.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | 3 | find_program(CCACHE_PROGRAM ccache) 4 | if (CCACHE_PROGRAM) 5 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") 6 | endif() 7 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/cmake/MinGWSTDThreads.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | 3 | include(${CMAKE_CURRENT_LIST_DIR}/RNBOConan.cmake) 4 | 5 | #use mingw_stdthreads for windows cross compiling to work around need for pthreads otherwise 6 | if (CMAKE_SYSTEM_NAME STREQUAL Windows AND CMAKE_CROSSCOMPILING) 7 | #TODO what if we're using clang? 8 | set(BUILD_SYSTEM_IS_MINGW On) 9 | conan_cmake_configure( 10 | REQUIRES mingw_stdthreads/1.0.1@c74/testing 11 | GENERATORS cmake_paths 12 | ) 13 | conan_cmake_install( 14 | PATH_OR_REFERENCE . 15 | BUILD missing 16 | ) 17 | include(${CMAKE_CURRENT_BINARY_DIR}/conan_paths.cmake) 18 | option(MINGW_STDTHREADS_GENERATE_STDHEADERS "" ON) 19 | add_subdirectory(${CONAN_MINGW_STDTHREADS_ROOT} ${CMAKE_CURRENT_BINARY_DIR}/mingw_stdthreads) 20 | endif() 21 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/cmake/RNBOConan.cmake: -------------------------------------------------------------------------------- 1 | #setup conan, include the module paths, setup the remote 2 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR}) 3 | list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}) 4 | 5 | include_guard(GLOBAL) 6 | 7 | #cloud compiler might have already included conan 8 | if (NOT COMMAND conan_check) 9 | include(${CMAKE_CURRENT_LIST_DIR}/conan.cmake) 10 | endif() 11 | 12 | conan_check(VERSION 1.29.0 REQUIRED) 13 | conan_add_remote( 14 | NAME cycling-public 15 | INDEX 1 16 | URL https://conan-public.cycling74.com 17 | VERIFY_SSL True 18 | ) 19 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/cmake/RNBODescriptionHeader.cmake: -------------------------------------------------------------------------------- 1 | function(rnbo_write_description_header DESCRIPTION_JSON OUTPUT_DIR) 2 | set(PATCHER_DESCRIPTION_JSON ${DESCRIPTION_JSON}) 3 | configure_file(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/rnbo_description.h.in ${OUTPUT_DIR}/rnbo_description.h) 4 | endfunction() 5 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/cmake/RNBOJuce.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | 3 | set(RNBO_JUCE_VERSION 6.1.2) 4 | 5 | if (RNBO_JUCE_USE_CONAN) 6 | include(${CMAKE_CURRENT_LIST_DIR}/RNBOConan.cmake) 7 | 8 | conan_cmake_configure( 9 | REQUIRES "JUCE/${RNBO_JUCE_VERSION}@c74/testing" 10 | GENERATORS cmake_paths 11 | ) 12 | conan_cmake_autodetect(settings) 13 | conan_cmake_install( 14 | PATH_OR_REFERENCE . 15 | BUILD missing 16 | SETTINGS ${settings} 17 | REMOTE cycling-public 18 | ) 19 | include(${CMAKE_CURRENT_BINARY_DIR}/conan_paths.cmake) 20 | find_package(JUCE ${RNBO_JUCE_VERSION} CONFIG REQUIRED) 21 | else() 22 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../../../thirdparty/juce ${CMAKE_BINARY_DIR}/juce) 23 | endif() 24 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/cmake/SCCache.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | 3 | find_program(SCCACHE_PROGRAM sccache) 4 | if (SCCACHE_PROGRAM) 5 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${SCCACHE_PROGRAM}") 6 | endif() 7 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/cmake/rnbo_description.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace RNBO { 6 | const nlohmann::json patcher_description = R"RNBOJSON( @PATCHER_DESCRIPTION_JSON@ )RNBOJSON"; 7 | } 8 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_Array.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_TUPLE_H_ 2 | #define _RNBO_TUPLE_H_ 3 | 4 | namespace RNBO { 5 | 6 | /** 7 | * Fixed-size array. Drop-in replacement for std::array, if you're compiling RNBO without stdlib. 8 | */ 9 | template class array { 10 | public: 11 | 12 | template array(Ts ... args) 13 | { 14 | // since allocating an array of 0 length is invalid, we always allocate at least length 1 15 | T values[sizeof...(args) + 1] = {static_cast(args)...}; 16 | for (size_t i = 0; i < sizeof...(args) && i < N; i++) { 17 | _values[i] = values[i]; 18 | } 19 | } 20 | 21 | // copy constructor 22 | array(const array& a) 23 | { 24 | for (size_t i = 0; i < N; i++) { 25 | _values[i] = a._values[i]; 26 | } 27 | } 28 | 29 | array& operator=(const array& a) 30 | { 31 | if (&a != this) { 32 | for (size_t i = 0; i < N; i++) { 33 | _values[i] = a._values[i]; 34 | } 35 | } 36 | return *this; 37 | } 38 | 39 | constexpr size_t size() const { return N; } 40 | constexpr bool empty() const { return size() == 0; } 41 | 42 | T& operator[](size_t n) { 43 | if (n >= N) { 44 | Platform::get()->errorOrDefault(RuntimeError::OutOfRange, "array index out of range", false /*unused*/); 45 | _dummy = static_cast(0); 46 | return _dummy; 47 | } 48 | return _values[n]; 49 | } 50 | const T& operator[](size_t n) const { 51 | if (n >= N) { 52 | Platform::get()->errorOrDefault(RuntimeError::OutOfRange, "array index out of range", false /*unused*/); 53 | return _dummy; 54 | } 55 | return _values[n]; 56 | } 57 | 58 | private: 59 | T _values[N ? N : 1]; 60 | T _dummy = static_cast(0); 61 | }; 62 | 63 | } // namespace RNBO 64 | 65 | #endif // #ifndef _RNBO_TUPLE_H_ 66 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_BaseInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_BASEINTERFACE_H_ 2 | #define _RNBO_BASEINTERFACE_H_ 3 | 4 | #include "RNBO_Types.h" 5 | #include "RNBO_ParameterInterface.h" 6 | 7 | namespace RNBO { 8 | 9 | /** 10 | * Base class for objects which, like CoreObject, expose an interface to exported RNBO code. 11 | */ 12 | class BaseInterface : public ParameterInterface { 13 | 14 | public: 15 | 16 | /** 17 | * Initialize data after construction of the BaseInterface 18 | */ 19 | virtual void initialize() {} 20 | 21 | virtual Index getNumMidiInputPorts() const = 0; 22 | virtual Index getNumMidiOutputPorts() const = 0; 23 | 24 | virtual Index getNumInputChannels() const = 0; 25 | virtual Index getNumOutputChannels() const = 0; 26 | 27 | // methods from ParameterInterface, they are here for documentation only 28 | ParameterIndex getNumParameters() const override = 0; 29 | ConstCharPointer getParameterName(ParameterIndex index) const override = 0; 30 | ConstCharPointer getParameterId(ParameterIndex index) const override = 0; 31 | void getParameterInfo(ParameterIndex index, ParameterInfo* info) const override = 0; 32 | 33 | ParameterValue getParameterValue(ParameterIndex index) override = 0; 34 | void setParameterValue(ParameterIndex index, ParameterValue value, MillisecondTime time = RNBOTimeNow) override = 0; 35 | 36 | protected: 37 | 38 | ~BaseInterface() { } 39 | 40 | }; 41 | 42 | } // namespace RNBO 43 | 44 | #endif // #ifndef _RNBO_BASEINTERFACE_H_ 45 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_Common.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_Common.h 3 | // 4 | // Created by Rob Sussman on 11/11/15. 5 | // 6 | // 7 | 8 | // This file is included by the generated RNBO code 9 | // and is intended to have the minimal amount necessary to get 10 | // the generated code to build with the goal of speeding up 11 | // dynamic compilation via clang/llvm as much as possible. 12 | 13 | #ifndef _RNBO_Common_h 14 | #define _RNBO_Common_h 15 | 16 | #include "RNBO_PlatformInterface.h" 17 | #include "RNBO_Types.h" 18 | #include "RNBO_List.h" 19 | #include "RNBO_ListHelpers.h" 20 | #include "RNBO_Array.h" 21 | #include "RNBO_String.h" 22 | #include "RNBO_Logger.h" 23 | #include "RNBO_DataRef.h" 24 | #include "RNBO_BaseInterface.h" 25 | #include "RNBO_UniquePtr.h" 26 | #include "RNBO_ExternalPtr.h" 27 | #include "RNBO_EngineInterface.h" 28 | #include "RNBO_EventTarget.h" 29 | #include "RNBO_PatcherStateInterface.h" 30 | #include "RNBO_PatcherInterface.h" 31 | #include "RNBO_PatcherInterfaceImpl.h" 32 | #include "RNBO_PatcherFactory.h" 33 | #include "RNBO_MIDIHelper.h" 34 | #include "RNBO_TimeConverter.h" 35 | 36 | #endif // #ifndef _RNBO_Common_h 37 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_CompilerMacros.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef __has_builtin 4 | # define __has_builtin(x) 0 5 | #endif 6 | 7 | #ifndef __has_attribute 8 | # define __has_attribute(x) 0 9 | #endif 10 | 11 | #if !defined(GNUC_PREREQ) 12 | #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) 13 | #define GNUC_PREREQ(maj, min, patch) \ 14 | ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) + __GNUC_PATCHLEVEL__ >= \ 15 | ((maj) << 20) + ((min) << 10) + (patch)) 16 | #elif defined(__GNUC__) && defined(__GNUC_MINOR__) 17 | #define GNUC_PREREQ(maj, min, patch) \ 18 | ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) >= ((maj) << 20) + ((min) << 10)) 19 | #else 20 | #define GNUC_PREREQ(maj, min, patch) 0 21 | #endif 22 | #endif 23 | 24 | #if defined(__clang__) 25 | # if defined(__APPLE__) 26 | # define APPLE_CLANG_VERSION __clang_major__ 27 | # define CLANG_VERSION 0 28 | # else 29 | # define APPLE_CLANG_VERSION 0 30 | # define CLANG_VERSION __clang_major__ 31 | # endif 32 | #else 33 | # define APPLE_CLANG_VERSION 0 34 | # define CLANG_VERSION 0 35 | #endif 36 | 37 | // NB: clang/llvm on Windows will define _MSC_VER so be careful 38 | #if defined(_MSC_VER) 39 | #define MSVC_VERSION _MSC_VER 40 | #else 41 | #define MSVC_VERSION 0 42 | #endif 43 | 44 | #if __has_attribute(noinline) || GNUC_PREREQ(3, 4, 0) 45 | #define ATTRIBUTE_NOINLINE __attribute__((noinline)) 46 | #elif defined(_MSC_VER) 47 | #define ATTRIBUTE_NOINLINE __declspec(noinline) 48 | #else 49 | #define ATTRIBUTE_NOINLINE 50 | #endif 51 | 52 | #if __has_attribute(always_inline) || GNUC_PREREQ(4, 0, 0) 53 | #define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) 54 | #elif defined(_MSC_VER) 55 | #define ATTRIBUTE_ALWAYS_INLINE __forceinline 56 | #else 57 | #define ATTRIBUTE_ALWAYS_INLINE 58 | #endif 59 | 60 | #if __has_attribute(unused) || GNUC_PREREQ(4, 0, 0) 61 | #define ATTRIBUTE_UNUSED __attribute__((unused)) 62 | #elif defined(_MSC_VER) 63 | #define ATTRIBUTE_UNUSED // to suppress warning, wrap code with #pragma warning(disable/default:4505) 64 | #else 65 | #define ATTRIBUTE_UNUSED 66 | #endif 67 | 68 | #undef CLANG_VERSION 69 | #undef MSVC_VERSION 70 | #undef GNUC_PREREQ 71 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_Debug.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_DEBUG_H_ 2 | #define _RNBO_DEBUG_H_ 3 | 4 | #include "RNBO_Logger.h" 5 | 6 | // See https://github.com/scottt/debugbreak/blob/master/debugbreak.h for inspiration 7 | 8 | namespace RNBO { 9 | 10 | #ifndef RNBO_ASSERT 11 | 12 | # if defined(__APPLE__) 13 | 14 | #if defined(__thumb__) 15 | #define RNBODebugBreak __asm__ volatile(".inst 0xde01") 16 | #elif defined(__arm__) 17 | #define RNBODebugBreak __asm__ volatile(".inst 0xe7f001f0") 18 | #elif defined(__aarch64__) 19 | #define RNBODebugBreak __builtin_trap() 20 | #else 21 | #define RNBODebugBreak asm("int3") 22 | #endif 23 | 24 | #elif defined(_MSC_VER) 25 | #define RNBODebugBreak __debugbreak() 26 | #else 27 | #define RNBODebugBreak (0) 28 | #endif 29 | 30 | #define RNBO_STR_HELPER(x) #x 31 | #define RNBO_STR(x) RNBO_STR_HELPER(x) 32 | 33 | #if defined(_DEBUG) || defined(DEBUG) 34 | 35 | #define RNBO_ASSERT(condition) \ 36 | if (!(condition)) { console->log("ASSERTION - failed condition: %s\n", RNBO_STR(condition)); RNBODebugBreak; } 37 | 38 | #define RNBO_DEBUG 1 39 | 40 | #else 41 | #define RNBO_ASSERT(condition) 42 | #endif 43 | 44 | #endif // #ifndef RNBO_ASSERT 45 | 46 | } // namespace RNBO 47 | 48 | #endif // #ifndef _RNBO_DEBUG_H_ 49 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_EngineLink.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_EngineLink_h_ 2 | #define _RNBO_EngineLink_h_ 3 | 4 | 5 | namespace RNBO { 6 | 7 | class EngineInterface; 8 | class PatcherEventTarget; 9 | 10 | /** 11 | * @private 12 | */ 13 | class EngineLink { 14 | 15 | public: 16 | 17 | void setEngineAndPatcher(EngineInterface *engineInterface, PatcherEventTarget* parentPatcher) { 18 | _engineInterface = engineInterface; 19 | _parentPatcher = parentPatcher; 20 | } 21 | 22 | virtual EngineInterface *getEngine() const { 23 | return _engineInterface; 24 | } 25 | 26 | PatcherEventTarget* getPatcherEventTarget() const { 27 | return _parentPatcher; 28 | } 29 | 30 | protected: 31 | 32 | ~EngineLink() { } 33 | 34 | EngineInterface* _engineInterface = nullptr; 35 | PatcherEventTarget* _parentPatcher = nullptr; 36 | }; 37 | 38 | } // namespace RNBO 39 | 40 | #endif // #ifndef _RNBO_EngineLink_h_ 41 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_EventTarget.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_EventTarget.h 3 | // 4 | // Created by Rob Sussman on 1/14/16. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_EventTarget_h_ 9 | #define _RNBO_EventTarget_h_ 10 | 11 | #include "RNBO_Types.h" 12 | #include "RNBO_EngineLink.h" 13 | 14 | namespace RNBO { 15 | 16 | /** 17 | * @private 18 | */ 19 | class EventTarget { 20 | 21 | public: 22 | 23 | virtual void processMidiEvent(MillisecondTime time, int port, ConstByteArray data, Index length) = 0; 24 | virtual void processClockEvent(MillisecondTime time, ClockId index, bool hasValue, ParameterValue value) = 0; 25 | 26 | protected: 27 | 28 | ~EventTarget() { } 29 | 30 | }; 31 | 32 | } // namespace RNBO 33 | 34 | #endif // #ifndef _RNBO_EventTarget_h_ 35 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_ExternalBase.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_ExternalBase_h_ 2 | #define _RNBO_ExternalBase_h_ 3 | 4 | #include "RNBO_ProcessInterface.h" 5 | #include "RNBO_EngineLink.h" 6 | #include "RNBO_EventTarget.h" 7 | 8 | namespace RNBO { 9 | 10 | /** 11 | * @private 12 | */ 13 | class ExternalBase : public ProcessInterface, public EngineLink, public EventTarget { 14 | 15 | public: 16 | 17 | virtual ~ExternalBase() { } 18 | 19 | }; 20 | 21 | } // namespace RNBO 22 | 23 | #endif // #ifndef _RNBO_ExternalBase_h_ 24 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_ExternalPtr.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_ExternalPtr.h 3 | // Created: 10 Feb 2016 2:46:28pm 4 | // Author: Stefan Brunner 5 | // 6 | // 7 | 8 | #ifndef _RNBO_EXTERNALPTR_H_ 9 | #define _RNBO_EXTERNALPTR_H_ 10 | 11 | #include "RNBO_UniquePtr.h" 12 | #include "RNBO_ExternalBase.h" 13 | 14 | namespace RNBO { 15 | 16 | /** 17 | * @private 18 | */ 19 | template 20 | class HolderPtr 21 | { 22 | public: 23 | HolderPtr() 24 | : _ptr(nullptr) 25 | {} 26 | 27 | HolderPtr(T* ptr) { 28 | _ptr.reset(ptr); 29 | } 30 | 31 | UniquePtr& operator->() { 32 | return _ptr; 33 | } 34 | 35 | const UniquePtr& operator->() const { 36 | return _ptr; 37 | } 38 | 39 | bool operator!() 40 | { 41 | return !_ptr; 42 | } 43 | 44 | T* get() const 45 | { 46 | return _ptr.get(); 47 | } 48 | 49 | explicit operator const T*() const { return _ptr.get(); } 50 | 51 | private: 52 | UniquePtr _ptr; 53 | }; 54 | 55 | template 56 | inline bool operator==(const T1* lhs, const HolderPtr& rhs) 57 | { 58 | return lhs == static_cast(rhs.get()); 59 | } 60 | 61 | template 62 | inline bool operator==(const HolderPtr& lhs, const T2* rhs) 63 | { 64 | return static_cast(lhs.get()) == rhs; 65 | } 66 | 67 | using ExternalPtr = HolderPtr; 68 | 69 | } 70 | 71 | #endif // #ifndef _RNBO_EXTERNALPTR_H_ 72 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_ListHelpers.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_LISTHELPERS_H_ 2 | #define _RNBO_LISTHELPERS_H_ 3 | 4 | // RNBO_LISTHELPERS.h -- list utilities used by generated code 5 | 6 | #include "RNBO_Std.h" 7 | 8 | namespace RNBO { 9 | 10 | ATTRIBUTE_UNUSED 11 | static list createListCopy(const list& l) 12 | { 13 | list tmp = l; 14 | return tmp; 15 | } 16 | 17 | /* 18 | * assume this statement: 19 | * 20 | * list newlist = oldlist; 21 | * 22 | * in C++ this will make a list copy, in JS this won't, so we need the below function (a NOOP in C++) 23 | */ 24 | ATTRIBUTE_UNUSED 25 | static const list& jsCreateListCopy(const list& l) 26 | { 27 | return l; 28 | } 29 | 30 | template list serializeArrayToList(T *array, size_t size) { 31 | list result; 32 | result.reserve(size); 33 | for (size_t i = 0; i < size; i++) { 34 | result.push((number)(array[i])); 35 | } 36 | return result; 37 | } 38 | 39 | template void deserializeArrayFromList(const list& l, T* result, size_t size) { 40 | for (size_t i = 0; i < size && i < l.length; i++) { 41 | result[i] = (T)(l[i]); 42 | } 43 | } 44 | 45 | } // namespace RNBO 46 | 47 | #endif // #ifndef _RNBO_LISTHELPERS_H_ 48 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_ParameterInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef RNBO_ParameterInterface_h 2 | #define RNBO_ParameterInterface_h 3 | 4 | #include "RNBO_Types.h" 5 | #include "RNBO_Math.h" 6 | 7 | namespace RNBO { 8 | 9 | class ParameterInterface { 10 | 11 | protected: 12 | ~ParameterInterface() { } 13 | 14 | public: 15 | virtual ParameterIndex getNumParameters() const = 0; 16 | virtual ConstCharPointer getParameterName(ParameterIndex index) const = 0; 17 | virtual ConstCharPointer getParameterId(ParameterIndex index) const = 0; 18 | virtual void getParameterInfo(ParameterIndex index, ParameterInfo* info) const = 0; 19 | 20 | virtual ParameterValue getParameterValue(ParameterIndex index) = 0; 21 | virtual void setParameterValue(ParameterIndex index, ParameterValue value, MillisecondTime time = RNBOTimeNow) = 0; 22 | 23 | virtual ParameterValue getParameterNormalized(ParameterIndex index) { 24 | return convertToNormalizedParameterValue(index, getParameterValue(index)); 25 | } 26 | 27 | virtual void setParameterValueNormalized(ParameterIndex index, ParameterValue normalizedValue, MillisecondTime time = RNBOTimeNow) { 28 | setParameterValue(index, convertFromNormalizedParameterValue(index, normalizedValue), time); 29 | } 30 | 31 | virtual ParameterValue convertToNormalizedParameterValue(ParameterIndex index, ParameterValue value) const = 0; 32 | virtual ParameterValue convertFromNormalizedParameterValue(ParameterIndex index, ParameterValue normalizedValue) const = 0; 33 | virtual ParameterValue constrainParameterValue(ParameterIndex, ParameterValue value) const { return value; } 34 | }; 35 | 36 | } // namespace RNBO 37 | 38 | #endif // RNBO_ParameterInterface_h 39 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_PatcherEventTarget.h: -------------------------------------------------------------------------------- 1 | // 2 | // _RNBO_PatcherInterface_H_ 3 | // 4 | // Created by Rob Sussman on 8/4/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_PatcherEventTarget_H_ 9 | #define _RNBO_PatcherEventTarget_H_ 10 | 11 | #include "RNBO_Types.h" 12 | #include "RNBO_EventTarget.h" 13 | #include "RNBO_List.h" 14 | 15 | namespace RNBO { 16 | 17 | /** 18 | * @private 19 | */ 20 | class PatcherEventTarget : public EventTarget { 21 | 22 | public: 23 | 24 | virtual void processNormalizedParameterEvent(ParameterIndex index, ParameterValue value, MillisecondTime time) = 0; 25 | virtual void processParameterEvent(ParameterIndex index, ParameterValue value, MillisecondTime time) = 0; 26 | virtual void processOutletEvent(EngineLink* sender, OutletIndex index, ParameterValue value, MillisecondTime time) = 0; 27 | virtual void processOutletAtCurrentTime(EngineLink* sender, OutletIndex index, ParameterValue value) = 0; 28 | virtual void processDataViewUpdate(DataRefIndex index, MillisecondTime time) = 0; 29 | virtual void processNumMessage(MessageTag tag, MessageTag objectId, MillisecondTime time, number payload) = 0; 30 | virtual void processListMessage(MessageTag tag, MessageTag objectId, MillisecondTime time, const list& payload) = 0; 31 | virtual void processBangMessage(MessageTag tag, MessageTag objectId, MillisecondTime time) = 0; 32 | virtual void processTempoEvent(MillisecondTime time, Tempo tempo) = 0; 33 | virtual void processTransportEvent(MillisecondTime time, TransportState state) = 0; 34 | virtual void processBeatTimeEvent(MillisecondTime time, BeatTime beatTime) = 0; 35 | virtual void processTimeSignatureEvent(MillisecondTime time, int numerator, int denominator) = 0; 36 | 37 | protected: 38 | 39 | ~PatcherEventTarget() { } 40 | 41 | }; 42 | 43 | } // namespace RNBO 44 | 45 | 46 | #endif // #ifndef _RNBO_PatcherEventTarget_H_ 47 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_PatcherFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_PatcherFactory.h 3 | // 4 | // Created by DDZ on 11/08/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_PatcherFactory_h 9 | #define _RNBO_PatcherFactory_h 10 | 11 | namespace RNBO { 12 | 13 | class PlatformInterface; 14 | class PatcherInterface; 15 | 16 | /** The patcher factory is just a function pointer to a function that 17 | allocates a PatcherInterface derived object and returns the PatcherInterface pointer 18 | Note, PatcherInterface should be freed via the PatcherInterface destroy() method. 19 | */ 20 | using PatcherFactoryFunctionPtr = PatcherInterface*(*)(); 21 | 22 | /** the patcher factory can be obtained via a staticaly linked in function named GetPatcherFactoryFunction 23 | or a DLL can export the function named GetPatcherFactoryFunction in which case the function 24 | should have the following signature. 25 | */ 26 | using GetPatcherFactoryFunctionPtr = PatcherFactoryFunctionPtr(*)(PlatformInterface*); 27 | 28 | } // namespace RNBO 29 | 30 | #ifndef RNBO_NO_PATCHERFACTORY 31 | extern "C" RNBO::PatcherFactoryFunctionPtr GetPatcherFactoryFunction(RNBO::PlatformInterface*); 32 | #endif 33 | 34 | #endif // ifndef _RNBO_PatcherFactory_h 35 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_PatcherInterfaceImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // _RNBO_PatcherInterfaceImpl_H_ 3 | // 4 | // Created by Rob Sussman on 1/11/18. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_PatcherInterfaceImpl_H_ 9 | #define _RNBO_PatcherInterfaceImpl_H_ 10 | 11 | #include "RNBO_Types.h" 12 | #include "RNBO_PatcherInterface.h" 13 | 14 | namespace RNBO { 15 | 16 | class PatcherInterfaceImpl : public PatcherInterface 17 | { 18 | public: 19 | 20 | void destroy() override 21 | { 22 | delete this; 23 | } 24 | 25 | }; 26 | 27 | } // namespace RNBO 28 | 29 | 30 | #endif // #ifndef _RNBO_PatcherInterfaceImpl_H_ 31 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_ProbingInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_PROBINGINTERFACE_H_ 2 | #define _RNBO_PROBINGINTERFACE_H_ 3 | 4 | #include "RNBO_Types.h" 5 | 6 | namespace RNBO { 7 | 8 | /** 9 | * @private 10 | */ 11 | class ProbingInterface { 12 | 13 | protected: 14 | 15 | ~ProbingInterface() { } 16 | 17 | public: 18 | 19 | virtual ParameterIndex getParameterIndexForID(ConstCharPointer paramid) const = 0; 20 | virtual ParameterIndex getProbingChannels(MessageTag outletId) const = 0; 21 | }; 22 | 23 | } // namespace RNBO 24 | 25 | #endif // #ifndef _RNBO_PROBINGINTERFACE_H_ 26 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_ProcessInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_PROCESSINTERFACE_H_ 2 | #define _RNBO_PROCESSINTERFACE_H_ 3 | 4 | #include "RNBO_Types.h" 5 | #include "RNBO_BaseInterface.h" 6 | 7 | namespace RNBO { 8 | 9 | /** 10 | * @brief An interface for signal-rate data processing 11 | */ 12 | class ProcessInterface : public BaseInterface { 13 | 14 | protected: 15 | 16 | ~ProcessInterface() {} 17 | 18 | public: 19 | 20 | virtual void prepareToProcess(number sampleRate, Index maxBlockSize, bool force = false) = 0; 21 | 22 | virtual void process(SampleValue** audioInputs, Index numInputs, 23 | SampleValue** audioOutputs, Index numOutputs, 24 | Index sampleFrames) = 0; 25 | 26 | }; 27 | 28 | } // namespace RNBO 29 | 30 | #endif // #ifndef _RNBO_PROCESSINTERFACE_H_ 31 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/common/RNBO_Version.h: -------------------------------------------------------------------------------- 1 | //automatically generated 2 | #ifndef _RNBO_Version_H_ 3 | #define _RNBO_Version_H_ 4 | namespace RNBO { 5 | const char * version = "1.0.1"; 6 | } 7 | #endif 8 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/3rdparty/concurrentqueue/.gitignore: -------------------------------------------------------------------------------- 1 | *.ipch 2 | *.suo 3 | *.user 4 | *.sdf 5 | *.opensdf 6 | *.exe 7 | *.pdb 8 | build/bin/ 9 | build/*.log 10 | build/msvc12/*.log 11 | build/msvc12/obj/ 12 | build/msvc11/*.log 13 | build/msvc11/obj/ 14 | tests/fuzztests/fuzztests.log 15 | benchmarks/benchmarks.log 16 | tests/CDSChecker/*.o 17 | tests/CDSChecker/*.log 18 | tests/CDSChecker/model-checker/ 19 | tests/relacy/freelist.exe 20 | tests/relacy/spmchash.exe 21 | tests/relacy/log.txt 22 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/3rdparty/concurrentqueue/LICENSE.md: -------------------------------------------------------------------------------- 1 | This license applies to everything in this repository except that which 2 | is explicitly annotated as being written by other authors, i.e. the Boost 3 | queue (included in the benchmarks for comparison), Intel's TBB library (ditto), 4 | the CDSChecker tool (used for verification), the Relacy model checker (ditto), 5 | and Jeff Preshing's semaphore implementation (used in the blocking queue) which 6 | has a zlib license (embedded in blockingconcurrentqueue.h). 7 | 8 | 9 | Simplified BSD License: 10 | 11 | Copyright (c) 2013-2015, Cameron Desrochers. 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without modification, 15 | are permitted provided that the following conditions are met: 16 | 17 | - Redistributions of source code must retain the above copyright notice, this list of 18 | conditions and the following disclaimer. 19 | - Redistributions in binary form must reproduce the above copyright notice, this list of 20 | conditions and the following disclaimer in the documentation and/or other materials 21 | provided with the distribution. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 24 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 26 | THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 28 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 30 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/3rdparty/concurrentqueue/internal/concurrentqueue_internal_debug.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#define MCDBGQ_TRACKMEM 1 4 | //#define MCDBGQ_NOLOCKFREE_FREELIST 1 5 | //#define MCDBGQ_USEDEBUGFREELIST 1 6 | //#define MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX 1 7 | //#define MCDBGQ_NOLOCKFREE_IMPLICITPRODHASH 1 8 | 9 | #if defined(_WIN32) || defined(__WINDOWS__) || defined(__WIN32__) 10 | #define WIN32_LEAN_AND_MEAN 11 | #include 12 | namespace moodycamel { namespace debug { 13 | struct DebugMutex { 14 | DebugMutex() { InitializeCriticalSectionAndSpinCount(&cs, 0x400); } 15 | ~DebugMutex() { DeleteCriticalSection(&cs); } 16 | 17 | void lock() { EnterCriticalSection(&cs); } 18 | void unlock() { LeaveCriticalSection(&cs); } 19 | 20 | private: 21 | CRITICAL_SECTION cs; 22 | }; 23 | } } 24 | #else 25 | #include 26 | namespace moodycamel { namespace debug { 27 | struct DebugMutex { 28 | void lock() { m.lock(); } 29 | void unlock() { m.unlock(); } 30 | 31 | private: 32 | std::mutex m; 33 | }; 34 | } } 35 | #define 36 | #endif 37 | 38 | namespace moodycamel { namespace debug { 39 | struct DebugLock { 40 | explicit DebugLock(DebugMutex& mutex) 41 | : mutex(mutex) 42 | { 43 | mutex.lock(); 44 | } 45 | 46 | ~DebugLock() 47 | { 48 | mutex.unlock(); 49 | } 50 | 51 | private: 52 | DebugMutex& mutex; 53 | }; 54 | 55 | 56 | template 57 | struct DebugFreeList { 58 | DebugFreeList() : head(nullptr) { } 59 | DebugFreeList(DebugFreeList&& other) : head(other.head) { other.head = nullptr; } 60 | void swap(DebugFreeList& other) { std::swap(head, other.head); } 61 | 62 | inline void add(N* node) 63 | { 64 | DebugLock lock(mutex); 65 | node->freeListNext = head; 66 | head = node; 67 | } 68 | 69 | inline N* try_get() 70 | { 71 | DebugLock lock(mutex); 72 | if (head == nullptr) { 73 | return nullptr; 74 | } 75 | 76 | auto prevHead = head; 77 | head = head->freeListNext; 78 | return prevHead; 79 | } 80 | 81 | N* head_unsafe() const { return head; } 82 | 83 | private: 84 | N* head; 85 | DebugMutex mutex; 86 | }; 87 | } } 88 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/3rdparty/readerwriterqueue/.gitignore: -------------------------------------------------------------------------------- 1 | *.ipch 2 | *.suo 3 | *.user 4 | *.sdf 5 | *.opensdf 6 | *.exe 7 | tests/stabtest/msvc10/Debug/ 8 | tests/stabtest/msvc10/Release/ 9 | tests/stabtest/msvc10/obj/ 10 | tests/stabtest/msvc10/log.txt 11 | tests/stabtest/msvc12/Debug/ 12 | tests/stabtest/msvc12/Release/ 13 | tests/stabtest/msvc12/obj/ 14 | tests/stabtest/msvc12/log.txt 15 | tests/stabtest/log.txt 16 | tests/unittests/msvc10/Debug/ 17 | tests/unittests/msvc10/Release/ 18 | tests/unittests/msvc10/obj/ 19 | tests/unittests/msvc12/Debug/ 20 | tests/unittests/msvc12/Release/ 21 | tests/unittests/msvc12/obj/ 22 | tests/CDSChecker/model-checker/ 23 | benchmarks/msvc10/Debug/ 24 | benchmarks/msvc10/Release/ 25 | benchmarks/msvc10/obj/ 26 | benchmarks/msvc12/Debug/ 27 | benchmarks/msvc12/Release/ 28 | benchmarks/msvc12/obj/ 29 | test/ 30 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/3rdparty/readerwriterqueue/LICENSE.md: -------------------------------------------------------------------------------- 1 | This license applies to all the code in this repository except that written by third 2 | parties, namely the files in benchmarks/ext, which have their own licenses, and Jeff 3 | Preshing's semaphore implementation (used in the blocking queue) which has a zlib 4 | license (embedded in atomicops.h). 5 | 6 | Simplified BSD License: 7 | 8 | Copyright (c) 2013-2015, Cameron Desrochers 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without modification, 12 | are permitted provided that the following conditions are met: 13 | 14 | - Redistributions of source code must retain the above copyright notice, this list of 15 | conditions and the following disclaimer. 16 | - Redistributions in binary form must reproduce the above copyright notice, this list of 17 | conditions and the following disclaimer in the documentation and/or other materials 18 | provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 21 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 23 | THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 27 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 28 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_BeatTimeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_BeatTimeEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_BeatTimeEvent_H_ 7 | #define _RNBO_BeatTimeEvent_H_ 8 | 9 | #include "RNBO_Types.h" 10 | 11 | namespace RNBO { 12 | 13 | class PatcherEventTarget; 14 | 15 | /** 16 | * An event for setting the current transport time. Depending on the host, 17 | * setting the beat time may simply update the internal transport, or else 18 | * it may generate an event that causes the host to change its beat time. 19 | * @see RNBO::BeatTime represents time in quater notes, as used by (for 20 | * example) Ableton Link. @see RNBO::Millisecond time is of course the time 21 | * in milliseconds. 22 | */ 23 | class BeatTimeEvent { 24 | 25 | public: 26 | 27 | BeatTimeEvent() 28 | : _eventTime(0) 29 | , _beatTime(-1) 30 | { 31 | } 32 | 33 | ~BeatTimeEvent() 34 | { 35 | } 36 | 37 | BeatTimeEvent( 38 | MillisecondTime eventTime, 39 | BeatTime beatTime 40 | ) 41 | : _eventTime(eventTime) 42 | , _beatTime(beatTime) 43 | { 44 | } 45 | 46 | BeatTimeEvent(const BeatTimeEvent& other) 47 | : _eventTime(other._eventTime) 48 | { 49 | _beatTime = other._beatTime; 50 | } 51 | 52 | BeatTimeEvent(BeatTimeEvent&& other) 53 | : _eventTime(other._eventTime) 54 | { 55 | _beatTime = other._beatTime; 56 | } 57 | 58 | BeatTimeEvent& operator = (const BeatTimeEvent& other) 59 | { 60 | _eventTime = other._eventTime; 61 | _beatTime = other._beatTime; 62 | 63 | return *this; 64 | } 65 | 66 | bool operator==(const BeatTimeEvent& rhs) const 67 | { 68 | return rhs.getTime() == getTime() && rhs.getBeatTime() == getBeatTime(); 69 | } 70 | 71 | MillisecondTime getTime() const { return _eventTime; } 72 | BeatTime getBeatTime() const { return _beatTime; } 73 | 74 | // we will always use the default event target (the top level patcher) 75 | PatcherEventTarget* getEventTarget() const { return nullptr; } 76 | 77 | // debugging 78 | void dumpEvent() const { 79 | // disabling for now to avoid requiring fprintf support in generated code 80 | // fprintf(stdout, "BeatTimeEvent: time=%.3f beatTime=%d", _eventTime, _beatTime); 81 | } 82 | 83 | protected: 84 | 85 | MillisecondTime _eventTime; 86 | BeatTime _beatTime; 87 | 88 | friend class EventVariant; 89 | 90 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 91 | }; 92 | 93 | } // namespace RNBO 94 | 95 | #endif // #ifndef _RNBO_BeatTimeEvent_H_ 96 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_Config.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_Config.h 3 | // 4 | // Created by Rob Sussman on 1/12/16. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_Config_h_ 9 | #define _RNBO_Config_h_ 10 | 11 | // include your own RNBO_LocalConfig.h before including "RNBO.h" 12 | // if you want to override the settings in this file 13 | 14 | ////////////////////////////////////////////////////////////////////////////////// 15 | 16 | // dynamic compilation watches the patcher source file and 17 | // uses clang/llvm to recompile dynamically when it changes 18 | // can enable or disable here for local testing, but primary configuration should be via project file 19 | // #define USE_DYNAMIC_COMPILATION 20 | // #undef USE_DYNAMIC_COMPILATION 21 | 22 | // determines if we should init the file watcher that checks for changes in the 23 | // default test file and triggers re-compilation 24 | // #define USE_TEST_FILEWATCHER 25 | // #undef USE_TEST_FILEWATCHER 26 | 27 | ////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #if defined(USE_DYNAMIC_COMPILATION) && defined(RNBO_NO_CLANG) 30 | 31 | // disable clang/llvm for projects that don't need/support it 32 | #undef USE_DYNAMIC_COMPILATION 33 | 34 | #endif // defined(USE_DYNAMIC_COMPILATION) && defined(RNBO_NO_CLANG) 35 | 36 | ////////////////////////////////////////////////////////////////////////////////// 37 | 38 | // Default place to write output cpp code 39 | #ifdef RNBO_DEFAULT_TEST_FILE 40 | #define RNBO_TEST_FILE RNBO_QUOTE(RNBO_DEFAULT_TEST_FILE) 41 | #endif 42 | 43 | // Default place to write output js code 44 | #ifdef RNBO_DEFAULT_WEB_FILE 45 | #define RNBO_WEB_FILE RNBO_QUOTE(RNBO_DEFAULT_WEB_FILE) 46 | #endif 47 | 48 | // Switch off the default Patcher Interface creation, necessary when you want to 49 | // use multiple CoreObjects in one Project 50 | //#define RNBO_NO_PATCHERFACTORY 51 | 52 | ////////////////////////////////////////////////////////////////////////////////// 53 | 54 | #endif // #ifndef _RNBO_Config_h_ 55 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_DataBuffer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataBuffer.cpp 3 | // RNBOApp 4 | // 5 | // Created by Rob Sussman on 12/21/15. 6 | // 7 | // 8 | 9 | #include "RNBO_DataBuffer.h" 10 | 11 | namespace RNBO { 12 | 13 | DataBuffer::DataBuffer(size_t size) 14 | : _data(size) 15 | { 16 | 17 | } 18 | 19 | DataBuffer::DataBuffer(const char* dataToCopy, size_t sizeOfDataToCopy) 20 | : _data(sizeOfDataToCopy) 21 | { 22 | memcpy(_data.data(), dataToCopy, _data.size()); 23 | } 24 | 25 | DataBuffer::DataBuffer(const char* stringToCopy) 26 | : _data(strlen(stringToCopy)+1) 27 | { 28 | memcpy(_data.data(), stringToCopy, _data.size()); 29 | } 30 | 31 | void DataBuffer::resize(size_t size) 32 | { 33 | _data.resize(size); 34 | } 35 | 36 | 37 | } // namespace RNBO 38 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_DataBuffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataBuffer.h 3 | // 4 | // Created by Rob Sussman on 12/21/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_DataBuffer_H_ 9 | #define _RNBO_DataBuffer_H_ 10 | 11 | #include 12 | #include 13 | 14 | namespace RNBO { 15 | 16 | /** 17 | * DataBuffer holds an arbitrary block of data. 18 | * 19 | * It is designed to be owned and used from one thread at a time and has no protections/locks on any of its methods. 20 | * It is also designed to minimize memory allocation, so shrinking the buffer size will not cause reallocations. 21 | */ 22 | class DataBuffer 23 | { 24 | public: 25 | 26 | /** 27 | * @brief Initialize a DataBuffer with zeros 28 | * 29 | * @param size the buffer size in bytes 30 | */ 31 | DataBuffer(size_t size); 32 | 33 | /** 34 | * @brief Initialize a DataBuffer with a block of memory 35 | * 36 | * @param dataToCopy source data to copy 37 | * @param sizeOfDataToCopy the number of bytes to copy from the source data 38 | */ 39 | DataBuffer(const char* dataToCopy, size_t sizeOfDataToCopy); 40 | 41 | /** 42 | * @brief Initialize a DataBuffer with a null-terminated string 43 | * 44 | * The string's contents are copied to a newly allocated block of memory. 45 | * 46 | * @param stringToCopy the null-terminated string to initialize the DataBuffer with 47 | */ 48 | DataBuffer(const char* stringToCopy); 49 | 50 | /** 51 | * @brief Resize the DataBuffer, attempting to preserve contents 52 | * 53 | * When expanding, the extra space is filled with zeros. 54 | * 55 | * @param size the new size of the DataBuffer 56 | */ 57 | void resize(size_t size); 58 | 59 | /** 60 | * @brief Get the current buffer size 61 | * 62 | * @return the size of the DataBuffer in bytes 63 | */ 64 | size_t size() const { return _data.size(); } 65 | 66 | /** 67 | * @brief Get a pointer to the raw data 68 | * 69 | * This can be used to modify the data in the buffer 70 | * 71 | * @return a pointer to the first byte of raw data in the DataBuffer 72 | */ 73 | char* data() { return _data.data(); } 74 | 75 | /** 76 | * @brief Get a const pointer to the raw data 77 | * 78 | * @return a const pointer to the first byte of raw data in the DataBuffer 79 | */ 80 | const char* data() const { return _data.data(); } 81 | 82 | private: 83 | std::vector _data; 84 | }; 85 | 86 | using DataBufferRef = std::shared_ptr; 87 | 88 | } // namespace RNBO 89 | 90 | #endif // #ifndef _RNBO_DataBuffer_H_ 91 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_DataRefEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataRefEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_DataRefEvent_H_ 7 | #define _RNBO_DataRefEvent_H_ 8 | 9 | #include "RNBO_PatcherInterface.h" 10 | 11 | namespace RNBO { 12 | 13 | /** 14 | * An event for updating a Data Reference. Used internally. 15 | */ 16 | class DataRefEvent { 17 | 18 | public: 19 | 20 | enum 21 | { 22 | InvalidDataRefIndex = -1 23 | }; 24 | 25 | enum DataRefAction { 26 | NoAction, 27 | UpdateDataRef 28 | }; 29 | 30 | DataRefEvent() 31 | : _dataRefIndex(InvalidDataRefIndex) 32 | , _eventTime(0) 33 | , _action(NoAction) 34 | , _eventTarget(nullptr) 35 | { 36 | } 37 | 38 | DataRefEvent(const DataRefEvent& other) = default; 39 | DataRefEvent& operator = (const DataRefEvent& other) = default; 40 | 41 | DataRefEvent(DataRefIndex dataRefIndex, MillisecondTime eventTime, DataRefAction action, PatcherEventTarget* eventTarget = nullptr) 42 | : _dataRefIndex(dataRefIndex) 43 | , _eventTime(eventTime) 44 | , _action(action) 45 | , _eventTarget(eventTarget) 46 | { 47 | } 48 | 49 | bool operator==(const DataRefEvent& rhs) const 50 | { 51 | return rhs.getDataRefIndex() == getDataRefIndex() 52 | && rhs.getTime() == getTime() 53 | && getAction() == rhs.getAction() 54 | && rhs._eventTarget == _eventTarget; 55 | } 56 | 57 | DataRefIndex getDataRefIndex() const { return _dataRefIndex; } 58 | DataRefAction getAction() const { return _action; } 59 | 60 | MillisecondTime getTime() const { return _eventTime; } 61 | PatcherEventTarget* getEventTarget() const { return _eventTarget; } 62 | 63 | // debugging 64 | void dumpEvent() const 65 | { 66 | // disabling for now to avoid requiring fprintf support in generated code 67 | // fprintf(stdout, "DataRefEvent: DataRefIndex=%d time=%.3f action=%.4f\n", _dataRefIndex, _eventTime, _action); 68 | } 69 | 70 | private: 71 | 72 | DataRefIndex _dataRefIndex; 73 | MillisecondTime _eventTime; 74 | DataRefAction _action; 75 | 76 | friend class EventVariant; 77 | 78 | PatcherEventTarget* _eventTarget; 79 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 80 | 81 | }; 82 | 83 | } // namespace RNBO 84 | 85 | #endif // #ifndef _RNBO_DataRefEvent_H_ 86 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_DataRefList.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataRefList.cpp 3 | // RNBO 4 | // 5 | // Created by Sam Tarakajian on 2/10/20. 6 | // 7 | 8 | #include "RNBO_DataRefList.h" 9 | 10 | #ifndef RNBO_NOSTDLIB 11 | 12 | RNBO_PUSH_DISABLE_WARNINGS 13 | #include "3rdparty/json/json.hpp" 14 | RNBO_POP_DISABLE_WARNINGS 15 | 16 | using Json = nlohmann::json; 17 | 18 | namespace RNBO { 19 | 20 | DataRefList::DataRefList(std::string jsonString) 21 | { 22 | Json json = Json::parse(jsonString); 23 | for (Json::iterator it = json.begin(); it != json.end(); it++) { 24 | if (it->is_object()) { 25 | Json& j = *it; 26 | 27 | if (j.contains("id") && (j.contains("file") || j.contains("url"))) { 28 | std::string rid = j["id"]; 29 | std::string location = j.contains("file") ? j["file"] : j["url"]; 30 | auto type = j.contains("file") ? DataRefType::File : DataRefType::URL; 31 | 32 | _ids.push_back(rid); 33 | _locations.push_back(location); 34 | _types.push_back(type); 35 | } 36 | } 37 | } 38 | } 39 | 40 | DataRefList::~DataRefList() {} 41 | 42 | size_t DataRefList::size() 43 | { 44 | return _ids.size(); 45 | } 46 | 47 | std::string DataRefList::datarefIdAtIndex(size_t index) 48 | { 49 | return _ids[index]; 50 | } 51 | 52 | std::string DataRefList::datarefLocationAtIndex(size_t index) 53 | { 54 | return _locations[index]; 55 | } 56 | 57 | DataRefType DataRefList::datarefTypeAtIndex(size_t index) 58 | { 59 | return _types[index]; 60 | } 61 | 62 | } 63 | 64 | #endif /* RNBO_NOPRESETS */ 65 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_DataRefList.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataRefList.h 3 | // RNBO 4 | // 5 | // Created by Sam Tarakajian on 2/10/20. 6 | // 7 | 8 | #ifndef RNBO_DataRefList_h 9 | #define RNBO_DataRefList_h 10 | 11 | #include "RNBO_Utils.h" 12 | #include 13 | 14 | #ifndef RNBO_NOSTDLIB 15 | namespace RNBO { 16 | enum class DataRefType { 17 | File, 18 | URL 19 | }; 20 | 21 | /** 22 | * Wrapper class for exported RNBO dependencies. After reading a 23 | * dependencies.json file as a string, use this class to retrieve data ref 24 | * description information. 25 | * 26 | * @code{.cpp} 27 | * #include 28 | * #include 29 | * 30 | * // Read in the dependencies.json file as a std::string 31 | * std::ifstream t("../dependencies.json"); 32 | * std::stringstream buffer; 33 | * buffer << t.rdbuf(); 34 | * 35 | * // Parse dependencies into a RNBO DataRefList 36 | * DataRefList list(buffer.str()); 37 | * @endcode 38 | */ 39 | class DataRefList { 40 | public: 41 | 42 | DataRefList(std::string jsonString); 43 | ~DataRefList(); 44 | 45 | /** 46 | * Number of data refs in the list. 47 | */ 48 | size_t size(); 49 | 50 | /** 51 | * Get the ID of the data ref at the given index. 52 | * @code{.cpp} 53 | * std::string idstr = list.datarefIdAtIndex(i); 54 | * @endcode 55 | */ 56 | std::string datarefIdAtIndex(size_t index); 57 | 58 | /** 59 | * Get the path of the data ref at the given index. Can be a URL or a 60 | * file path. 61 | * @code{.cpp} 62 | * std::string location = list.datarefLocationAtIndex(i); 63 | * @endcode 64 | */ 65 | std::string datarefLocationAtIndex(size_t index); 66 | 67 | /** 68 | * Get the RNBO::DataRefType of the data ref at the given index. 69 | * @code{.cpp} 70 | * DataRefType type = list.datarefTypeAtIndex(i); 71 | * @endcode 72 | */ 73 | DataRefType datarefTypeAtIndex(size_t index); 74 | 75 | private: 76 | std::vector _ids; 77 | std::vector _locations; 78 | std::vector _types; 79 | }; 80 | } 81 | #endif /* RNBO_NOSTDLIB */ 82 | 83 | #endif /* RNBO_DataRefList_h */ 84 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_DynamicSymbolRegistry.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_DYNAMICSYMBOLREGISTRY_H_ 2 | #define _RNBO_DYNAMICSYMBOLREGISTRY_H_ 3 | 4 | #ifndef RNBO_DISABLE_CODEGEN 5 | 6 | #include 7 | 8 | namespace RNBO { 9 | 10 | /** 11 | * @private 12 | */ 13 | class DynamicSymbolRegistry { 14 | 15 | public: 16 | 17 | /** 18 | * @private 19 | */ 20 | struct DynamicSymbol { 21 | char _name[256]; 22 | void *_location; 23 | }; 24 | 25 | using DynamicSymbolList = std::vector; 26 | 27 | static DynamicSymbolList& getRegisteredSymbols() { 28 | static DynamicSymbolList dynamicSymbolRegistry; 29 | return dynamicSymbolRegistry; 30 | } 31 | 32 | static void registerSymbol(const char *name, void *location) { 33 | DynamicSymbol sym; 34 | char *n = sym._name; 35 | 36 | while ((*n++ = *name++) != 0) ; 37 | sym._location = location; 38 | 39 | getRegisteredSymbols().push_back(sym); 40 | } 41 | 42 | }; 43 | 44 | /** 45 | * @private 46 | */ 47 | class DynamicSymbolRegistrar { 48 | 49 | public: 50 | 51 | DynamicSymbolRegistrar(const char *name, void *location) { 52 | DynamicSymbolRegistry::registerSymbol(name, location); 53 | } 54 | 55 | }; 56 | 57 | } // RNBO 58 | 59 | # define CAT(a, ...) PRIMITIVE_CAT(a, __VA_ARGS__) 60 | # define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ 61 | 62 | # define REGISTER_RNBO_EXTERNAL(ExternalName) extern "C" RNBO::ExternalBase * CAT(ExternalName, Factory) () \ 63 | { return new ExternalName (); } \ 64 | static RNBO::DynamicSymbolRegistrar ExternalName ## RegisteredSymbol( #ExternalName "Factory" , (void *) CAT(ExternalName, Factory) ); 65 | 66 | #else // RNBO_DISABLE_CODEGEN 67 | 68 | namespace RNBO { 69 | 70 | class DynamicSymbolRegistry { 71 | 72 | }; 73 | 74 | class DynamicSymbolRegistrar { 75 | 76 | public: 77 | 78 | DynamicSymbolRegistrar(const char *name, void *location) {} 79 | 80 | }; 81 | 82 | } // RNBO 83 | 84 | # define REGISTER_RNBO_EXTERNAL(ExternalName) 85 | 86 | #endif // RNBO_DISABLE_CODEGEN 87 | 88 | #endif // _RNBO_DYNAMICSYMBOLREGISTRY_H_ 89 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_EmptyEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_EmptyEvent.h 3 | // 4 | // Created by Rob Sussman on 9/18/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_EmptyEvent_h 9 | #define _RNBO_EmptyEvent_h 10 | 11 | namespace RNBO { 12 | 13 | /** 14 | * The EmptyEvent allows us to make an EventVariant that does not yet have an event. 15 | * 16 | * Useful, for example, to support calling a function that takes a reference to an EventVariant 17 | * and then fills in said EventVariant. 18 | */ 19 | class EmptyEvent { 20 | 21 | public: 22 | EmptyEvent() 23 | : _eventTarget(nullptr) 24 | { } 25 | 26 | bool operator==(const EmptyEvent& rhs) const 27 | { 28 | RNBO_UNUSED(rhs); 29 | return true; 30 | } 31 | 32 | // need a getTime() method for GetTimeVisitor to work. 33 | MillisecondTime getTime() const { return 0; } 34 | EventTarget* getEventTarget() const { return _eventTarget; } 35 | 36 | // debugging 37 | void dumpEvent() const { /* fprintf(stdout, "EmptyEvent\n"); */ } 38 | 39 | private: 40 | 41 | friend class EventVariant; 42 | 43 | void setTime(MillisecondTime eventTime) 44 | { 45 | RNBO_UNUSED(eventTime); 46 | } 47 | 48 | EventTarget *_eventTarget; 49 | 50 | }; 51 | 52 | } // namespace RNBO 53 | 54 | 55 | #endif // #ifndef _RNBO_EmptyEvent_h 56 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_FileChangeWatcher.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_FileChangeWatcher.cpp 3 | // RNBOApp 4 | // 5 | // Created by Rob Sussman on 12/11/15. 6 | // 7 | // 8 | 9 | #include "RNBO_FileChangeWatcher.h" 10 | 11 | #if defined(USE_DYNAMIC_COMPILATION) && !defined(RNBO_NO_JUCE) 12 | 13 | namespace RNBO { 14 | 15 | FileChangeWatcher::FileChangeWatcher(const char* fullPathToFile, 16 | std::function callback) 17 | : _fileToWatch(File(fullPathToFile)) 18 | , _callback(callback) 19 | { 20 | // init _lastModificationTime to avoid an initial notification 21 | _lastModificationTime = _fileToWatch.getLastModificationTime(); 22 | startTimer(1000); 23 | } 24 | 25 | FileChangeWatcher::~FileChangeWatcher() 26 | { 27 | 28 | } 29 | 30 | bool FileChangeWatcher::fileExists() const 31 | { 32 | return _fileToWatch.exists(); 33 | } 34 | 35 | const char* FileChangeWatcher::getFullPathToWatchedFile() const 36 | { 37 | return _fileToWatch.getFullPathName().toRawUTF8(); 38 | } 39 | 40 | void FileChangeWatcher::timerCallback() 41 | { 42 | Time modtime = _fileToWatch.getLastModificationTime(); 43 | if (_lastModificationTime != modtime) { 44 | _lastModificationTime = modtime; 45 | _callback(this); 46 | } 47 | } 48 | 49 | } // namespace RNBO 50 | 51 | #endif // #ifdef USE_DYNAMIC_COMPILATION 52 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_FileChangeWatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_FileChangeWatcher.h 3 | // 4 | // Created by Rob Sussman on 12/11/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_FileChangeWatcher_H_ 9 | #define _RNBO_FileChangeWatcher_H_ 10 | 11 | #include "RNBO_Config.h" 12 | 13 | #ifdef USE_DYNAMIC_COMPILATION 14 | 15 | #include 16 | 17 | #ifndef RNBO_NO_JUCE 18 | #include "JuceHeader.h" 19 | #endif 20 | 21 | namespace RNBO { 22 | 23 | #ifdef RNBO_NO_JUCE 24 | class FileChangeWatcher 25 | { 26 | public: 27 | FileChangeWatcher(const char* fullPathToFile, 28 | std::function callback) 29 | { 30 | // dummy implementation 31 | } 32 | }; 33 | #else 34 | class FileChangeWatcher : public Timer 35 | { 36 | public: 37 | 38 | /** FileChangeWatcher will call the callback when the file changes. 39 | Passes in a pointer to the watcher so you can query the path. 40 | */ 41 | FileChangeWatcher(const char* fullPathToFile, 42 | std::function callback); 43 | ~FileChangeWatcher(); 44 | 45 | bool fileExists() const; 46 | const char* getFullPathToWatchedFile() const; 47 | 48 | void timerCallback() override; 49 | 50 | private: 51 | File _fileToWatch; 52 | Time _lastModificationTime; 53 | std::function _callback; 54 | }; 55 | #endif // #ifdef RNBO_NO_JUCE 56 | 57 | } // namespace RNBO 58 | 59 | #endif // #ifdef USE_DYNAMIC_COMPILATION 60 | 61 | #endif // #ifndef _RNBO_FileChangeWatcher_H_ 62 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_List.cpp: -------------------------------------------------------------------------------- 1 | #include "RNBO_List.h" 2 | 3 | #ifdef C74_UNIT_TESTS 4 | #include 5 | #include 6 | 7 | namespace ListTests { 8 | using namespace RNBO; 9 | class Tests : public UnitTest { 10 | public: 11 | Tests() 12 | : UnitTest("List Tests") 13 | {} 14 | void runTest() override { 15 | beginTest("listbase bounds"); 16 | listbase l = { 1.0 }; 17 | expectDoesNotThrow(l[0]); 18 | expectThrowsType(l[1], std::out_of_range); 19 | expectThrowsType(l[1] = 20.0, std::out_of_range); 20 | expectThrowsType(l[100], std::out_of_range); 21 | 22 | //shift 23 | expectEquals(l.shift(), 1.0); 24 | expectThrowsType(l.shift(), std::out_of_range); 25 | 26 | //pop 27 | l.push(20.0); 28 | l.push(10.0); 29 | expectEquals(l.pop(), 10.0); 30 | expectEquals(l.pop(), 20.0); 31 | expectEquals(l.pop(), 0.0); 32 | expectEquals(l.pop(), 0.0); 33 | } 34 | }; 35 | Tests tests; 36 | } 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_Logger.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_Logger.cpp 3 | // Created: 25 Jan 2016 4:07:31pm 4 | // Author: stb 5 | // 6 | // 7 | 8 | #include "RNBO_Logger.h" 9 | #include "RNBO_DynamicSymbolRegistry.h" 10 | 11 | namespace RNBO { 12 | 13 | static Logger s_logger_instance; 14 | LoggerInterface* console = &s_logger_instance; 15 | static DynamicSymbolRegistrar ConsoleRegisteredSymbol("console" , reinterpret_cast(&console)); 16 | 17 | Logger::Logger() 18 | : _outputCallback(&Logger::defaultLogOutputFunction) 19 | { 20 | } 21 | 22 | Logger::~Logger() 23 | { 24 | } 25 | 26 | void Logger::setLoggerOutputCallback(OutputCallback* callback) 27 | { 28 | _outputCallback = callback ? callback : defaultLogOutputFunction; 29 | } 30 | 31 | void Logger::defaultLogOutputFunction(LogLevel level, const char* message) 32 | { 33 | const static char* levelStr[] = { "[INFO]", "[WARNING]", "[ERROR]" }; 34 | String formattedMessage = levelStr[level]; 35 | formattedMessage += "\t"; 36 | formattedMessage += message; 37 | formattedMessage += "\n"; 38 | Platform::get()->printMessage(formattedMessage.c_str()); 39 | } 40 | 41 | Logger& Logger::getInstance() 42 | { 43 | return s_logger_instance; 44 | } 45 | 46 | } // namespace RNBO 47 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_MaxClang.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_MAXCLANG_H_ 2 | #define _RNBO_MAXCLANG_H_ 3 | 4 | #if defined(USE_DYNAMIC_COMPILATION) 5 | 6 | #include "RNBO_ClangInterface.h" 7 | #include "ext.h" 8 | 9 | namespace RNBO { 10 | 11 | class MaxClang : public ClangInterface 12 | { 13 | public: 14 | 15 | MaxClang(); 16 | ~MaxClang(); 17 | 18 | void addPreprocessorDefinition(std::string definition) override; 19 | void addIncludePath(std::string path) override; 20 | void addSymbol(std::string name, void* address) override; 21 | void setOptimizationLevel(OLevel level) override; 22 | bool compile(std::string name, const std::string& source) override; 23 | void getLastErrors(t_dictionary **lastErrors) override; 24 | 25 | void* getFunctionAddress(std::string name) override; 26 | 27 | private: 28 | t_object* _maxclang; 29 | 30 | }; 31 | 32 | } // namespace RNBO 33 | 34 | #endif // #if defined(USE_DYNAMIC_COMPILATION) 35 | 36 | #endif // #ifndef _RNBO_MAXCLANG_H_ 37 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_OutletEvent.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _RNBO_OutletEvent_H_ 3 | #define _RNBO_OutletEvent_H_ 4 | 5 | #include "RNBO_Types.h" 6 | #include "RNBO_PatcherInterface.h" 7 | 8 | namespace RNBO { 9 | 10 | /** 11 | * An event representing a message sent through an outlet of an external 12 | */ 13 | class OutletEvent { 14 | public: 15 | 16 | OutletEvent(const OutletEvent& other) = default; 17 | OutletEvent& operator = (const OutletEvent& other) = default; 18 | 19 | OutletEvent() 20 | : _eventTime(0) 21 | , _sender(nullptr) 22 | , _index(INVALID_INDEX) 23 | , _value(0) 24 | , _eventTarget(nullptr) 25 | { 26 | } 27 | 28 | OutletEvent(MillisecondTime eventTime, EngineLink* sender, OutletIndex index, ParameterValue value, PatcherEventTarget* eventTarget = nullptr) 29 | : _eventTime(eventTime) 30 | , _sender(sender) 31 | , _index(index) 32 | , _value(value) 33 | , _eventTarget(eventTarget) 34 | { 35 | } 36 | 37 | bool operator==(const OutletEvent& rhs) const 38 | { 39 | return rhs.getTime() == getTime() 40 | && rhs.getSender() == getSender() 41 | && rhs.getIndex() == getIndex() 42 | && rhs.getValue() == getValue() 43 | && rhs._eventTarget == _eventTarget; 44 | } 45 | 46 | EngineLink* getSender() const { return _sender; } 47 | OutletIndex getIndex() const { return _index; } 48 | ParameterValue getValue() const { return _value; } 49 | 50 | MillisecondTime getTime() const { return _eventTime; } 51 | PatcherEventTarget* getEventTarget() const { return _eventTarget; } 52 | 53 | // debugging 54 | void dumpEvent() const { 55 | // fprintf(stdout, "OutletEvent: time: %.4f sender: %p index: %d value: %.4f eventTarget: %p\n", _eventTime, _sender, _index, _value, _eventTarget); 56 | } 57 | 58 | private: 59 | 60 | MillisecondTime _eventTime; 61 | EngineLink* _sender; 62 | OutletIndex _index; 63 | ParameterValue _value; 64 | 65 | friend class EventVariant; 66 | 67 | PatcherEventTarget* _eventTarget; 68 | 69 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 70 | 71 | }; 72 | 73 | } // namespace RNBO 74 | 75 | #endif // #ifndef _RNBO_OutletEvent_H_ 76 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_ParameterEventQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_ParameterEventQueue.h 3 | // Created by Timothy Place on 11.08.15. 4 | // 5 | 6 | #ifndef _RNBO_ParameterEventQueue_h 7 | #define _RNBO_ParameterEventQueue_h 8 | 9 | #include "RNBO_EventQueue.h" 10 | #include "RNBO_ServiceNotification.h" 11 | 12 | namespace RNBO { 13 | 14 | using ParameterEventQueue = EventQueue>; 15 | using ParameterEventQueuePtr = std::unique_ptr>; 16 | #if RNBO_MULTIPRODUCER_QUEUE_SUPPORTED 17 | using SafeParameterEventQueue = EventQueue>; 18 | #else 19 | using SafeParameterEventQueue = ParameterEventQueue; // hack, TODO fix this! 20 | #endif 21 | using ServiceNotificationQueue = EventQueue>; 22 | 23 | using MidiEventQueue = EventQueue>; 24 | 25 | } // namespace RNBO 26 | 27 | #endif // _RNBO_ParameterEventQueue_h 28 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_ParameterInterfaceAsync.h: -------------------------------------------------------------------------------- 1 | // 2 | // ParameterInterface.h 3 | // 4 | // Created by Stefan Brunner on 12.08.15. 5 | // 6 | // 7 | 8 | #ifndef RNBOPlugin_ParameterInterfaceAsync_h 9 | #define RNBOPlugin_ParameterInterfaceAsync_h 10 | 11 | #include "RNBO_EventVariant.h" 12 | #include "RNBO_EventList.h" 13 | #include "RNBO_ParameterEventInterface.h" 14 | 15 | namespace RNBO { 16 | 17 | class Engine; 18 | using ParameterEventInterfaceImplPtr = std::shared_ptr; 19 | 20 | /** 21 | * @private 22 | */ 23 | class ParameterInterfaceAsync : public ParameterEventInterface 24 | { 25 | public: 26 | 27 | // DO NOT construct a parameter interface directly - use Engine::createParameterInterface instead 28 | ParameterInterfaceAsync(Engine& engine, EventHandler* handler, ParameterEventInterface::Type type); 29 | ~ParameterInterfaceAsync() override; 30 | 31 | ParameterIndex getNumParameters() const override; 32 | void getParameterInfo(ParameterIndex index, ParameterInfo* info) const override; 33 | ConstCharPointer getParameterName(ParameterIndex index) const override; 34 | ConstCharPointer getParameterId(ParameterIndex index) const override; 35 | 36 | ParameterValue getParameterValue(ParameterIndex index) override; 37 | void setParameterValue(ParameterIndex index, ParameterValue value, MillisecondTime time = RNBOTimeNow) override; 38 | 39 | ParameterValue convertToNormalizedParameterValue(ParameterIndex index, ParameterValue value) const override; 40 | ParameterValue convertFromNormalizedParameterValue(ParameterIndex index, ParameterValue normalizedValue) const override; 41 | ParameterValue constrainParameterValue(ParameterIndex index, ParameterValue value) const override; 42 | 43 | void scheduleEvent(EventVariant event) override; 44 | 45 | void drainEvents() override; 46 | 47 | private: 48 | 49 | ParameterEventInterfaceImplPtr _impl; 50 | }; 51 | } // namespace RNBO 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_PatcherFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_PatcherFactory.cpp 3 | // 4 | // Created by DDZ on 11/08/15. 5 | // 6 | // 7 | 8 | #ifndef USE_DYNAMIC_COMPILATION 9 | 10 | #ifdef RNBO_TEST_FILE 11 | // this includes the test file directly when we are not using dynamic compilation 12 | 13 | #include RNBO_TEST_FILE 14 | 15 | #endif 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_PlatformInterfaceImpl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PlatformInterfaceImpl.cpp 3 | // 4 | // Created by Rob Sussman on May 20, 2016 5 | // 6 | // 7 | 8 | #include "platforms/stdlib//RNBO_PlatformInterfaceStdLib.h" 9 | 10 | namespace RNBO { 11 | static PlatformInterfaceStdLib platformInstance; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_PresetList.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_PresetList.cpp 3 | // RNBO 4 | // 5 | // Created by Samuel Tarakajian on 11/9/20. 6 | // 7 | 8 | #if !(defined(RNBO_NOPRESETS) || defined(RNBO_NOJSONPRESETS)) 9 | 10 | #include "RNBO_PresetList.h" 11 | 12 | namespace RNBO { 13 | 14 | PresetList::PresetList(std::string jsonString): 15 | _parsedPresets() 16 | { 17 | convertJSONArrayToPresetList(jsonString, _parsedPresets); 18 | } 19 | PresetList::~PresetList() {} 20 | 21 | size_t PresetList::size() 22 | { 23 | return _parsedPresets.size(); 24 | } 25 | 26 | UniquePresetPtr PresetList::presetAtIndex(size_t index) 27 | { 28 | UniquePresetPtr preset = make_unique(); 29 | PresetPtr srcPreset = _parsedPresets[index]->preset; 30 | copyPreset(*srcPreset, *preset); 31 | return preset; 32 | } 33 | 34 | std::string PresetList::presetNameAtIndex(size_t index) 35 | { 36 | std::string name = _parsedPresets[index]->name; 37 | return name; 38 | } 39 | 40 | UniquePresetPtr PresetList::presetWithName(std::string name) 41 | { 42 | for (size_t i = 0; i < _parsedPresets.size(); i++) { 43 | std::shared_ptr entry = _parsedPresets[i]; 44 | if (entry->name == name) { 45 | UniquePresetPtr preset = make_unique(); 46 | PresetPtr srcPreset = entry->preset; 47 | copyPreset(*srcPreset, *preset); 48 | return preset; 49 | } 50 | } 51 | 52 | return nullptr; 53 | } 54 | } 55 | 56 | #endif /* RNBO_NOPRESETS */ 57 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_PresetList.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_PresetList.h 3 | // RNBO 4 | // 5 | // Created by Samuel Tarakajian on 11/9/20. 6 | // 7 | 8 | #ifndef RNBO_PresetList_h 9 | #define RNBO_PresetList_h 10 | 11 | #include "RNBO_Presets.h" 12 | 13 | #if !(defined(RNBO_NOPRESETS) || defined(RNBO_NOJSONPRESETS)) 14 | 15 | 16 | namespace RNBO { 17 | class PresetList { 18 | public: 19 | PresetList(std::string jsonString); 20 | ~PresetList(); 21 | 22 | size_t size(); 23 | 24 | UniquePresetPtr presetAtIndex(size_t index); 25 | 26 | std::string presetNameAtIndex(size_t index); 27 | 28 | UniquePresetPtr presetWithName(std::string name); 29 | 30 | private: 31 | std::vector> _parsedPresets; 32 | }; 33 | } 34 | 35 | #endif /* RNBO_NOPRESETS */ 36 | 37 | #endif /* RNBO_PresetList_h */ 38 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_ServiceNotification.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_ServiceEvent.h 3 | // 4 | // Created by Stefan Brunner on 9/21/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_ServiceEvent_H_ 9 | #define _RNBO_ServiceEvent_H_ 10 | 11 | #include "RNBO_Types.h" 12 | 13 | namespace RNBO { 14 | 15 | // an event representing service message on our dedicated serive queue, note that it does NOT impement getTime() 16 | // so it cannot be used inside an EventVariant 17 | using ServiceNotificationPayload = void*; 18 | 19 | /** 20 | * @private 21 | */ 22 | class ServiceNotification { 23 | public: 24 | 25 | enum ServiceNotificationType 26 | { 27 | ServiceNotificationUndefined, 28 | ParameterInterfaceCreated, 29 | ParameterInterfaceDeleted 30 | }; 31 | 32 | ServiceNotification(const ServiceNotification& other) = default; 33 | ServiceNotification& operator = (const ServiceNotification& other) = default; 34 | 35 | ServiceNotification() 36 | : _type(ServiceNotificationUndefined) 37 | , _payload(nullptr) 38 | { 39 | } 40 | 41 | ServiceNotification(ServiceNotificationType serviceType, ServiceNotificationPayload payload) 42 | : _type(serviceType) 43 | , _payload(payload) 44 | { 45 | } 46 | 47 | bool operator==(const ServiceNotification& rhs) const 48 | { 49 | return rhs.getType() == getType() 50 | && rhs.getPayload() == getPayload(); 51 | } 52 | 53 | ServiceNotificationType getType() const { return _type; } 54 | ServiceNotificationPayload getPayload() const { return _payload; } 55 | 56 | // debugging 57 | void dumpEvent() const { fprintf(stdout, "ServiceNotification: type=%d payload=%payload\n", _type, _payload); } 58 | 59 | private: 60 | 61 | ServiceNotificationType _type; 62 | ServiceNotificationPayload _payload; 63 | 64 | }; 65 | 66 | } // namespace RNBO 67 | 68 | #endif // #ifndef _RNBO_ServiceEvent_H_ 69 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_StartupEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_StartupEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_StartupEvent_H_ 7 | #define _RNBO_StartupEvent_H_ 8 | 9 | #include 10 | 11 | #include "RNBO_Types.h" 12 | #include "RNBO_List.h" 13 | #include "RNBO_PlatformInterface.h" 14 | #include "RNBO_Logger.h" 15 | #include "RNBO_Debug.h" 16 | #include "RNBO_Presets.h" 17 | 18 | namespace RNBO { 19 | 20 | class PatcherEventTarget; 21 | 22 | /** 23 | * An event representing startup 24 | */ 25 | class StartupEvent { 26 | 27 | public: 28 | 29 | enum Type { 30 | Invalid = -1, 31 | Begin = 0, 32 | End, 33 | Max_Type 34 | }; 35 | 36 | 37 | StartupEvent() 38 | : _eventTime(0) 39 | , _type(Invalid) 40 | { 41 | } 42 | 43 | ~StartupEvent() 44 | { 45 | } 46 | 47 | StartupEvent(MillisecondTime eventTime, StartupEvent::Type type) 48 | : _eventTime(eventTime) 49 | , _type(type) 50 | { 51 | } 52 | 53 | StartupEvent(const StartupEvent& other) 54 | : _eventTime(other._eventTime) 55 | { 56 | _type = other._type; 57 | } 58 | 59 | StartupEvent(StartupEvent&& other) 60 | : _eventTime(other._eventTime) 61 | { 62 | _type = other._type; 63 | } 64 | 65 | StartupEvent& operator = (const StartupEvent& other) 66 | { 67 | _eventTime = other._eventTime; 68 | _type = other._type; 69 | 70 | return *this; 71 | } 72 | 73 | bool operator==(const StartupEvent& rhs) const 74 | { 75 | return rhs.getTime() == getTime() 76 | && rhs.getType() == getType(); 77 | } 78 | 79 | StartupEvent::Type getType() const { return _type; } 80 | MillisecondTime getTime() const { return _eventTime; } 81 | 82 | // we will always use the default event target (the top level patcher) 83 | PatcherEventTarget* getEventTarget() const { return nullptr; } 84 | 85 | // debugging 86 | void dumpEvent() const { 87 | // disabling for now to avoid requiring fprintf support in generated code 88 | // fprintf(stdout, "StartupEvent: time=%.3f type=%d", _eventTime, _type); 89 | } 90 | 91 | protected: 92 | 93 | MillisecondTime _eventTime; 94 | StartupEvent::Type _type = Invalid; 95 | 96 | friend class EventVariant; 97 | 98 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 99 | }; 100 | 101 | } // namespace RNBO 102 | 103 | 104 | #endif // #ifndef _RNBO_StartupEvent_H_ 105 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_TempoEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_TempoEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_TempoEvent_H_ 7 | #define _RNBO_TempoEvent_H_ 8 | 9 | #include "RNBO_Types.h" 10 | 11 | namespace RNBO { 12 | 13 | class PatcherEventTarget; 14 | 15 | /** 16 | * A tempo event 17 | */ 18 | class TempoEvent { 19 | 20 | public: 21 | 22 | TempoEvent() 23 | : _eventTime(0) 24 | , _tempo(-1) 25 | { 26 | } 27 | 28 | ~TempoEvent() 29 | { 30 | } 31 | 32 | TempoEvent( 33 | MillisecondTime eventTime, 34 | Tempo tempo 35 | ) 36 | : _eventTime(eventTime) 37 | , _tempo(tempo) 38 | { 39 | } 40 | 41 | TempoEvent(const TempoEvent& other) 42 | : _eventTime(other._eventTime) 43 | { 44 | _tempo = other._tempo; 45 | } 46 | 47 | TempoEvent(TempoEvent&& other) 48 | : _eventTime(other._eventTime) 49 | { 50 | _tempo = other._tempo; 51 | } 52 | 53 | TempoEvent& operator = (const TempoEvent& other) 54 | { 55 | _eventTime = other._eventTime; 56 | _tempo = other._tempo; 57 | 58 | return *this; 59 | } 60 | 61 | bool operator==(const TempoEvent& rhs) const 62 | { 63 | return rhs.getTime() == getTime() && rhs.getTempo() == getTempo(); 64 | } 65 | 66 | MillisecondTime getTime() const { return _eventTime; } 67 | Tempo getTempo() const { return _tempo; } 68 | 69 | // we will always use the default event target (the top level patcher) 70 | PatcherEventTarget* getEventTarget() const { return nullptr; } 71 | 72 | // debugging 73 | void dumpEvent() const { 74 | // disabling for now to avoid requiring fprintf support in generated code 75 | // fprintf(stdout, "TempoEvent: time=%.3f tempo=%d", _eventTime, _tempo); 76 | } 77 | 78 | protected: 79 | 80 | MillisecondTime _eventTime; 81 | Tempo _tempo; 82 | 83 | friend class EventVariant; 84 | 85 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 86 | }; 87 | 88 | } // namespace RNBO 89 | 90 | #endif // #ifndef _RNBO_TempoEvent_H_ 91 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_TransportEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_TransportEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_TransportEvent_H_ 7 | #define _RNBO_TransportEvent_H_ 8 | 9 | #include "RNBO_Types.h" 10 | 11 | namespace RNBO { 12 | 13 | class PatcherEventTarget; 14 | 15 | /** 16 | * An event representing stopping or starting the transport 17 | */ 18 | class TransportEvent { 19 | 20 | public: 21 | 22 | TransportEvent() 23 | : _eventTime(0) 24 | , _state(STOPPED) 25 | { 26 | } 27 | 28 | ~TransportEvent() 29 | { 30 | } 31 | 32 | TransportEvent( 33 | MillisecondTime eventTime, 34 | TransportState state 35 | ) 36 | : _eventTime(eventTime) 37 | , _state(state) 38 | { 39 | } 40 | 41 | TransportEvent(const TransportEvent& other) 42 | : _eventTime(other._eventTime) 43 | { 44 | _state = other._state; 45 | } 46 | 47 | TransportEvent(TransportEvent&& other) 48 | : _eventTime(other._eventTime) 49 | { 50 | _state = other._state; 51 | } 52 | 53 | TransportEvent& operator = (const TransportEvent& other) 54 | { 55 | _eventTime = other._eventTime; 56 | _state = other._state; 57 | 58 | return *this; 59 | } 60 | 61 | bool operator==(const TransportEvent& rhs) const 62 | { 63 | return rhs.getTime() == getTime() && rhs.getState() == getState(); 64 | } 65 | 66 | MillisecondTime getTime() const { return _eventTime; } 67 | TransportState getState() const { return _state; } 68 | 69 | // we will always use the default event target (the top level patcher) 70 | PatcherEventTarget* getEventTarget() const { return nullptr; } 71 | 72 | // debugging 73 | void dumpEvent() const { 74 | // disabling for now to avoid requiring fprintf support in generated code 75 | // fprintf(stdout, "TransportEvent: time=%.3f state=%d", _eventTime, _state); 76 | } 77 | 78 | protected: 79 | 80 | MillisecondTime _eventTime; 81 | TransportState _state; 82 | 83 | friend class EventVariant; 84 | 85 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 86 | }; 87 | 88 | } // namespace RNBO 89 | 90 | #endif // #ifndef _RNBO_TransportEvent_H_ 91 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_UnitTests.cpp: -------------------------------------------------------------------------------- 1 | //a place for for small misc tests 2 | 3 | #ifdef C74_UNIT_TESTS 4 | 5 | #include "RNBO.h" 6 | #include 7 | #include 8 | 9 | namespace RNBOUnitTests { 10 | using namespace RNBO; 11 | class ArrayTests : public UnitTest { 12 | public: 13 | ArrayTests() 14 | : UnitTest("Array Tests") 15 | {} 16 | void runTest() override { 17 | beginTest("bounds"); 18 | RNBO::array l = { 1.0 }; 19 | expectDoesNotThrow(l[0]); 20 | expectThrowsType(l[1], std::out_of_range); 21 | expectThrowsType(l[100], std::out_of_range); 22 | } 23 | }; 24 | ArrayTests tests; 25 | } 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_UnitTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_UnitTests.h 3 | // binding 4 | // 5 | // Created by Stefan Brunner on 27.08.15. 6 | // 7 | // 8 | 9 | #ifndef binding_RNBO_UnitTests_h 10 | #define binding_RNBO_UnitTests_h 11 | 12 | // for now we only want to compile unit tests in the debug version 13 | // the general idea is, that if you want unit tests, you inlcude this file BEFORE including 14 | // RNBO.h, this will define C74_UNIT_TESTS and therefore comoile the unit tests 15 | 16 | // generally running unit tests needs Juce for now, so be aware that your project has to be prepared to use Juce 17 | 18 | #if defined(DEBUG) && !defined(C74_UNIT_TESTS) 19 | #define C74_UNIT_TESTS 20 | #endif 21 | 22 | #ifdef C74_UNIT_TESTS 23 | 24 | #include "JuceHeader.h" 25 | 26 | namespace RNBO { 27 | 28 | class UnitTestRunner : public juce::UnitTestRunner 29 | { 30 | // no modifications needed for now 31 | }; 32 | 33 | } 34 | 35 | #endif // C74_UNIT_TESTS 36 | 37 | 38 | #endif // binding_RNBO_UnitTests_h 39 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/RNBO_Utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_Utils.h 3 | // 4 | // Created by Rob Sussman on 8/4/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_Utils_H_ 9 | #define _RNBO_Utils_H_ 10 | 11 | #include 12 | 13 | namespace RNBO { 14 | 15 | // implementation of make_unique() 16 | // taken from: https://isocpp.org/files/papers/N3656.txt 17 | // linked to from: http://stackoverflow.com/questions/7038357/make-unique-and-perfect-forwarding 18 | 19 | /** 20 | * @private 21 | */ 22 | template struct _Unique_if { 23 | typedef std::unique_ptr _Single_object; 24 | }; 25 | 26 | /** 27 | * @private 28 | */ 29 | template struct _Unique_if { 30 | typedef std::unique_ptr _Unknown_bound; 31 | }; 32 | 33 | /** 34 | * @private 35 | */ 36 | template struct _Unique_if { 37 | typedef void _Known_bound; 38 | }; 39 | 40 | /** 41 | * @private 42 | */ 43 | template 44 | typename _Unique_if::_Single_object 45 | make_unique(Args&&... args) { 46 | return std::unique_ptr(new T(std::forward(args)...)); 47 | } 48 | 49 | /** 50 | * @private 51 | */ 52 | template 53 | typename _Unique_if::_Unknown_bound 54 | make_unique(size_t n) { 55 | typedef typename std::remove_extent::type U; 56 | return std::unique_ptr(new U[n]()); 57 | } 58 | 59 | template 60 | typename _Unique_if::_Known_bound 61 | make_unique(Args&&...) = delete; 62 | 63 | 64 | // helper template prevents single-argument universal-reference constructor from acting like the copy constructor 65 | // see: http://ericniebler.com/2013/08/07/universal-references-and-the-copy-constructo/ 66 | template 67 | using disable_if_same_or_derived = 68 | typename std::enable_if::type>::value>::type; 69 | 70 | 71 | } // namespace RNBO 72 | 73 | 74 | #endif // #ifndef _RNBO_Utils_H_ 75 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/src/platforms/nostdlib/RNBO_LoggerNoStdLib.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_LoggerNoStdLib.cpp 3 | // Created: 12 July 2016 2:42:32pm 4 | // Author: jb 5 | // 6 | // 7 | 8 | #include "RNBO_Common.h" 9 | 10 | namespace RNBO { 11 | 12 | Logger consoleInstance; 13 | LoggerInterface* console = &consoleInstance; 14 | 15 | Logger::Logger() 16 | : _outputCallback(&Logger::defaultLogOutputFunction) 17 | { 18 | } 19 | 20 | Logger::~Logger() 21 | { 22 | } 23 | 24 | void Logger::setLoggerOutputCallback(OutputCallback* callback) 25 | { 26 | _outputCallback = callback ? callback : defaultLogOutputFunction; 27 | } 28 | 29 | void Logger::defaultLogOutputFunction(LogLevel level, const char* message) 30 | { 31 | const static char* levelStr[] = { "[INFO]", "[WARNING]", "[ERROR]" }; 32 | String formattedMessage = levelStr[level]; 33 | formattedMessage += "\t"; 34 | formattedMessage += message; 35 | formattedMessage += "\n"; 36 | platform->printMessage(formattedMessage.c_str()); 37 | } 38 | 39 | Logger& Logger::getInstance() 40 | { 41 | return consoleInstance; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "RNBO_UnitTests.h" 3 | #include "RNBO.h" 4 | #include "RNBO_MidiStreamParser.h" 5 | 6 | int main (int /*argc*/, char** /*argv*/) 7 | { 8 | RNBO::UnitTestRunner runner; 9 | runner.runAllTests(); 10 | for (auto i = 0; i < runner.getNumResults(); i++) { 11 | auto res = runner.getResult(i); 12 | if (res == nullptr || res->failures > 0) { 13 | return -1; 14 | } 15 | } 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /rnbo-command-line/export/rnbo/version.cmake: -------------------------------------------------------------------------------- 1 | #automatically generated 2 | SET(RNBO_VERSION_MAJOR 1) 3 | SET(RNBO_VERSION_MINOR 0) 4 | SET(RNBO_VERSION_PATCH 1) 5 | SET(RNBO_VERSION_PRERELEASE "null") 6 | SET(RNBO_VERSION "1.0.1") 7 | -------------------------------------------------------------------------------- /rnbo-command-line/src-finish/.gitignore: -------------------------------------------------------------------------------- 1 | libsndfile-1.0.28 2 | build 3 | cherokee-out.aif 4 | RNBOCommandLine 5 | export/rnbo 6 | export/dependencies.json 7 | export/am-mod.cpp 8 | export/description.json 9 | export/presets.json 10 | 11 | -------------------------------------------------------------------------------- /rnbo-command-line/src-finish/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | # Set the C++ standard to at least C++11, which is needed for RNBO 4 | set (CMAKE_CXX_STANDARD 11) 5 | 6 | # set the project name 7 | project(RNBOCommandLine) 8 | 9 | # add the main executable as well as the RNBO sources 10 | add_executable(RNBOCommandLine main.cpp export/rnbo.pitchshifter.cpp export/rnbo/RNBO.cpp) 11 | 12 | # add a preprocessor macro to disable the convenience definition of the global patcher factory 13 | # target_compile_definitions(RNBOCommandLine PRIVATE RNBO_NO_PATCHERFACTORY) 14 | 15 | # needed to compile and run on os x 16 | find_library(CORE_FOUNDATION Foundation) 17 | find_library(APPLICATION_SERVICES ApplicationServices) 18 | find_library(CORE_SERVICES CoreServices) 19 | 20 | # include the headers and library files for sndlib, to decode wav 21 | include(FetchContent) 22 | 23 | FetchContent_Declare( 24 | libsndfile 25 | GIT_REPOSITORY https://github.com/libsndfile/libsndfile 26 | GIT_TAG ea3ac90e98c6a98cd52cae39010446fba368a2e3 27 | ) 28 | FetchContent_MakeAvailable(libsndfile) 29 | 30 | target_link_libraries(RNBOCommandLine PUBLIC SndFile::sndfile) 31 | 32 | set(EXTRA_LIBS ${CORE_FOUNDATION} ${APPLICATION_SERVICES} ${CORE_SERVICES}) 33 | 34 | # include the RNBO headers 35 | target_include_directories(RNBOCommandLine PRIVATE export/rnbo export/rnbo/common) 36 | 37 | # Copy the executable up one level 38 | add_custom_command(TARGET RNBOCommandLine 39 | POST_BUILD 40 | COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}) 41 | -------------------------------------------------------------------------------- /rnbo-command-line/src-finish/cherokee.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/rnbo-adc-workshop/6bb30058d47eef1e06beec350966805d2d18b593/rnbo-command-line/src-finish/cherokee.aif -------------------------------------------------------------------------------- /rnbo-command-line/src-finish/export/README.md: -------------------------------------------------------------------------------- 1 | Export your audio processing patch here -------------------------------------------------------------------------------- /rnbo-command-line/src/.gitignore: -------------------------------------------------------------------------------- 1 | libsndfile-1.0.28 2 | build 3 | rnbo 4 | anton-out.aif 5 | dependencies.json 6 | am-mod.cpp 7 | description.json 8 | presets.json 9 | RNBOCommandLine 10 | cherokee-out.aif 11 | -------------------------------------------------------------------------------- /rnbo-command-line/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | # Set the C++ standard to at least C++11, which is needed for RNBO 4 | set (CMAKE_CXX_STANDARD 11) 5 | 6 | # set the project name 7 | project(RNBOCommandLine) 8 | 9 | # add the main executable as well as the RNBO sources 10 | add_executable(RNBOCommandLine main.cpp export/am-mod.cpp export/rnbo/RNBO.cpp) 11 | 12 | # add a preprocessor macro to disable the convenience definition of the global patcher factory 13 | # target_compile_definitions(RNBOCommandLine PRIVATE RNBO_NO_PATCHERFACTORY) 14 | 15 | # needed to compile and run on os x 16 | find_library(CORE_FOUNDATION Foundation) 17 | find_library(APPLICATION_SERVICES ApplicationServices) 18 | find_library(CORE_SERVICES CoreServices) 19 | 20 | # include the headers and library files for sndlib, to decode wav 21 | include(FetchContent) 22 | 23 | FetchContent_Declare( 24 | libsndfile 25 | GIT_REPOSITORY https://github.com/libsndfile/libsndfile 26 | GIT_TAG ea3ac90e98c6a98cd52cae39010446fba368a2e3 27 | ) 28 | FetchContent_MakeAvailable(libsndfile) 29 | 30 | target_link_libraries(RNBOCommandLine PUBLIC SndFile::sndfile) 31 | 32 | set(EXTRA_LIBS ${CORE_FOUNDATION} ${APPLICATION_SERVICES} ${CORE_SERVICES}) 33 | 34 | # include the RNBO headers 35 | target_include_directories(RNBOCommandLine PRIVATE export/rnbo export/rnbo/common) 36 | 37 | # Copy the executable up one level 38 | add_custom_command(TARGET RNBOCommandLine 39 | POST_BUILD 40 | COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_SOURCE_DIR}) 41 | -------------------------------------------------------------------------------- /rnbo-command-line/src/cherokee.aif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/rnbo-adc-workshop/6bb30058d47eef1e06beec350966805d2d18b593/rnbo-command-line/src/cherokee.aif -------------------------------------------------------------------------------- /rnbo-command-line/src/export/README.md: -------------------------------------------------------------------------------- 1 | Export your audio processing patch here -------------------------------------------------------------------------------- /rnbo-custom-vst/export/README.md: -------------------------------------------------------------------------------- 1 | You can find pre-exported stuff in here. 2 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/dependencies.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | docs 3 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Cycling '74 2 | 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the 6 | "Software"), to deal in the Software without restriction, including 7 | without limitation the rights to use, copy, modify, merge, publish, 8 | distribute, sublicense, and/or sell copies of the Software, and to 9 | permit persons to whom the Software is furnished to do so, subject to 10 | the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/RNBO.cpp: -------------------------------------------------------------------------------- 1 | // rnbo_lib.cpp includes all the source files for RNBO 2 | // making it easy to include RNBO as source into a project. 3 | // Simply add this one file to your compilation. 4 | 5 | #include "RNBO.h" 6 | 7 | #include "src/RNBO_PlatformInterfaceImpl.cpp" // comes first to ensure that platform is available 8 | #include "src/RNBO_CoreObject.cpp" 9 | #include "src/RNBO_DataBuffer.cpp" 10 | #include "src/RNBO_DataRefList.cpp" 11 | #include "src/RNBO_DynamicPatcherFactory.cpp" 12 | #include "src/RNBO_Engine.cpp" 13 | #include "src/RNBO_ExternalLoader.cpp" 14 | #include "src/RNBO_FileChangeWatcher.cpp" 15 | #include "src/RNBO_Logger.cpp" 16 | #include "src/RNBO_MaxClang.cpp" 17 | #include "src/RNBO_ParameterInterfaceAsync.cpp" 18 | #include "src/RNBO_ParameterInterfaceSync.cpp" 19 | #include "src/RNBO_PatcherFactory.cpp" 20 | #include "src/RNBO_PatcherState.cpp" 21 | #include "src/RNBO_PresetList.cpp" 22 | #include "src/RNBO_List.cpp" 23 | #include "src/RNBO_UnitTests.cpp" 24 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/RNBO.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO.h 3 | // 4 | // Created by Rob Sussman on 8/4/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_H_ 9 | #define _RNBO_H_ 10 | 11 | #include "src/RNBO_Config.h" 12 | #include "common/RNBO_Types.h" 13 | #include "common/RNBO_ParameterInterface.h" 14 | #include "common/RNBO_BaseInterface.h" 15 | #include "common/RNBO_PatcherFactory.h" 16 | #include "src/RNBO_ParameterEvent.h" 17 | #include "src/RNBO_MidiEvent.h" 18 | #include "src/RNBO_DynamicSymbolRegistry.h" 19 | #include "src/RNBO_CoreObject.h" 20 | 21 | #endif // #ifndef _RNBO_H_ 22 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/RNBO_JuceAudioProcessorEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | RNBO_JuceAudioProcessorEditor.h 5 | Created: 21 Sep 2015 11:50:17am 6 | Author: stb 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #ifndef RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 12 | #define RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 13 | 14 | #include "JuceHeader.h" 15 | #include "RNBO.h" 16 | 17 | namespace RNBO { 18 | 19 | //============================================================================== 20 | /** 21 | 22 | this is mostly a copy of a Juce GenericAudioProcessorEditor, with the important 23 | difference that it can be refreshed via a ParameterInterfacHandle 24 | 25 | */ 26 | class RNBOAudioProcessorEditor : public AudioProcessorEditor, public AsyncUpdater, public RNBO::EventHandler 27 | { 28 | public: 29 | //============================================================================== 30 | RNBOAudioProcessorEditor (AudioProcessor* owner, CoreObject& rnboObject); 31 | ~RNBOAudioProcessorEditor() override; 32 | 33 | //============================================================================== 34 | void paint (Graphics&) override; 35 | void resized() override; 36 | 37 | void handleAsyncUpdate() override; 38 | 39 | void eventsAvailable() override; 40 | void handleParameterEvent(const RNBO::ParameterEvent& event) override; 41 | void handlePresetEvent(const RNBO::PresetEvent& event) override; 42 | 43 | private: 44 | 45 | void updateAllParams(); 46 | 47 | //============================================================================== 48 | PropertyPanel _panel; 49 | CoreObject& _rnboObject; 50 | ParameterEventInterfaceUniquePtr _parameterInterface; 51 | 52 | Array _params; 53 | Array _presetChooserComponents; 54 | }; 55 | 56 | } // namespace RNBO 57 | 58 | #endif // RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 59 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/staticplugin/AUInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${MACOSX_BUNDLE_BUNDLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 12 | CFBundleName 13 | ${MACOSX_BUNDLE_BUNDLE_NAME} 14 | CFBundleDisplayName 15 | ${MACOSX_BUNDLE_BUNDLE_NAME} 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 22 | CFBundleVersion 23 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 24 | NSHumanReadableCopyright 25 | ${MACOSX_BUNDLE_COPYRIGHT} 26 | NSHighResolutionCapable 27 | 28 | AudioComponents 29 | 30 | 31 | name 32 | ${PLUGIN_MANUFACTURER_NAME}: ${PLUGIN_NAME} 33 | description 34 | ${PLUGIN_NAME} 35 | factoryFunction 36 | RNBO_Plugin_AUFactory 37 | manufacturer 38 | ${PLUGIN_MANUFACTURER_CODE} 39 | type 40 | ${AU_PLUGIN_TYPE} 41 | subtype 42 | ${PLUGIN_CODE} 43 | version 44 | 1 45 | resourceUsage 46 | 47 | network.client 48 | 49 | temporary-exception.files.all.read-write 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/staticplugin/PkgInfo: -------------------------------------------------------------------------------- 1 | BNDL???? -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/staticplugin/UnityInfo.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${MACOSX_BUNDLE_BUNDLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 12 | CFBundleName 13 | ${MACOSX_BUNDLE_BUNDLE_NAME} 14 | CFBundleDisplayName 15 | ${MACOSX_BUNDLE_BUNDLE_NAME} 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 22 | CFBundleVersion 23 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 24 | NSHumanReadableCopyright 25 | ${MACOSX_BUNDLE_COPYRIGHT} 26 | NSHighResolutionCapable 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/staticplugin/VST3Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleExecutable 7 | ${MACOSX_BUNDLE_BUNDLE_NAME} 8 | CFBundleIconFile 9 | 10 | CFBundleIdentifier 11 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 12 | CFBundleName 13 | ${MACOSX_BUNDLE_BUNDLE_NAME} 14 | CFBundleDisplayName 15 | ${MACOSX_BUNDLE_BUNDLE_NAME} 16 | CFBundlePackageType 17 | BNDL 18 | CFBundleSignature 19 | ???? 20 | CFBundleShortVersionString 21 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 22 | CFBundleVersion 23 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 24 | NSHumanReadableCopyright 25 | ${MACOSX_BUNDLE_COPYRIGHT} 26 | NSHighResolutionCapable 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/staticplugin/au.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | //Audio Units entrypoint/factory 3 | 4 | //https://developer.apple.com/documentation/coreservices/componentresult 5 | typedef int32_t ComponentResult; 6 | 7 | extern "C" ComponentResult StaticAUExportEntry(void * params, void* obj); 8 | extern "C" void* StaticAUExportFactory(const void * desc); 9 | 10 | #define COMPONENT_ENTRYX(Name, Suffix) \ 11 | extern "C" __attribute__((visibility("default"))) ComponentResult Name ## Suffix (void* params, void* obj); \ 12 | extern "C" __attribute__((visibility("default"))) ComponentResult Name ## Suffix (void* params, void* obj) \ 13 | { \ 14 | return StaticAUExportEntry(params, obj); \ 15 | } 16 | 17 | #define FACTORY_ENTRYX(Name) \ 18 | extern "C" __attribute__((visibility("default"))) void* Name ## Factory (const void* desc); \ 19 | extern "C" __attribute__((visibility("default"))) void* Name ## Factory (const void* desc) \ 20 | { \ 21 | return StaticAUExportFactory(desc); \ 22 | } 23 | 24 | #define COMPONENT_ENTRY(Name, Suffix) COMPONENT_ENTRYX(Name, Suffix) 25 | #define FACTORY_ENTRY(Name) FACTORY_ENTRYX(Name) 26 | 27 | COMPONENT_ENTRY (RNBO_Plugin_AU, Entry) 28 | FACTORY_ENTRY (RNBO_Plugin_AU) 29 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/staticplugin/common.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" { 4 | const char * JuceStatic_Plugin_Name() { 5 | return PLUGIN_NAME; 6 | } 7 | uint32_t JuceStatic_Plugin_Code() { 8 | return PLUGIN_CODE_HEX; 9 | } 10 | uint32_t JuceStatic_Plugin_VersionCode() { 11 | return PLUGIN_VERSION_NUM; 12 | } 13 | const char * JuceStatic_Plugin_VersionString() { 14 | return PLUGIN_VERSION; 15 | } 16 | 17 | const char * JuceStatic_Plugin_Manufacturer() { 18 | return PLUGIN_MANUFACTURER_NAME; 19 | } 20 | const char * JuceStatic_Plugin_ManufacturerWebsite() { 21 | return PLUGIN_MANUFACTURER_WEBSITE; 22 | } 23 | const char * JuceStatic_Plugin_ManufacturerEmail() { 24 | return PLUGIN_MANUFACTURER_EMAIL; 25 | } 26 | uint32_t JuceStatic_Plugin_ManufacturerCode() { 27 | return PLUGIN_MANUFACTURER_CODE_HEX; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/staticplugin/unity.cpp: -------------------------------------------------------------------------------- 1 | #define UNITY_INTERFACE_EXPORT __attribute__ ((visibility("default"))) 2 | #define UNITY_INTERFACE_API 3 | 4 | //forward decl 5 | extern "C" int UNITY_INTERFACE_API JuceStatic_UnityGetAudioEffectDefinitions (void*** definitionsPtr); 6 | 7 | //entrypoint trampoline to JUCE 8 | extern "C" UNITY_INTERFACE_EXPORT int UNITY_INTERFACE_API UnityGetAudioEffectDefinitions (void*** definitionsPtr) 9 | { 10 | return JuceStatic_UnityGetAudioEffectDefinitions(definitionsPtr); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/juce/staticplugin/vst3.cpp: -------------------------------------------------------------------------------- 1 | //grabed/edited from the VST3 SDK 2 | //https://github.com/steinbergmedia/vst3_pluginterfaces/blob/b8566ef3b2a0cba60a96e3ef2001224c865c8b36/base/fplatform.h 3 | #if defined (_WIN32) 4 | #define PLUGIN_API __stdcall 5 | #define SMTG_EXPORT_SYMBOL __declspec (dllexport) 6 | #elif __gnu_linux__ || __linux__ 7 | #define PLUGIN_API 8 | #define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default"))) 9 | #elif __APPLE__ 10 | #define PLUGIN_API 11 | #define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default"))) 12 | #else 13 | #pragma error unknown platform 14 | #endif 15 | 16 | //forward decl 17 | class IPluginFactory; 18 | extern "C" IPluginFactory* PLUGIN_API JuceStatic_GetPluginFactory(); 19 | 20 | //VST3 entrypoint 21 | extern "C" SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory() 22 | { 23 | return JuceStatic_GetPluginFactory(); 24 | } 25 | 26 | #include 27 | extern "C" { 28 | uint32_t JuceStatic_Plugin_VSTNumMidiInputs() { 29 | return PLUGIN_NUM_MIDI_INPUTS; 30 | } 31 | uint32_t JuceStatic_Plugin_VSTNumMidiOutputs() { 32 | return PLUGIN_NUM_MIDI_OUTPUTS; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/max/RNBO_MaxPresetAdapter.h: -------------------------------------------------------------------------------- 1 | //forward decl 2 | struct _dictionary; 3 | typedef _dictionary t_dictionary; 4 | 5 | namespace RNBO { 6 | class PatcherState; 7 | class CoreObject; 8 | using Preset = PatcherState; 9 | } 10 | 11 | namespace MaxPresetAdapter { 12 | void toDict(const RNBO::Preset& preset, t_dictionary* presetDict); 13 | void fromDict(t_dictionary* presetDict, RNBO::Preset& preset); 14 | //XXX Note, this will block while waiting for the preset 15 | void getObjectPreset(RNBO::CoreObject& o, t_dictionary *presetDict, bool dspIsOn); 16 | void setObjectPreset(RNBO::CoreObject& o, t_dictionary *presetDict); 17 | } 18 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/adapters/max/rnbo_bufferref.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_BUFFERREF_H 2 | #define _RNBO_BUFFERREF_H 3 | 4 | //RNBO.h seems to have to come first in visual studio or std::numeric_limits<_>::max() breaks.. 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | extern "C" { 13 | // the dataref object which is used for managing all references 14 | // to internal Max buffers that are used by RNBO 15 | typedef struct _rnbo_bufferref { 16 | t_object obj; 17 | t_buffer_ref *r_buffer_ref; 18 | t_symbol *r_name; 19 | float *r_lastKnownAddress; // To determine if memory changed 20 | char r_islocked; 21 | } t_rnbo_bufferref; 22 | 23 | void rnbo_bufferref_register(); 24 | t_rnbo_bufferref *rnbo_bufferref_new(t_symbol *buffername); 25 | void rnbo_bufferref_free(t_rnbo_bufferref *x); 26 | t_max_err rnbo_bufferref_notify(t_rnbo_bufferref *x, t_symbol *s, t_symbol *msg, void *sender, void *data); 27 | float *rnbo_bufferref_lock(t_rnbo_bufferref *x); 28 | char rnbo_bufferref_islocked(t_rnbo_bufferref *x); 29 | void rnbo_bufferref_unlock(t_rnbo_bufferref *x); 30 | void rnbo_bufferref_setdirty(t_rnbo_bufferref *x); 31 | void rnbo_bufferref_setname(t_rnbo_bufferref *x, t_symbol * name); 32 | t_symbol * rnbo_bufferref_getname(t_rnbo_bufferref *x); 33 | void rnbo_bufferref_setlastaddress(t_rnbo_bufferref *x, float *lastAddress); 34 | float *rnbo_bufferref_getlastaddress(t_rnbo_bufferref *x); 35 | bool rnbo_bufferref_buffer_exists(t_rnbo_bufferref *x); 36 | } 37 | 38 | namespace RNBO { 39 | void DataRefBindMaxBuffer( 40 | ExternalDataIndex dataRefIndex, 41 | const ExternalDataRef* ref, 42 | t_rnbo_bufferref *dataref, 43 | UpdateRefCallback updateDataRef, 44 | ReleaseRefCallback releaseDataRef 45 | ); 46 | void DataRefUnbindMaxBuffer( 47 | const ExternalDataRef* externalRef, 48 | t_rnbo_bufferref *dataref 49 | ); 50 | }; 51 | #endif 52 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/cmake/CCache.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | 3 | find_program(CCACHE_PROGRAM ccache) 4 | if (CCACHE_PROGRAM) 5 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") 6 | endif() 7 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/cmake/MinGWSTDThreads.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | 3 | include(${CMAKE_CURRENT_LIST_DIR}/RNBOConan.cmake) 4 | 5 | #use mingw_stdthreads for windows cross compiling to work around need for pthreads otherwise 6 | if (CMAKE_SYSTEM_NAME STREQUAL Windows AND CMAKE_CROSSCOMPILING) 7 | #TODO what if we're using clang? 8 | set(BUILD_SYSTEM_IS_MINGW On) 9 | conan_cmake_configure( 10 | REQUIRES mingw_stdthreads/1.0.1@c74/testing 11 | GENERATORS cmake_paths 12 | ) 13 | conan_cmake_install( 14 | PATH_OR_REFERENCE . 15 | BUILD missing 16 | ) 17 | include(${CMAKE_CURRENT_BINARY_DIR}/conan_paths.cmake) 18 | option(MINGW_STDTHREADS_GENERATE_STDHEADERS "" ON) 19 | add_subdirectory(${CONAN_MINGW_STDTHREADS_ROOT} ${CMAKE_CURRENT_BINARY_DIR}/mingw_stdthreads) 20 | endif() 21 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/cmake/RNBOConan.cmake: -------------------------------------------------------------------------------- 1 | #setup conan, include the module paths, setup the remote 2 | list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_BINARY_DIR}) 3 | list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}) 4 | 5 | include_guard(GLOBAL) 6 | 7 | #cloud compiler might have already included conan 8 | if (NOT COMMAND conan_check) 9 | include(${CMAKE_CURRENT_LIST_DIR}/conan.cmake) 10 | endif() 11 | 12 | conan_check(VERSION 1.29.0 REQUIRED) 13 | conan_add_remote( 14 | NAME cycling-public 15 | INDEX 1 16 | URL https://conan-public.cycling74.com 17 | VERIFY_SSL True 18 | ) 19 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/cmake/RNBODescriptionHeader.cmake: -------------------------------------------------------------------------------- 1 | function(rnbo_write_description_header DESCRIPTION_JSON OUTPUT_DIR) 2 | set(PATCHER_DESCRIPTION_JSON ${DESCRIPTION_JSON}) 3 | configure_file(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/rnbo_description.h.in ${OUTPUT_DIR}/rnbo_description.h) 4 | endfunction() 5 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/cmake/RNBOJuce.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | 3 | set(RNBO_JUCE_VERSION 6.1.2) 4 | 5 | if (RNBO_JUCE_USE_CONAN) 6 | include(${CMAKE_CURRENT_LIST_DIR}/RNBOConan.cmake) 7 | 8 | conan_cmake_configure( 9 | REQUIRES "JUCE/${RNBO_JUCE_VERSION}@c74/testing" 10 | GENERATORS cmake_paths 11 | ) 12 | conan_cmake_autodetect(settings) 13 | conan_cmake_install( 14 | PATH_OR_REFERENCE . 15 | BUILD missing 16 | SETTINGS ${settings} 17 | REMOTE cycling-public 18 | ) 19 | include(${CMAKE_CURRENT_BINARY_DIR}/conan_paths.cmake) 20 | find_package(JUCE ${RNBO_JUCE_VERSION} CONFIG REQUIRED) 21 | else() 22 | add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../../../thirdparty/juce ${CMAKE_BINARY_DIR}/juce) 23 | endif() 24 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/cmake/SCCache.cmake: -------------------------------------------------------------------------------- 1 | include_guard(GLOBAL) 2 | 3 | find_program(SCCACHE_PROGRAM sccache) 4 | if (SCCACHE_PROGRAM) 5 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${SCCACHE_PROGRAM}") 6 | endif() 7 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/cmake/rnbo_description.h.in: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace RNBO { 6 | const nlohmann::json patcher_description = R"RNBOJSON( @PATCHER_DESCRIPTION_JSON@ )RNBOJSON"; 7 | } 8 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_Array.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_TUPLE_H_ 2 | #define _RNBO_TUPLE_H_ 3 | 4 | namespace RNBO { 5 | 6 | /** 7 | * Fixed-size array. Drop-in replacement for std::array, if you're compiling RNBO without stdlib. 8 | */ 9 | template class array { 10 | public: 11 | 12 | template array(Ts ... args) 13 | { 14 | // since allocating an array of 0 length is invalid, we always allocate at least length 1 15 | T values[sizeof...(args) + 1] = {static_cast(args)...}; 16 | for (size_t i = 0; i < sizeof...(args) && i < N; i++) { 17 | _values[i] = values[i]; 18 | } 19 | } 20 | 21 | // copy constructor 22 | array(const array& a) 23 | { 24 | for (size_t i = 0; i < N; i++) { 25 | _values[i] = a._values[i]; 26 | } 27 | } 28 | 29 | array& operator=(const array& a) 30 | { 31 | if (&a != this) { 32 | for (size_t i = 0; i < N; i++) { 33 | _values[i] = a._values[i]; 34 | } 35 | } 36 | return *this; 37 | } 38 | 39 | constexpr size_t size() const { return N; } 40 | constexpr bool empty() const { return size() == 0; } 41 | 42 | T& operator[](size_t n) { 43 | if (n >= N) { 44 | Platform::get()->errorOrDefault(RuntimeError::OutOfRange, "array index out of range", false /*unused*/); 45 | _dummy = static_cast(0); 46 | return _dummy; 47 | } 48 | return _values[n]; 49 | } 50 | const T& operator[](size_t n) const { 51 | if (n >= N) { 52 | Platform::get()->errorOrDefault(RuntimeError::OutOfRange, "array index out of range", false /*unused*/); 53 | return _dummy; 54 | } 55 | return _values[n]; 56 | } 57 | 58 | private: 59 | T _values[N ? N : 1]; 60 | T _dummy = static_cast(0); 61 | }; 62 | 63 | } // namespace RNBO 64 | 65 | #endif // #ifndef _RNBO_TUPLE_H_ 66 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_BaseInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_BASEINTERFACE_H_ 2 | #define _RNBO_BASEINTERFACE_H_ 3 | 4 | #include "RNBO_Types.h" 5 | #include "RNBO_ParameterInterface.h" 6 | 7 | namespace RNBO { 8 | 9 | /** 10 | * Base class for objects which, like CoreObject, expose an interface to exported RNBO code. 11 | */ 12 | class BaseInterface : public ParameterInterface { 13 | 14 | public: 15 | 16 | /** 17 | * Initialize data after construction of the BaseInterface 18 | */ 19 | virtual void initialize() {} 20 | 21 | virtual Index getNumMidiInputPorts() const = 0; 22 | virtual Index getNumMidiOutputPorts() const = 0; 23 | 24 | virtual Index getNumInputChannels() const = 0; 25 | virtual Index getNumOutputChannels() const = 0; 26 | 27 | // methods from ParameterInterface, they are here for documentation only 28 | ParameterIndex getNumParameters() const override = 0; 29 | ConstCharPointer getParameterName(ParameterIndex index) const override = 0; 30 | ConstCharPointer getParameterId(ParameterIndex index) const override = 0; 31 | void getParameterInfo(ParameterIndex index, ParameterInfo* info) const override = 0; 32 | 33 | ParameterValue getParameterValue(ParameterIndex index) override = 0; 34 | void setParameterValue(ParameterIndex index, ParameterValue value, MillisecondTime time = RNBOTimeNow) override = 0; 35 | 36 | protected: 37 | 38 | ~BaseInterface() { } 39 | 40 | }; 41 | 42 | } // namespace RNBO 43 | 44 | #endif // #ifndef _RNBO_BASEINTERFACE_H_ 45 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_Common.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_Common.h 3 | // 4 | // Created by Rob Sussman on 11/11/15. 5 | // 6 | // 7 | 8 | // This file is included by the generated RNBO code 9 | // and is intended to have the minimal amount necessary to get 10 | // the generated code to build with the goal of speeding up 11 | // dynamic compilation via clang/llvm as much as possible. 12 | 13 | #ifndef _RNBO_Common_h 14 | #define _RNBO_Common_h 15 | 16 | #include "RNBO_PlatformInterface.h" 17 | #include "RNBO_Types.h" 18 | #include "RNBO_List.h" 19 | #include "RNBO_ListHelpers.h" 20 | #include "RNBO_Array.h" 21 | #include "RNBO_String.h" 22 | #include "RNBO_Logger.h" 23 | #include "RNBO_DataRef.h" 24 | #include "RNBO_BaseInterface.h" 25 | #include "RNBO_UniquePtr.h" 26 | #include "RNBO_ExternalPtr.h" 27 | #include "RNBO_EngineInterface.h" 28 | #include "RNBO_EventTarget.h" 29 | #include "RNBO_PatcherStateInterface.h" 30 | #include "RNBO_PatcherInterface.h" 31 | #include "RNBO_PatcherInterfaceImpl.h" 32 | #include "RNBO_PatcherFactory.h" 33 | #include "RNBO_MIDIHelper.h" 34 | #include "RNBO_TimeConverter.h" 35 | 36 | #endif // #ifndef _RNBO_Common_h 37 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_CompilerMacros.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef __has_builtin 4 | # define __has_builtin(x) 0 5 | #endif 6 | 7 | #ifndef __has_attribute 8 | # define __has_attribute(x) 0 9 | #endif 10 | 11 | #if !defined(GNUC_PREREQ) 12 | #if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) 13 | #define GNUC_PREREQ(maj, min, patch) \ 14 | ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) + __GNUC_PATCHLEVEL__ >= \ 15 | ((maj) << 20) + ((min) << 10) + (patch)) 16 | #elif defined(__GNUC__) && defined(__GNUC_MINOR__) 17 | #define GNUC_PREREQ(maj, min, patch) \ 18 | ((__GNUC__ << 20) + (__GNUC_MINOR__ << 10) >= ((maj) << 20) + ((min) << 10)) 19 | #else 20 | #define GNUC_PREREQ(maj, min, patch) 0 21 | #endif 22 | #endif 23 | 24 | #if defined(__clang__) 25 | # if defined(__APPLE__) 26 | # define APPLE_CLANG_VERSION __clang_major__ 27 | # define CLANG_VERSION 0 28 | # else 29 | # define APPLE_CLANG_VERSION 0 30 | # define CLANG_VERSION __clang_major__ 31 | # endif 32 | #else 33 | # define APPLE_CLANG_VERSION 0 34 | # define CLANG_VERSION 0 35 | #endif 36 | 37 | // NB: clang/llvm on Windows will define _MSC_VER so be careful 38 | #if defined(_MSC_VER) 39 | #define MSVC_VERSION _MSC_VER 40 | #else 41 | #define MSVC_VERSION 0 42 | #endif 43 | 44 | #if __has_attribute(noinline) || GNUC_PREREQ(3, 4, 0) 45 | #define ATTRIBUTE_NOINLINE __attribute__((noinline)) 46 | #elif defined(_MSC_VER) 47 | #define ATTRIBUTE_NOINLINE __declspec(noinline) 48 | #else 49 | #define ATTRIBUTE_NOINLINE 50 | #endif 51 | 52 | #if __has_attribute(always_inline) || GNUC_PREREQ(4, 0, 0) 53 | #define ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) 54 | #elif defined(_MSC_VER) 55 | #define ATTRIBUTE_ALWAYS_INLINE __forceinline 56 | #else 57 | #define ATTRIBUTE_ALWAYS_INLINE 58 | #endif 59 | 60 | #if __has_attribute(unused) || GNUC_PREREQ(4, 0, 0) 61 | #define ATTRIBUTE_UNUSED __attribute__((unused)) 62 | #elif defined(_MSC_VER) 63 | #define ATTRIBUTE_UNUSED // to suppress warning, wrap code with #pragma warning(disable/default:4505) 64 | #else 65 | #define ATTRIBUTE_UNUSED 66 | #endif 67 | 68 | #undef CLANG_VERSION 69 | #undef MSVC_VERSION 70 | #undef GNUC_PREREQ 71 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_Debug.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_DEBUG_H_ 2 | #define _RNBO_DEBUG_H_ 3 | 4 | #include "RNBO_Logger.h" 5 | 6 | // See https://github.com/scottt/debugbreak/blob/master/debugbreak.h for inspiration 7 | 8 | namespace RNBO { 9 | 10 | #ifndef RNBO_ASSERT 11 | 12 | # if defined(__APPLE__) 13 | 14 | #if defined(__thumb__) 15 | #define RNBODebugBreak __asm__ volatile(".inst 0xde01") 16 | #elif defined(__arm__) 17 | #define RNBODebugBreak __asm__ volatile(".inst 0xe7f001f0") 18 | #elif defined(__aarch64__) 19 | #define RNBODebugBreak __builtin_trap() 20 | #else 21 | #define RNBODebugBreak asm("int3") 22 | #endif 23 | 24 | #elif defined(_MSC_VER) 25 | #define RNBODebugBreak __debugbreak() 26 | #else 27 | #define RNBODebugBreak (0) 28 | #endif 29 | 30 | #define RNBO_STR_HELPER(x) #x 31 | #define RNBO_STR(x) RNBO_STR_HELPER(x) 32 | 33 | #if defined(_DEBUG) || defined(DEBUG) 34 | 35 | #define RNBO_ASSERT(condition) \ 36 | if (!(condition)) { console->log("ASSERTION - failed condition: %s\n", RNBO_STR(condition)); RNBODebugBreak; } 37 | 38 | #define RNBO_DEBUG 1 39 | 40 | #else 41 | #define RNBO_ASSERT(condition) 42 | #endif 43 | 44 | #endif // #ifndef RNBO_ASSERT 45 | 46 | } // namespace RNBO 47 | 48 | #endif // #ifndef _RNBO_DEBUG_H_ 49 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_EngineLink.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_EngineLink_h_ 2 | #define _RNBO_EngineLink_h_ 3 | 4 | 5 | namespace RNBO { 6 | 7 | class EngineInterface; 8 | class PatcherEventTarget; 9 | 10 | /** 11 | * @private 12 | */ 13 | class EngineLink { 14 | 15 | public: 16 | 17 | void setEngineAndPatcher(EngineInterface *engineInterface, PatcherEventTarget* parentPatcher) { 18 | _engineInterface = engineInterface; 19 | _parentPatcher = parentPatcher; 20 | } 21 | 22 | virtual EngineInterface *getEngine() const { 23 | return _engineInterface; 24 | } 25 | 26 | PatcherEventTarget* getPatcherEventTarget() const { 27 | return _parentPatcher; 28 | } 29 | 30 | protected: 31 | 32 | ~EngineLink() { } 33 | 34 | EngineInterface* _engineInterface = nullptr; 35 | PatcherEventTarget* _parentPatcher = nullptr; 36 | }; 37 | 38 | } // namespace RNBO 39 | 40 | #endif // #ifndef _RNBO_EngineLink_h_ 41 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_EventTarget.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_EventTarget.h 3 | // 4 | // Created by Rob Sussman on 1/14/16. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_EventTarget_h_ 9 | #define _RNBO_EventTarget_h_ 10 | 11 | #include "RNBO_Types.h" 12 | #include "RNBO_EngineLink.h" 13 | 14 | namespace RNBO { 15 | 16 | /** 17 | * @private 18 | */ 19 | class EventTarget { 20 | 21 | public: 22 | 23 | virtual void processMidiEvent(MillisecondTime time, int port, ConstByteArray data, Index length) = 0; 24 | virtual void processClockEvent(MillisecondTime time, ClockId index, bool hasValue, ParameterValue value) = 0; 25 | 26 | protected: 27 | 28 | ~EventTarget() { } 29 | 30 | }; 31 | 32 | } // namespace RNBO 33 | 34 | #endif // #ifndef _RNBO_EventTarget_h_ 35 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_ExternalBase.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_ExternalBase_h_ 2 | #define _RNBO_ExternalBase_h_ 3 | 4 | #include "RNBO_ProcessInterface.h" 5 | #include "RNBO_EngineLink.h" 6 | #include "RNBO_EventTarget.h" 7 | 8 | namespace RNBO { 9 | 10 | /** 11 | * @private 12 | */ 13 | class ExternalBase : public ProcessInterface, public EngineLink, public EventTarget { 14 | 15 | public: 16 | 17 | virtual ~ExternalBase() { } 18 | 19 | }; 20 | 21 | } // namespace RNBO 22 | 23 | #endif // #ifndef _RNBO_ExternalBase_h_ 24 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_ExternalPtr.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_ExternalPtr.h 3 | // Created: 10 Feb 2016 2:46:28pm 4 | // Author: Stefan Brunner 5 | // 6 | // 7 | 8 | #ifndef _RNBO_EXTERNALPTR_H_ 9 | #define _RNBO_EXTERNALPTR_H_ 10 | 11 | #include "RNBO_UniquePtr.h" 12 | #include "RNBO_ExternalBase.h" 13 | 14 | namespace RNBO { 15 | 16 | /** 17 | * @private 18 | */ 19 | template 20 | class HolderPtr 21 | { 22 | public: 23 | HolderPtr() 24 | : _ptr(nullptr) 25 | {} 26 | 27 | HolderPtr(T* ptr) { 28 | _ptr.reset(ptr); 29 | } 30 | 31 | UniquePtr& operator->() { 32 | return _ptr; 33 | } 34 | 35 | const UniquePtr& operator->() const { 36 | return _ptr; 37 | } 38 | 39 | bool operator!() 40 | { 41 | return !_ptr; 42 | } 43 | 44 | T* get() const 45 | { 46 | return _ptr.get(); 47 | } 48 | 49 | explicit operator const T*() const { return _ptr.get(); } 50 | 51 | private: 52 | UniquePtr _ptr; 53 | }; 54 | 55 | template 56 | inline bool operator==(const T1* lhs, const HolderPtr& rhs) 57 | { 58 | return lhs == static_cast(rhs.get()); 59 | } 60 | 61 | template 62 | inline bool operator==(const HolderPtr& lhs, const T2* rhs) 63 | { 64 | return static_cast(lhs.get()) == rhs; 65 | } 66 | 67 | using ExternalPtr = HolderPtr; 68 | 69 | } 70 | 71 | #endif // #ifndef _RNBO_EXTERNALPTR_H_ 72 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_ListHelpers.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_LISTHELPERS_H_ 2 | #define _RNBO_LISTHELPERS_H_ 3 | 4 | // RNBO_LISTHELPERS.h -- list utilities used by generated code 5 | 6 | #include "RNBO_Std.h" 7 | 8 | namespace RNBO { 9 | 10 | ATTRIBUTE_UNUSED 11 | static list createListCopy(const list& l) 12 | { 13 | list tmp = l; 14 | return tmp; 15 | } 16 | 17 | /* 18 | * assume this statement: 19 | * 20 | * list newlist = oldlist; 21 | * 22 | * in C++ this will make a list copy, in JS this won't, so we need the below function (a NOOP in C++) 23 | */ 24 | ATTRIBUTE_UNUSED 25 | static const list& jsCreateListCopy(const list& l) 26 | { 27 | return l; 28 | } 29 | 30 | template list serializeArrayToList(T *array, size_t size) { 31 | list result; 32 | result.reserve(size); 33 | for (size_t i = 0; i < size; i++) { 34 | result.push((number)(array[i])); 35 | } 36 | return result; 37 | } 38 | 39 | template void deserializeArrayFromList(const list& l, T* result, size_t size) { 40 | for (size_t i = 0; i < size && i < l.length; i++) { 41 | result[i] = (T)(l[i]); 42 | } 43 | } 44 | 45 | } // namespace RNBO 46 | 47 | #endif // #ifndef _RNBO_LISTHELPERS_H_ 48 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_ParameterInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef RNBO_ParameterInterface_h 2 | #define RNBO_ParameterInterface_h 3 | 4 | #include "RNBO_Types.h" 5 | #include "RNBO_Math.h" 6 | 7 | namespace RNBO { 8 | 9 | class ParameterInterface { 10 | 11 | protected: 12 | ~ParameterInterface() { } 13 | 14 | public: 15 | virtual ParameterIndex getNumParameters() const = 0; 16 | virtual ConstCharPointer getParameterName(ParameterIndex index) const = 0; 17 | virtual ConstCharPointer getParameterId(ParameterIndex index) const = 0; 18 | virtual void getParameterInfo(ParameterIndex index, ParameterInfo* info) const = 0; 19 | 20 | virtual ParameterValue getParameterValue(ParameterIndex index) = 0; 21 | virtual void setParameterValue(ParameterIndex index, ParameterValue value, MillisecondTime time = RNBOTimeNow) = 0; 22 | 23 | virtual ParameterValue getParameterNormalized(ParameterIndex index) { 24 | return convertToNormalizedParameterValue(index, getParameterValue(index)); 25 | } 26 | 27 | virtual void setParameterValueNormalized(ParameterIndex index, ParameterValue normalizedValue, MillisecondTime time = RNBOTimeNow) { 28 | setParameterValue(index, convertFromNormalizedParameterValue(index, normalizedValue), time); 29 | } 30 | 31 | virtual ParameterValue convertToNormalizedParameterValue(ParameterIndex index, ParameterValue value) const = 0; 32 | virtual ParameterValue convertFromNormalizedParameterValue(ParameterIndex index, ParameterValue normalizedValue) const = 0; 33 | virtual ParameterValue constrainParameterValue(ParameterIndex, ParameterValue value) const { return value; } 34 | }; 35 | 36 | } // namespace RNBO 37 | 38 | #endif // RNBO_ParameterInterface_h 39 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_PatcherEventTarget.h: -------------------------------------------------------------------------------- 1 | // 2 | // _RNBO_PatcherInterface_H_ 3 | // 4 | // Created by Rob Sussman on 8/4/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_PatcherEventTarget_H_ 9 | #define _RNBO_PatcherEventTarget_H_ 10 | 11 | #include "RNBO_Types.h" 12 | #include "RNBO_EventTarget.h" 13 | #include "RNBO_List.h" 14 | 15 | namespace RNBO { 16 | 17 | /** 18 | * @private 19 | */ 20 | class PatcherEventTarget : public EventTarget { 21 | 22 | public: 23 | 24 | virtual void processNormalizedParameterEvent(ParameterIndex index, ParameterValue value, MillisecondTime time) = 0; 25 | virtual void processParameterEvent(ParameterIndex index, ParameterValue value, MillisecondTime time) = 0; 26 | virtual void processOutletEvent(EngineLink* sender, OutletIndex index, ParameterValue value, MillisecondTime time) = 0; 27 | virtual void processOutletAtCurrentTime(EngineLink* sender, OutletIndex index, ParameterValue value) = 0; 28 | virtual void processDataViewUpdate(DataRefIndex index, MillisecondTime time) = 0; 29 | virtual void processNumMessage(MessageTag tag, MessageTag objectId, MillisecondTime time, number payload) = 0; 30 | virtual void processListMessage(MessageTag tag, MessageTag objectId, MillisecondTime time, const list& payload) = 0; 31 | virtual void processBangMessage(MessageTag tag, MessageTag objectId, MillisecondTime time) = 0; 32 | virtual void processTempoEvent(MillisecondTime time, Tempo tempo) = 0; 33 | virtual void processTransportEvent(MillisecondTime time, TransportState state) = 0; 34 | virtual void processBeatTimeEvent(MillisecondTime time, BeatTime beatTime) = 0; 35 | virtual void processTimeSignatureEvent(MillisecondTime time, int numerator, int denominator) = 0; 36 | 37 | protected: 38 | 39 | ~PatcherEventTarget() { } 40 | 41 | }; 42 | 43 | } // namespace RNBO 44 | 45 | 46 | #endif // #ifndef _RNBO_PatcherEventTarget_H_ 47 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_PatcherFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_PatcherFactory.h 3 | // 4 | // Created by DDZ on 11/08/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_PatcherFactory_h 9 | #define _RNBO_PatcherFactory_h 10 | 11 | namespace RNBO { 12 | 13 | class PlatformInterface; 14 | class PatcherInterface; 15 | 16 | /** The patcher factory is just a function pointer to a function that 17 | allocates a PatcherInterface derived object and returns the PatcherInterface pointer 18 | Note, PatcherInterface should be freed via the PatcherInterface destroy() method. 19 | */ 20 | using PatcherFactoryFunctionPtr = PatcherInterface*(*)(); 21 | 22 | /** the patcher factory can be obtained via a staticaly linked in function named GetPatcherFactoryFunction 23 | or a DLL can export the function named GetPatcherFactoryFunction in which case the function 24 | should have the following signature. 25 | */ 26 | using GetPatcherFactoryFunctionPtr = PatcherFactoryFunctionPtr(*)(PlatformInterface*); 27 | 28 | } // namespace RNBO 29 | 30 | #ifndef RNBO_NO_PATCHERFACTORY 31 | extern "C" RNBO::PatcherFactoryFunctionPtr GetPatcherFactoryFunction(RNBO::PlatformInterface*); 32 | #endif 33 | 34 | #endif // ifndef _RNBO_PatcherFactory_h 35 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_PatcherInterfaceImpl.h: -------------------------------------------------------------------------------- 1 | // 2 | // _RNBO_PatcherInterfaceImpl_H_ 3 | // 4 | // Created by Rob Sussman on 1/11/18. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_PatcherInterfaceImpl_H_ 9 | #define _RNBO_PatcherInterfaceImpl_H_ 10 | 11 | #include "RNBO_Types.h" 12 | #include "RNBO_PatcherInterface.h" 13 | 14 | namespace RNBO { 15 | 16 | class PatcherInterfaceImpl : public PatcherInterface 17 | { 18 | public: 19 | 20 | void destroy() override 21 | { 22 | delete this; 23 | } 24 | 25 | }; 26 | 27 | } // namespace RNBO 28 | 29 | 30 | #endif // #ifndef _RNBO_PatcherInterfaceImpl_H_ 31 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_ProbingInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_PROBINGINTERFACE_H_ 2 | #define _RNBO_PROBINGINTERFACE_H_ 3 | 4 | #include "RNBO_Types.h" 5 | 6 | namespace RNBO { 7 | 8 | /** 9 | * @private 10 | */ 11 | class ProbingInterface { 12 | 13 | protected: 14 | 15 | ~ProbingInterface() { } 16 | 17 | public: 18 | 19 | virtual ParameterIndex getParameterIndexForID(ConstCharPointer paramid) const = 0; 20 | virtual ParameterIndex getProbingChannels(MessageTag outletId) const = 0; 21 | }; 22 | 23 | } // namespace RNBO 24 | 25 | #endif // #ifndef _RNBO_PROBINGINTERFACE_H_ 26 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_ProcessInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_PROCESSINTERFACE_H_ 2 | #define _RNBO_PROCESSINTERFACE_H_ 3 | 4 | #include "RNBO_Types.h" 5 | #include "RNBO_BaseInterface.h" 6 | 7 | namespace RNBO { 8 | 9 | /** 10 | * @brief An interface for signal-rate data processing 11 | */ 12 | class ProcessInterface : public BaseInterface { 13 | 14 | protected: 15 | 16 | ~ProcessInterface() {} 17 | 18 | public: 19 | 20 | virtual void prepareToProcess(number sampleRate, Index maxBlockSize, bool force = false) = 0; 21 | 22 | virtual void process(SampleValue** audioInputs, Index numInputs, 23 | SampleValue** audioOutputs, Index numOutputs, 24 | Index sampleFrames) = 0; 25 | 26 | }; 27 | 28 | } // namespace RNBO 29 | 30 | #endif // #ifndef _RNBO_PROCESSINTERFACE_H_ 31 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/common/RNBO_Version.h: -------------------------------------------------------------------------------- 1 | //automatically generated 2 | #ifndef _RNBO_Version_H_ 3 | #define _RNBO_Version_H_ 4 | namespace RNBO { 5 | const char * version = "1.0.1"; 6 | } 7 | #endif 8 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/3rdparty/concurrentqueue/.gitignore: -------------------------------------------------------------------------------- 1 | *.ipch 2 | *.suo 3 | *.user 4 | *.sdf 5 | *.opensdf 6 | *.exe 7 | *.pdb 8 | build/bin/ 9 | build/*.log 10 | build/msvc12/*.log 11 | build/msvc12/obj/ 12 | build/msvc11/*.log 13 | build/msvc11/obj/ 14 | tests/fuzztests/fuzztests.log 15 | benchmarks/benchmarks.log 16 | tests/CDSChecker/*.o 17 | tests/CDSChecker/*.log 18 | tests/CDSChecker/model-checker/ 19 | tests/relacy/freelist.exe 20 | tests/relacy/spmchash.exe 21 | tests/relacy/log.txt 22 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/3rdparty/concurrentqueue/LICENSE.md: -------------------------------------------------------------------------------- 1 | This license applies to everything in this repository except that which 2 | is explicitly annotated as being written by other authors, i.e. the Boost 3 | queue (included in the benchmarks for comparison), Intel's TBB library (ditto), 4 | the CDSChecker tool (used for verification), the Relacy model checker (ditto), 5 | and Jeff Preshing's semaphore implementation (used in the blocking queue) which 6 | has a zlib license (embedded in blockingconcurrentqueue.h). 7 | 8 | 9 | Simplified BSD License: 10 | 11 | Copyright (c) 2013-2015, Cameron Desrochers. 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without modification, 15 | are permitted provided that the following conditions are met: 16 | 17 | - Redistributions of source code must retain the above copyright notice, this list of 18 | conditions and the following disclaimer. 19 | - Redistributions in binary form must reproduce the above copyright notice, this list of 20 | conditions and the following disclaimer in the documentation and/or other materials 21 | provided with the distribution. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 24 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 26 | THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 28 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 30 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/3rdparty/concurrentqueue/internal/concurrentqueue_internal_debug.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#define MCDBGQ_TRACKMEM 1 4 | //#define MCDBGQ_NOLOCKFREE_FREELIST 1 5 | //#define MCDBGQ_USEDEBUGFREELIST 1 6 | //#define MCDBGQ_NOLOCKFREE_IMPLICITPRODBLOCKINDEX 1 7 | //#define MCDBGQ_NOLOCKFREE_IMPLICITPRODHASH 1 8 | 9 | #if defined(_WIN32) || defined(__WINDOWS__) || defined(__WIN32__) 10 | #define WIN32_LEAN_AND_MEAN 11 | #include 12 | namespace moodycamel { namespace debug { 13 | struct DebugMutex { 14 | DebugMutex() { InitializeCriticalSectionAndSpinCount(&cs, 0x400); } 15 | ~DebugMutex() { DeleteCriticalSection(&cs); } 16 | 17 | void lock() { EnterCriticalSection(&cs); } 18 | void unlock() { LeaveCriticalSection(&cs); } 19 | 20 | private: 21 | CRITICAL_SECTION cs; 22 | }; 23 | } } 24 | #else 25 | #include 26 | namespace moodycamel { namespace debug { 27 | struct DebugMutex { 28 | void lock() { m.lock(); } 29 | void unlock() { m.unlock(); } 30 | 31 | private: 32 | std::mutex m; 33 | }; 34 | } } 35 | #define 36 | #endif 37 | 38 | namespace moodycamel { namespace debug { 39 | struct DebugLock { 40 | explicit DebugLock(DebugMutex& mutex) 41 | : mutex(mutex) 42 | { 43 | mutex.lock(); 44 | } 45 | 46 | ~DebugLock() 47 | { 48 | mutex.unlock(); 49 | } 50 | 51 | private: 52 | DebugMutex& mutex; 53 | }; 54 | 55 | 56 | template 57 | struct DebugFreeList { 58 | DebugFreeList() : head(nullptr) { } 59 | DebugFreeList(DebugFreeList&& other) : head(other.head) { other.head = nullptr; } 60 | void swap(DebugFreeList& other) { std::swap(head, other.head); } 61 | 62 | inline void add(N* node) 63 | { 64 | DebugLock lock(mutex); 65 | node->freeListNext = head; 66 | head = node; 67 | } 68 | 69 | inline N* try_get() 70 | { 71 | DebugLock lock(mutex); 72 | if (head == nullptr) { 73 | return nullptr; 74 | } 75 | 76 | auto prevHead = head; 77 | head = head->freeListNext; 78 | return prevHead; 79 | } 80 | 81 | N* head_unsafe() const { return head; } 82 | 83 | private: 84 | N* head; 85 | DebugMutex mutex; 86 | }; 87 | } } 88 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/3rdparty/readerwriterqueue/.gitignore: -------------------------------------------------------------------------------- 1 | *.ipch 2 | *.suo 3 | *.user 4 | *.sdf 5 | *.opensdf 6 | *.exe 7 | tests/stabtest/msvc10/Debug/ 8 | tests/stabtest/msvc10/Release/ 9 | tests/stabtest/msvc10/obj/ 10 | tests/stabtest/msvc10/log.txt 11 | tests/stabtest/msvc12/Debug/ 12 | tests/stabtest/msvc12/Release/ 13 | tests/stabtest/msvc12/obj/ 14 | tests/stabtest/msvc12/log.txt 15 | tests/stabtest/log.txt 16 | tests/unittests/msvc10/Debug/ 17 | tests/unittests/msvc10/Release/ 18 | tests/unittests/msvc10/obj/ 19 | tests/unittests/msvc12/Debug/ 20 | tests/unittests/msvc12/Release/ 21 | tests/unittests/msvc12/obj/ 22 | tests/CDSChecker/model-checker/ 23 | benchmarks/msvc10/Debug/ 24 | benchmarks/msvc10/Release/ 25 | benchmarks/msvc10/obj/ 26 | benchmarks/msvc12/Debug/ 27 | benchmarks/msvc12/Release/ 28 | benchmarks/msvc12/obj/ 29 | test/ 30 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/3rdparty/readerwriterqueue/LICENSE.md: -------------------------------------------------------------------------------- 1 | This license applies to all the code in this repository except that written by third 2 | parties, namely the files in benchmarks/ext, which have their own licenses, and Jeff 3 | Preshing's semaphore implementation (used in the blocking queue) which has a zlib 4 | license (embedded in atomicops.h). 5 | 6 | Simplified BSD License: 7 | 8 | Copyright (c) 2013-2015, Cameron Desrochers 9 | All rights reserved. 10 | 11 | Redistribution and use in source and binary forms, with or without modification, 12 | are permitted provided that the following conditions are met: 13 | 14 | - Redistributions of source code must retain the above copyright notice, this list of 15 | conditions and the following disclaimer. 16 | - Redistributions in binary form must reproduce the above copyright notice, this list of 17 | conditions and the following disclaimer in the documentation and/or other materials 18 | provided with the distribution. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 21 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 23 | THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 25 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 27 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 28 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_BeatTimeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_BeatTimeEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_BeatTimeEvent_H_ 7 | #define _RNBO_BeatTimeEvent_H_ 8 | 9 | #include "RNBO_Types.h" 10 | 11 | namespace RNBO { 12 | 13 | class PatcherEventTarget; 14 | 15 | /** 16 | * An event for setting the current transport time. Depending on the host, 17 | * setting the beat time may simply update the internal transport, or else 18 | * it may generate an event that causes the host to change its beat time. 19 | * @see RNBO::BeatTime represents time in quater notes, as used by (for 20 | * example) Ableton Link. @see RNBO::Millisecond time is of course the time 21 | * in milliseconds. 22 | */ 23 | class BeatTimeEvent { 24 | 25 | public: 26 | 27 | BeatTimeEvent() 28 | : _eventTime(0) 29 | , _beatTime(-1) 30 | { 31 | } 32 | 33 | ~BeatTimeEvent() 34 | { 35 | } 36 | 37 | BeatTimeEvent( 38 | MillisecondTime eventTime, 39 | BeatTime beatTime 40 | ) 41 | : _eventTime(eventTime) 42 | , _beatTime(beatTime) 43 | { 44 | } 45 | 46 | BeatTimeEvent(const BeatTimeEvent& other) 47 | : _eventTime(other._eventTime) 48 | { 49 | _beatTime = other._beatTime; 50 | } 51 | 52 | BeatTimeEvent(BeatTimeEvent&& other) 53 | : _eventTime(other._eventTime) 54 | { 55 | _beatTime = other._beatTime; 56 | } 57 | 58 | BeatTimeEvent& operator = (const BeatTimeEvent& other) 59 | { 60 | _eventTime = other._eventTime; 61 | _beatTime = other._beatTime; 62 | 63 | return *this; 64 | } 65 | 66 | bool operator==(const BeatTimeEvent& rhs) const 67 | { 68 | return rhs.getTime() == getTime() && rhs.getBeatTime() == getBeatTime(); 69 | } 70 | 71 | MillisecondTime getTime() const { return _eventTime; } 72 | BeatTime getBeatTime() const { return _beatTime; } 73 | 74 | // we will always use the default event target (the top level patcher) 75 | PatcherEventTarget* getEventTarget() const { return nullptr; } 76 | 77 | // debugging 78 | void dumpEvent() const { 79 | // disabling for now to avoid requiring fprintf support in generated code 80 | // fprintf(stdout, "BeatTimeEvent: time=%.3f beatTime=%d", _eventTime, _beatTime); 81 | } 82 | 83 | protected: 84 | 85 | MillisecondTime _eventTime; 86 | BeatTime _beatTime; 87 | 88 | friend class EventVariant; 89 | 90 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 91 | }; 92 | 93 | } // namespace RNBO 94 | 95 | #endif // #ifndef _RNBO_BeatTimeEvent_H_ 96 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_Config.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_Config.h 3 | // 4 | // Created by Rob Sussman on 1/12/16. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_Config_h_ 9 | #define _RNBO_Config_h_ 10 | 11 | // include your own RNBO_LocalConfig.h before including "RNBO.h" 12 | // if you want to override the settings in this file 13 | 14 | ////////////////////////////////////////////////////////////////////////////////// 15 | 16 | // dynamic compilation watches the patcher source file and 17 | // uses clang/llvm to recompile dynamically when it changes 18 | // can enable or disable here for local testing, but primary configuration should be via project file 19 | // #define USE_DYNAMIC_COMPILATION 20 | // #undef USE_DYNAMIC_COMPILATION 21 | 22 | // determines if we should init the file watcher that checks for changes in the 23 | // default test file and triggers re-compilation 24 | // #define USE_TEST_FILEWATCHER 25 | // #undef USE_TEST_FILEWATCHER 26 | 27 | ////////////////////////////////////////////////////////////////////////////////// 28 | 29 | #if defined(USE_DYNAMIC_COMPILATION) && defined(RNBO_NO_CLANG) 30 | 31 | // disable clang/llvm for projects that don't need/support it 32 | #undef USE_DYNAMIC_COMPILATION 33 | 34 | #endif // defined(USE_DYNAMIC_COMPILATION) && defined(RNBO_NO_CLANG) 35 | 36 | ////////////////////////////////////////////////////////////////////////////////// 37 | 38 | // Default place to write output cpp code 39 | #ifdef RNBO_DEFAULT_TEST_FILE 40 | #define RNBO_TEST_FILE RNBO_QUOTE(RNBO_DEFAULT_TEST_FILE) 41 | #endif 42 | 43 | // Default place to write output js code 44 | #ifdef RNBO_DEFAULT_WEB_FILE 45 | #define RNBO_WEB_FILE RNBO_QUOTE(RNBO_DEFAULT_WEB_FILE) 46 | #endif 47 | 48 | // Switch off the default Patcher Interface creation, necessary when you want to 49 | // use multiple CoreObjects in one Project 50 | //#define RNBO_NO_PATCHERFACTORY 51 | 52 | ////////////////////////////////////////////////////////////////////////////////// 53 | 54 | #endif // #ifndef _RNBO_Config_h_ 55 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_DataBuffer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataBuffer.cpp 3 | // RNBOApp 4 | // 5 | // Created by Rob Sussman on 12/21/15. 6 | // 7 | // 8 | 9 | #include "RNBO_DataBuffer.h" 10 | 11 | namespace RNBO { 12 | 13 | DataBuffer::DataBuffer(size_t size) 14 | : _data(size) 15 | { 16 | 17 | } 18 | 19 | DataBuffer::DataBuffer(const char* dataToCopy, size_t sizeOfDataToCopy) 20 | : _data(sizeOfDataToCopy) 21 | { 22 | memcpy(_data.data(), dataToCopy, _data.size()); 23 | } 24 | 25 | DataBuffer::DataBuffer(const char* stringToCopy) 26 | : _data(strlen(stringToCopy)+1) 27 | { 28 | memcpy(_data.data(), stringToCopy, _data.size()); 29 | } 30 | 31 | void DataBuffer::resize(size_t size) 32 | { 33 | _data.resize(size); 34 | } 35 | 36 | 37 | } // namespace RNBO 38 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_DataBuffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataBuffer.h 3 | // 4 | // Created by Rob Sussman on 12/21/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_DataBuffer_H_ 9 | #define _RNBO_DataBuffer_H_ 10 | 11 | #include 12 | #include 13 | 14 | namespace RNBO { 15 | 16 | /** 17 | * DataBuffer holds an arbitrary block of data. 18 | * 19 | * It is designed to be owned and used from one thread at a time and has no protections/locks on any of its methods. 20 | * It is also designed to minimize memory allocation, so shrinking the buffer size will not cause reallocations. 21 | */ 22 | class DataBuffer 23 | { 24 | public: 25 | 26 | /** 27 | * @brief Initialize a DataBuffer with zeros 28 | * 29 | * @param size the buffer size in bytes 30 | */ 31 | DataBuffer(size_t size); 32 | 33 | /** 34 | * @brief Initialize a DataBuffer with a block of memory 35 | * 36 | * @param dataToCopy source data to copy 37 | * @param sizeOfDataToCopy the number of bytes to copy from the source data 38 | */ 39 | DataBuffer(const char* dataToCopy, size_t sizeOfDataToCopy); 40 | 41 | /** 42 | * @brief Initialize a DataBuffer with a null-terminated string 43 | * 44 | * The string's contents are copied to a newly allocated block of memory. 45 | * 46 | * @param stringToCopy the null-terminated string to initialize the DataBuffer with 47 | */ 48 | DataBuffer(const char* stringToCopy); 49 | 50 | /** 51 | * @brief Resize the DataBuffer, attempting to preserve contents 52 | * 53 | * When expanding, the extra space is filled with zeros. 54 | * 55 | * @param size the new size of the DataBuffer 56 | */ 57 | void resize(size_t size); 58 | 59 | /** 60 | * @brief Get the current buffer size 61 | * 62 | * @return the size of the DataBuffer in bytes 63 | */ 64 | size_t size() const { return _data.size(); } 65 | 66 | /** 67 | * @brief Get a pointer to the raw data 68 | * 69 | * This can be used to modify the data in the buffer 70 | * 71 | * @return a pointer to the first byte of raw data in the DataBuffer 72 | */ 73 | char* data() { return _data.data(); } 74 | 75 | /** 76 | * @brief Get a const pointer to the raw data 77 | * 78 | * @return a const pointer to the first byte of raw data in the DataBuffer 79 | */ 80 | const char* data() const { return _data.data(); } 81 | 82 | private: 83 | std::vector _data; 84 | }; 85 | 86 | using DataBufferRef = std::shared_ptr; 87 | 88 | } // namespace RNBO 89 | 90 | #endif // #ifndef _RNBO_DataBuffer_H_ 91 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_DataRefEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataRefEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_DataRefEvent_H_ 7 | #define _RNBO_DataRefEvent_H_ 8 | 9 | #include "RNBO_PatcherInterface.h" 10 | 11 | namespace RNBO { 12 | 13 | /** 14 | * An event for updating a Data Reference. Used internally. 15 | */ 16 | class DataRefEvent { 17 | 18 | public: 19 | 20 | enum 21 | { 22 | InvalidDataRefIndex = -1 23 | }; 24 | 25 | enum DataRefAction { 26 | NoAction, 27 | UpdateDataRef 28 | }; 29 | 30 | DataRefEvent() 31 | : _dataRefIndex(InvalidDataRefIndex) 32 | , _eventTime(0) 33 | , _action(NoAction) 34 | , _eventTarget(nullptr) 35 | { 36 | } 37 | 38 | DataRefEvent(const DataRefEvent& other) = default; 39 | DataRefEvent& operator = (const DataRefEvent& other) = default; 40 | 41 | DataRefEvent(DataRefIndex dataRefIndex, MillisecondTime eventTime, DataRefAction action, PatcherEventTarget* eventTarget = nullptr) 42 | : _dataRefIndex(dataRefIndex) 43 | , _eventTime(eventTime) 44 | , _action(action) 45 | , _eventTarget(eventTarget) 46 | { 47 | } 48 | 49 | bool operator==(const DataRefEvent& rhs) const 50 | { 51 | return rhs.getDataRefIndex() == getDataRefIndex() 52 | && rhs.getTime() == getTime() 53 | && getAction() == rhs.getAction() 54 | && rhs._eventTarget == _eventTarget; 55 | } 56 | 57 | DataRefIndex getDataRefIndex() const { return _dataRefIndex; } 58 | DataRefAction getAction() const { return _action; } 59 | 60 | MillisecondTime getTime() const { return _eventTime; } 61 | PatcherEventTarget* getEventTarget() const { return _eventTarget; } 62 | 63 | // debugging 64 | void dumpEvent() const 65 | { 66 | // disabling for now to avoid requiring fprintf support in generated code 67 | // fprintf(stdout, "DataRefEvent: DataRefIndex=%d time=%.3f action=%.4f\n", _dataRefIndex, _eventTime, _action); 68 | } 69 | 70 | private: 71 | 72 | DataRefIndex _dataRefIndex; 73 | MillisecondTime _eventTime; 74 | DataRefAction _action; 75 | 76 | friend class EventVariant; 77 | 78 | PatcherEventTarget* _eventTarget; 79 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 80 | 81 | }; 82 | 83 | } // namespace RNBO 84 | 85 | #endif // #ifndef _RNBO_DataRefEvent_H_ 86 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_DataRefList.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataRefList.cpp 3 | // RNBO 4 | // 5 | // Created by Sam Tarakajian on 2/10/20. 6 | // 7 | 8 | #include "RNBO_DataRefList.h" 9 | 10 | #ifndef RNBO_NOSTDLIB 11 | 12 | RNBO_PUSH_DISABLE_WARNINGS 13 | #include "3rdparty/json/json.hpp" 14 | RNBO_POP_DISABLE_WARNINGS 15 | 16 | using Json = nlohmann::json; 17 | 18 | namespace RNBO { 19 | 20 | DataRefList::DataRefList(std::string jsonString) 21 | { 22 | Json json = Json::parse(jsonString); 23 | for (Json::iterator it = json.begin(); it != json.end(); it++) { 24 | if (it->is_object()) { 25 | Json& j = *it; 26 | 27 | if (j.contains("id") && (j.contains("file") || j.contains("url"))) { 28 | std::string rid = j["id"]; 29 | std::string location = j.contains("file") ? j["file"] : j["url"]; 30 | auto type = j.contains("file") ? DataRefType::File : DataRefType::URL; 31 | 32 | _ids.push_back(rid); 33 | _locations.push_back(location); 34 | _types.push_back(type); 35 | } 36 | } 37 | } 38 | } 39 | 40 | DataRefList::~DataRefList() {} 41 | 42 | size_t DataRefList::size() 43 | { 44 | return _ids.size(); 45 | } 46 | 47 | std::string DataRefList::datarefIdAtIndex(size_t index) 48 | { 49 | return _ids[index]; 50 | } 51 | 52 | std::string DataRefList::datarefLocationAtIndex(size_t index) 53 | { 54 | return _locations[index]; 55 | } 56 | 57 | DataRefType DataRefList::datarefTypeAtIndex(size_t index) 58 | { 59 | return _types[index]; 60 | } 61 | 62 | } 63 | 64 | #endif /* RNBO_NOPRESETS */ 65 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_DataRefList.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_DataRefList.h 3 | // RNBO 4 | // 5 | // Created by Sam Tarakajian on 2/10/20. 6 | // 7 | 8 | #ifndef RNBO_DataRefList_h 9 | #define RNBO_DataRefList_h 10 | 11 | #include "RNBO_Utils.h" 12 | #include 13 | 14 | #ifndef RNBO_NOSTDLIB 15 | namespace RNBO { 16 | enum class DataRefType { 17 | File, 18 | URL 19 | }; 20 | 21 | /** 22 | * Wrapper class for exported RNBO dependencies. After reading a 23 | * dependencies.json file as a string, use this class to retrieve data ref 24 | * description information. 25 | * 26 | * @code{.cpp} 27 | * #include 28 | * #include 29 | * 30 | * // Read in the dependencies.json file as a std::string 31 | * std::ifstream t("../dependencies.json"); 32 | * std::stringstream buffer; 33 | * buffer << t.rdbuf(); 34 | * 35 | * // Parse dependencies into a RNBO DataRefList 36 | * DataRefList list(buffer.str()); 37 | * @endcode 38 | */ 39 | class DataRefList { 40 | public: 41 | 42 | DataRefList(std::string jsonString); 43 | ~DataRefList(); 44 | 45 | /** 46 | * Number of data refs in the list. 47 | */ 48 | size_t size(); 49 | 50 | /** 51 | * Get the ID of the data ref at the given index. 52 | * @code{.cpp} 53 | * std::string idstr = list.datarefIdAtIndex(i); 54 | * @endcode 55 | */ 56 | std::string datarefIdAtIndex(size_t index); 57 | 58 | /** 59 | * Get the path of the data ref at the given index. Can be a URL or a 60 | * file path. 61 | * @code{.cpp} 62 | * std::string location = list.datarefLocationAtIndex(i); 63 | * @endcode 64 | */ 65 | std::string datarefLocationAtIndex(size_t index); 66 | 67 | /** 68 | * Get the RNBO::DataRefType of the data ref at the given index. 69 | * @code{.cpp} 70 | * DataRefType type = list.datarefTypeAtIndex(i); 71 | * @endcode 72 | */ 73 | DataRefType datarefTypeAtIndex(size_t index); 74 | 75 | private: 76 | std::vector _ids; 77 | std::vector _locations; 78 | std::vector _types; 79 | }; 80 | } 81 | #endif /* RNBO_NOSTDLIB */ 82 | 83 | #endif /* RNBO_DataRefList_h */ 84 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_DynamicSymbolRegistry.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_DYNAMICSYMBOLREGISTRY_H_ 2 | #define _RNBO_DYNAMICSYMBOLREGISTRY_H_ 3 | 4 | #ifndef RNBO_DISABLE_CODEGEN 5 | 6 | #include 7 | 8 | namespace RNBO { 9 | 10 | /** 11 | * @private 12 | */ 13 | class DynamicSymbolRegistry { 14 | 15 | public: 16 | 17 | /** 18 | * @private 19 | */ 20 | struct DynamicSymbol { 21 | char _name[256]; 22 | void *_location; 23 | }; 24 | 25 | using DynamicSymbolList = std::vector; 26 | 27 | static DynamicSymbolList& getRegisteredSymbols() { 28 | static DynamicSymbolList dynamicSymbolRegistry; 29 | return dynamicSymbolRegistry; 30 | } 31 | 32 | static void registerSymbol(const char *name, void *location) { 33 | DynamicSymbol sym; 34 | char *n = sym._name; 35 | 36 | while ((*n++ = *name++) != 0) ; 37 | sym._location = location; 38 | 39 | getRegisteredSymbols().push_back(sym); 40 | } 41 | 42 | }; 43 | 44 | /** 45 | * @private 46 | */ 47 | class DynamicSymbolRegistrar { 48 | 49 | public: 50 | 51 | DynamicSymbolRegistrar(const char *name, void *location) { 52 | DynamicSymbolRegistry::registerSymbol(name, location); 53 | } 54 | 55 | }; 56 | 57 | } // RNBO 58 | 59 | # define CAT(a, ...) PRIMITIVE_CAT(a, __VA_ARGS__) 60 | # define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__ 61 | 62 | # define REGISTER_RNBO_EXTERNAL(ExternalName) extern "C" RNBO::ExternalBase * CAT(ExternalName, Factory) () \ 63 | { return new ExternalName (); } \ 64 | static RNBO::DynamicSymbolRegistrar ExternalName ## RegisteredSymbol( #ExternalName "Factory" , (void *) CAT(ExternalName, Factory) ); 65 | 66 | #else // RNBO_DISABLE_CODEGEN 67 | 68 | namespace RNBO { 69 | 70 | class DynamicSymbolRegistry { 71 | 72 | }; 73 | 74 | class DynamicSymbolRegistrar { 75 | 76 | public: 77 | 78 | DynamicSymbolRegistrar(const char *name, void *location) {} 79 | 80 | }; 81 | 82 | } // RNBO 83 | 84 | # define REGISTER_RNBO_EXTERNAL(ExternalName) 85 | 86 | #endif // RNBO_DISABLE_CODEGEN 87 | 88 | #endif // _RNBO_DYNAMICSYMBOLREGISTRY_H_ 89 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_EmptyEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_EmptyEvent.h 3 | // 4 | // Created by Rob Sussman on 9/18/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_EmptyEvent_h 9 | #define _RNBO_EmptyEvent_h 10 | 11 | namespace RNBO { 12 | 13 | /** 14 | * The EmptyEvent allows us to make an EventVariant that does not yet have an event. 15 | * 16 | * Useful, for example, to support calling a function that takes a reference to an EventVariant 17 | * and then fills in said EventVariant. 18 | */ 19 | class EmptyEvent { 20 | 21 | public: 22 | EmptyEvent() 23 | : _eventTarget(nullptr) 24 | { } 25 | 26 | bool operator==(const EmptyEvent& rhs) const 27 | { 28 | RNBO_UNUSED(rhs); 29 | return true; 30 | } 31 | 32 | // need a getTime() method for GetTimeVisitor to work. 33 | MillisecondTime getTime() const { return 0; } 34 | EventTarget* getEventTarget() const { return _eventTarget; } 35 | 36 | // debugging 37 | void dumpEvent() const { /* fprintf(stdout, "EmptyEvent\n"); */ } 38 | 39 | private: 40 | 41 | friend class EventVariant; 42 | 43 | void setTime(MillisecondTime eventTime) 44 | { 45 | RNBO_UNUSED(eventTime); 46 | } 47 | 48 | EventTarget *_eventTarget; 49 | 50 | }; 51 | 52 | } // namespace RNBO 53 | 54 | 55 | #endif // #ifndef _RNBO_EmptyEvent_h 56 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_FileChangeWatcher.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_FileChangeWatcher.cpp 3 | // RNBOApp 4 | // 5 | // Created by Rob Sussman on 12/11/15. 6 | // 7 | // 8 | 9 | #include "RNBO_FileChangeWatcher.h" 10 | 11 | #if defined(USE_DYNAMIC_COMPILATION) && !defined(RNBO_NO_JUCE) 12 | 13 | namespace RNBO { 14 | 15 | FileChangeWatcher::FileChangeWatcher(const char* fullPathToFile, 16 | std::function callback) 17 | : _fileToWatch(File(fullPathToFile)) 18 | , _callback(callback) 19 | { 20 | // init _lastModificationTime to avoid an initial notification 21 | _lastModificationTime = _fileToWatch.getLastModificationTime(); 22 | startTimer(1000); 23 | } 24 | 25 | FileChangeWatcher::~FileChangeWatcher() 26 | { 27 | 28 | } 29 | 30 | bool FileChangeWatcher::fileExists() const 31 | { 32 | return _fileToWatch.exists(); 33 | } 34 | 35 | const char* FileChangeWatcher::getFullPathToWatchedFile() const 36 | { 37 | return _fileToWatch.getFullPathName().toRawUTF8(); 38 | } 39 | 40 | void FileChangeWatcher::timerCallback() 41 | { 42 | Time modtime = _fileToWatch.getLastModificationTime(); 43 | if (_lastModificationTime != modtime) { 44 | _lastModificationTime = modtime; 45 | _callback(this); 46 | } 47 | } 48 | 49 | } // namespace RNBO 50 | 51 | #endif // #ifdef USE_DYNAMIC_COMPILATION 52 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_FileChangeWatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_FileChangeWatcher.h 3 | // 4 | // Created by Rob Sussman on 12/11/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_FileChangeWatcher_H_ 9 | #define _RNBO_FileChangeWatcher_H_ 10 | 11 | #include "RNBO_Config.h" 12 | 13 | #ifdef USE_DYNAMIC_COMPILATION 14 | 15 | #include 16 | 17 | #ifndef RNBO_NO_JUCE 18 | #include "JuceHeader.h" 19 | #endif 20 | 21 | namespace RNBO { 22 | 23 | #ifdef RNBO_NO_JUCE 24 | class FileChangeWatcher 25 | { 26 | public: 27 | FileChangeWatcher(const char* fullPathToFile, 28 | std::function callback) 29 | { 30 | // dummy implementation 31 | } 32 | }; 33 | #else 34 | class FileChangeWatcher : public Timer 35 | { 36 | public: 37 | 38 | /** FileChangeWatcher will call the callback when the file changes. 39 | Passes in a pointer to the watcher so you can query the path. 40 | */ 41 | FileChangeWatcher(const char* fullPathToFile, 42 | std::function callback); 43 | ~FileChangeWatcher(); 44 | 45 | bool fileExists() const; 46 | const char* getFullPathToWatchedFile() const; 47 | 48 | void timerCallback() override; 49 | 50 | private: 51 | File _fileToWatch; 52 | Time _lastModificationTime; 53 | std::function _callback; 54 | }; 55 | #endif // #ifdef RNBO_NO_JUCE 56 | 57 | } // namespace RNBO 58 | 59 | #endif // #ifdef USE_DYNAMIC_COMPILATION 60 | 61 | #endif // #ifndef _RNBO_FileChangeWatcher_H_ 62 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_List.cpp: -------------------------------------------------------------------------------- 1 | #include "RNBO_List.h" 2 | 3 | #ifdef C74_UNIT_TESTS 4 | #include 5 | #include 6 | 7 | namespace ListTests { 8 | using namespace RNBO; 9 | class Tests : public UnitTest { 10 | public: 11 | Tests() 12 | : UnitTest("List Tests") 13 | {} 14 | void runTest() override { 15 | beginTest("listbase bounds"); 16 | listbase l = { 1.0 }; 17 | expectDoesNotThrow(l[0]); 18 | expectThrowsType(l[1], std::out_of_range); 19 | expectThrowsType(l[1] = 20.0, std::out_of_range); 20 | expectThrowsType(l[100], std::out_of_range); 21 | 22 | //shift 23 | expectEquals(l.shift(), 1.0); 24 | expectThrowsType(l.shift(), std::out_of_range); 25 | 26 | //pop 27 | l.push(20.0); 28 | l.push(10.0); 29 | expectEquals(l.pop(), 10.0); 30 | expectEquals(l.pop(), 20.0); 31 | expectEquals(l.pop(), 0.0); 32 | expectEquals(l.pop(), 0.0); 33 | } 34 | }; 35 | Tests tests; 36 | } 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_Logger.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_Logger.cpp 3 | // Created: 25 Jan 2016 4:07:31pm 4 | // Author: stb 5 | // 6 | // 7 | 8 | #include "RNBO_Logger.h" 9 | #include "RNBO_DynamicSymbolRegistry.h" 10 | 11 | namespace RNBO { 12 | 13 | static Logger s_logger_instance; 14 | LoggerInterface* console = &s_logger_instance; 15 | static DynamicSymbolRegistrar ConsoleRegisteredSymbol("console" , reinterpret_cast(&console)); 16 | 17 | Logger::Logger() 18 | : _outputCallback(&Logger::defaultLogOutputFunction) 19 | { 20 | } 21 | 22 | Logger::~Logger() 23 | { 24 | } 25 | 26 | void Logger::setLoggerOutputCallback(OutputCallback* callback) 27 | { 28 | _outputCallback = callback ? callback : defaultLogOutputFunction; 29 | } 30 | 31 | void Logger::defaultLogOutputFunction(LogLevel level, const char* message) 32 | { 33 | const static char* levelStr[] = { "[INFO]", "[WARNING]", "[ERROR]" }; 34 | String formattedMessage = levelStr[level]; 35 | formattedMessage += "\t"; 36 | formattedMessage += message; 37 | formattedMessage += "\n"; 38 | Platform::get()->printMessage(formattedMessage.c_str()); 39 | } 40 | 41 | Logger& Logger::getInstance() 42 | { 43 | return s_logger_instance; 44 | } 45 | 46 | } // namespace RNBO 47 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_MaxClang.h: -------------------------------------------------------------------------------- 1 | #ifndef _RNBO_MAXCLANG_H_ 2 | #define _RNBO_MAXCLANG_H_ 3 | 4 | #if defined(USE_DYNAMIC_COMPILATION) 5 | 6 | #include "RNBO_ClangInterface.h" 7 | #include "ext.h" 8 | 9 | namespace RNBO { 10 | 11 | class MaxClang : public ClangInterface 12 | { 13 | public: 14 | 15 | MaxClang(); 16 | ~MaxClang(); 17 | 18 | void addPreprocessorDefinition(std::string definition) override; 19 | void addIncludePath(std::string path) override; 20 | void addSymbol(std::string name, void* address) override; 21 | void setOptimizationLevel(OLevel level) override; 22 | bool compile(std::string name, const std::string& source) override; 23 | void getLastErrors(t_dictionary **lastErrors) override; 24 | 25 | void* getFunctionAddress(std::string name) override; 26 | 27 | private: 28 | t_object* _maxclang; 29 | 30 | }; 31 | 32 | } // namespace RNBO 33 | 34 | #endif // #if defined(USE_DYNAMIC_COMPILATION) 35 | 36 | #endif // #ifndef _RNBO_MAXCLANG_H_ 37 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_OutletEvent.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _RNBO_OutletEvent_H_ 3 | #define _RNBO_OutletEvent_H_ 4 | 5 | #include "RNBO_Types.h" 6 | #include "RNBO_PatcherInterface.h" 7 | 8 | namespace RNBO { 9 | 10 | /** 11 | * An event representing a message sent through an outlet of an external 12 | */ 13 | class OutletEvent { 14 | public: 15 | 16 | OutletEvent(const OutletEvent& other) = default; 17 | OutletEvent& operator = (const OutletEvent& other) = default; 18 | 19 | OutletEvent() 20 | : _eventTime(0) 21 | , _sender(nullptr) 22 | , _index(INVALID_INDEX) 23 | , _value(0) 24 | , _eventTarget(nullptr) 25 | { 26 | } 27 | 28 | OutletEvent(MillisecondTime eventTime, EngineLink* sender, OutletIndex index, ParameterValue value, PatcherEventTarget* eventTarget = nullptr) 29 | : _eventTime(eventTime) 30 | , _sender(sender) 31 | , _index(index) 32 | , _value(value) 33 | , _eventTarget(eventTarget) 34 | { 35 | } 36 | 37 | bool operator==(const OutletEvent& rhs) const 38 | { 39 | return rhs.getTime() == getTime() 40 | && rhs.getSender() == getSender() 41 | && rhs.getIndex() == getIndex() 42 | && rhs.getValue() == getValue() 43 | && rhs._eventTarget == _eventTarget; 44 | } 45 | 46 | EngineLink* getSender() const { return _sender; } 47 | OutletIndex getIndex() const { return _index; } 48 | ParameterValue getValue() const { return _value; } 49 | 50 | MillisecondTime getTime() const { return _eventTime; } 51 | PatcherEventTarget* getEventTarget() const { return _eventTarget; } 52 | 53 | // debugging 54 | void dumpEvent() const { 55 | // fprintf(stdout, "OutletEvent: time: %.4f sender: %p index: %d value: %.4f eventTarget: %p\n", _eventTime, _sender, _index, _value, _eventTarget); 56 | } 57 | 58 | private: 59 | 60 | MillisecondTime _eventTime; 61 | EngineLink* _sender; 62 | OutletIndex _index; 63 | ParameterValue _value; 64 | 65 | friend class EventVariant; 66 | 67 | PatcherEventTarget* _eventTarget; 68 | 69 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 70 | 71 | }; 72 | 73 | } // namespace RNBO 74 | 75 | #endif // #ifndef _RNBO_OutletEvent_H_ 76 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_ParameterEventQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_ParameterEventQueue.h 3 | // Created by Timothy Place on 11.08.15. 4 | // 5 | 6 | #ifndef _RNBO_ParameterEventQueue_h 7 | #define _RNBO_ParameterEventQueue_h 8 | 9 | #include "RNBO_EventQueue.h" 10 | #include "RNBO_ServiceNotification.h" 11 | 12 | namespace RNBO { 13 | 14 | using ParameterEventQueue = EventQueue>; 15 | using ParameterEventQueuePtr = std::unique_ptr>; 16 | #if RNBO_MULTIPRODUCER_QUEUE_SUPPORTED 17 | using SafeParameterEventQueue = EventQueue>; 18 | #else 19 | using SafeParameterEventQueue = ParameterEventQueue; // hack, TODO fix this! 20 | #endif 21 | using ServiceNotificationQueue = EventQueue>; 22 | 23 | using MidiEventQueue = EventQueue>; 24 | 25 | } // namespace RNBO 26 | 27 | #endif // _RNBO_ParameterEventQueue_h 28 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_ParameterInterfaceAsync.h: -------------------------------------------------------------------------------- 1 | // 2 | // ParameterInterface.h 3 | // 4 | // Created by Stefan Brunner on 12.08.15. 5 | // 6 | // 7 | 8 | #ifndef RNBOPlugin_ParameterInterfaceAsync_h 9 | #define RNBOPlugin_ParameterInterfaceAsync_h 10 | 11 | #include "RNBO_EventVariant.h" 12 | #include "RNBO_EventList.h" 13 | #include "RNBO_ParameterEventInterface.h" 14 | 15 | namespace RNBO { 16 | 17 | class Engine; 18 | using ParameterEventInterfaceImplPtr = std::shared_ptr; 19 | 20 | /** 21 | * @private 22 | */ 23 | class ParameterInterfaceAsync : public ParameterEventInterface 24 | { 25 | public: 26 | 27 | // DO NOT construct a parameter interface directly - use Engine::createParameterInterface instead 28 | ParameterInterfaceAsync(Engine& engine, EventHandler* handler, ParameterEventInterface::Type type); 29 | ~ParameterInterfaceAsync() override; 30 | 31 | ParameterIndex getNumParameters() const override; 32 | void getParameterInfo(ParameterIndex index, ParameterInfo* info) const override; 33 | ConstCharPointer getParameterName(ParameterIndex index) const override; 34 | ConstCharPointer getParameterId(ParameterIndex index) const override; 35 | 36 | ParameterValue getParameterValue(ParameterIndex index) override; 37 | void setParameterValue(ParameterIndex index, ParameterValue value, MillisecondTime time = RNBOTimeNow) override; 38 | 39 | ParameterValue convertToNormalizedParameterValue(ParameterIndex index, ParameterValue value) const override; 40 | ParameterValue convertFromNormalizedParameterValue(ParameterIndex index, ParameterValue normalizedValue) const override; 41 | ParameterValue constrainParameterValue(ParameterIndex index, ParameterValue value) const override; 42 | 43 | void scheduleEvent(EventVariant event) override; 44 | 45 | void drainEvents() override; 46 | 47 | private: 48 | 49 | ParameterEventInterfaceImplPtr _impl; 50 | }; 51 | } // namespace RNBO 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_PatcherFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_PatcherFactory.cpp 3 | // 4 | // Created by DDZ on 11/08/15. 5 | // 6 | // 7 | 8 | #ifndef USE_DYNAMIC_COMPILATION 9 | 10 | #ifdef RNBO_TEST_FILE 11 | // this includes the test file directly when we are not using dynamic compilation 12 | 13 | #include RNBO_TEST_FILE 14 | 15 | #endif 16 | 17 | #endif 18 | 19 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_PlatformInterfaceImpl.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // PlatformInterfaceImpl.cpp 3 | // 4 | // Created by Rob Sussman on May 20, 2016 5 | // 6 | // 7 | 8 | #include "platforms/stdlib//RNBO_PlatformInterfaceStdLib.h" 9 | 10 | namespace RNBO { 11 | static PlatformInterfaceStdLib platformInstance; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_PresetList.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_PresetList.cpp 3 | // RNBO 4 | // 5 | // Created by Samuel Tarakajian on 11/9/20. 6 | // 7 | 8 | #if !(defined(RNBO_NOPRESETS) || defined(RNBO_NOJSONPRESETS)) 9 | 10 | #include "RNBO_PresetList.h" 11 | 12 | namespace RNBO { 13 | 14 | PresetList::PresetList(std::string jsonString): 15 | _parsedPresets() 16 | { 17 | convertJSONArrayToPresetList(jsonString, _parsedPresets); 18 | } 19 | PresetList::~PresetList() {} 20 | 21 | size_t PresetList::size() 22 | { 23 | return _parsedPresets.size(); 24 | } 25 | 26 | UniquePresetPtr PresetList::presetAtIndex(size_t index) 27 | { 28 | UniquePresetPtr preset = make_unique(); 29 | PresetPtr srcPreset = _parsedPresets[index]->preset; 30 | copyPreset(*srcPreset, *preset); 31 | return preset; 32 | } 33 | 34 | std::string PresetList::presetNameAtIndex(size_t index) 35 | { 36 | std::string name = _parsedPresets[index]->name; 37 | return name; 38 | } 39 | 40 | UniquePresetPtr PresetList::presetWithName(std::string name) 41 | { 42 | for (size_t i = 0; i < _parsedPresets.size(); i++) { 43 | std::shared_ptr entry = _parsedPresets[i]; 44 | if (entry->name == name) { 45 | UniquePresetPtr preset = make_unique(); 46 | PresetPtr srcPreset = entry->preset; 47 | copyPreset(*srcPreset, *preset); 48 | return preset; 49 | } 50 | } 51 | 52 | return nullptr; 53 | } 54 | } 55 | 56 | #endif /* RNBO_NOPRESETS */ 57 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_PresetList.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_PresetList.h 3 | // RNBO 4 | // 5 | // Created by Samuel Tarakajian on 11/9/20. 6 | // 7 | 8 | #ifndef RNBO_PresetList_h 9 | #define RNBO_PresetList_h 10 | 11 | #include "RNBO_Presets.h" 12 | 13 | #if !(defined(RNBO_NOPRESETS) || defined(RNBO_NOJSONPRESETS)) 14 | 15 | 16 | namespace RNBO { 17 | class PresetList { 18 | public: 19 | PresetList(std::string jsonString); 20 | ~PresetList(); 21 | 22 | size_t size(); 23 | 24 | UniquePresetPtr presetAtIndex(size_t index); 25 | 26 | std::string presetNameAtIndex(size_t index); 27 | 28 | UniquePresetPtr presetWithName(std::string name); 29 | 30 | private: 31 | std::vector> _parsedPresets; 32 | }; 33 | } 34 | 35 | #endif /* RNBO_NOPRESETS */ 36 | 37 | #endif /* RNBO_PresetList_h */ 38 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_ServiceNotification.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_ServiceEvent.h 3 | // 4 | // Created by Stefan Brunner on 9/21/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_ServiceEvent_H_ 9 | #define _RNBO_ServiceEvent_H_ 10 | 11 | #include "RNBO_Types.h" 12 | 13 | namespace RNBO { 14 | 15 | // an event representing service message on our dedicated serive queue, note that it does NOT impement getTime() 16 | // so it cannot be used inside an EventVariant 17 | using ServiceNotificationPayload = void*; 18 | 19 | /** 20 | * @private 21 | */ 22 | class ServiceNotification { 23 | public: 24 | 25 | enum ServiceNotificationType 26 | { 27 | ServiceNotificationUndefined, 28 | ParameterInterfaceCreated, 29 | ParameterInterfaceDeleted 30 | }; 31 | 32 | ServiceNotification(const ServiceNotification& other) = default; 33 | ServiceNotification& operator = (const ServiceNotification& other) = default; 34 | 35 | ServiceNotification() 36 | : _type(ServiceNotificationUndefined) 37 | , _payload(nullptr) 38 | { 39 | } 40 | 41 | ServiceNotification(ServiceNotificationType serviceType, ServiceNotificationPayload payload) 42 | : _type(serviceType) 43 | , _payload(payload) 44 | { 45 | } 46 | 47 | bool operator==(const ServiceNotification& rhs) const 48 | { 49 | return rhs.getType() == getType() 50 | && rhs.getPayload() == getPayload(); 51 | } 52 | 53 | ServiceNotificationType getType() const { return _type; } 54 | ServiceNotificationPayload getPayload() const { return _payload; } 55 | 56 | // debugging 57 | void dumpEvent() const { fprintf(stdout, "ServiceNotification: type=%d payload=%payload\n", _type, _payload); } 58 | 59 | private: 60 | 61 | ServiceNotificationType _type; 62 | ServiceNotificationPayload _payload; 63 | 64 | }; 65 | 66 | } // namespace RNBO 67 | 68 | #endif // #ifndef _RNBO_ServiceEvent_H_ 69 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_StartupEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_StartupEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_StartupEvent_H_ 7 | #define _RNBO_StartupEvent_H_ 8 | 9 | #include 10 | 11 | #include "RNBO_Types.h" 12 | #include "RNBO_List.h" 13 | #include "RNBO_PlatformInterface.h" 14 | #include "RNBO_Logger.h" 15 | #include "RNBO_Debug.h" 16 | #include "RNBO_Presets.h" 17 | 18 | namespace RNBO { 19 | 20 | class PatcherEventTarget; 21 | 22 | /** 23 | * An event representing startup 24 | */ 25 | class StartupEvent { 26 | 27 | public: 28 | 29 | enum Type { 30 | Invalid = -1, 31 | Begin = 0, 32 | End, 33 | Max_Type 34 | }; 35 | 36 | 37 | StartupEvent() 38 | : _eventTime(0) 39 | , _type(Invalid) 40 | { 41 | } 42 | 43 | ~StartupEvent() 44 | { 45 | } 46 | 47 | StartupEvent(MillisecondTime eventTime, StartupEvent::Type type) 48 | : _eventTime(eventTime) 49 | , _type(type) 50 | { 51 | } 52 | 53 | StartupEvent(const StartupEvent& other) 54 | : _eventTime(other._eventTime) 55 | { 56 | _type = other._type; 57 | } 58 | 59 | StartupEvent(StartupEvent&& other) 60 | : _eventTime(other._eventTime) 61 | { 62 | _type = other._type; 63 | } 64 | 65 | StartupEvent& operator = (const StartupEvent& other) 66 | { 67 | _eventTime = other._eventTime; 68 | _type = other._type; 69 | 70 | return *this; 71 | } 72 | 73 | bool operator==(const StartupEvent& rhs) const 74 | { 75 | return rhs.getTime() == getTime() 76 | && rhs.getType() == getType(); 77 | } 78 | 79 | StartupEvent::Type getType() const { return _type; } 80 | MillisecondTime getTime() const { return _eventTime; } 81 | 82 | // we will always use the default event target (the top level patcher) 83 | PatcherEventTarget* getEventTarget() const { return nullptr; } 84 | 85 | // debugging 86 | void dumpEvent() const { 87 | // disabling for now to avoid requiring fprintf support in generated code 88 | // fprintf(stdout, "StartupEvent: time=%.3f type=%d", _eventTime, _type); 89 | } 90 | 91 | protected: 92 | 93 | MillisecondTime _eventTime; 94 | StartupEvent::Type _type = Invalid; 95 | 96 | friend class EventVariant; 97 | 98 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 99 | }; 100 | 101 | } // namespace RNBO 102 | 103 | 104 | #endif // #ifndef _RNBO_StartupEvent_H_ 105 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_TempoEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_TempoEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_TempoEvent_H_ 7 | #define _RNBO_TempoEvent_H_ 8 | 9 | #include "RNBO_Types.h" 10 | 11 | namespace RNBO { 12 | 13 | class PatcherEventTarget; 14 | 15 | /** 16 | * A tempo event 17 | */ 18 | class TempoEvent { 19 | 20 | public: 21 | 22 | TempoEvent() 23 | : _eventTime(0) 24 | , _tempo(-1) 25 | { 26 | } 27 | 28 | ~TempoEvent() 29 | { 30 | } 31 | 32 | TempoEvent( 33 | MillisecondTime eventTime, 34 | Tempo tempo 35 | ) 36 | : _eventTime(eventTime) 37 | , _tempo(tempo) 38 | { 39 | } 40 | 41 | TempoEvent(const TempoEvent& other) 42 | : _eventTime(other._eventTime) 43 | { 44 | _tempo = other._tempo; 45 | } 46 | 47 | TempoEvent(TempoEvent&& other) 48 | : _eventTime(other._eventTime) 49 | { 50 | _tempo = other._tempo; 51 | } 52 | 53 | TempoEvent& operator = (const TempoEvent& other) 54 | { 55 | _eventTime = other._eventTime; 56 | _tempo = other._tempo; 57 | 58 | return *this; 59 | } 60 | 61 | bool operator==(const TempoEvent& rhs) const 62 | { 63 | return rhs.getTime() == getTime() && rhs.getTempo() == getTempo(); 64 | } 65 | 66 | MillisecondTime getTime() const { return _eventTime; } 67 | Tempo getTempo() const { return _tempo; } 68 | 69 | // we will always use the default event target (the top level patcher) 70 | PatcherEventTarget* getEventTarget() const { return nullptr; } 71 | 72 | // debugging 73 | void dumpEvent() const { 74 | // disabling for now to avoid requiring fprintf support in generated code 75 | // fprintf(stdout, "TempoEvent: time=%.3f tempo=%d", _eventTime, _tempo); 76 | } 77 | 78 | protected: 79 | 80 | MillisecondTime _eventTime; 81 | Tempo _tempo; 82 | 83 | friend class EventVariant; 84 | 85 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 86 | }; 87 | 88 | } // namespace RNBO 89 | 90 | #endif // #ifndef _RNBO_TempoEvent_H_ 91 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_TimeSignatureEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_TimeSignatureEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_TimeSignatureEvent_H_ 7 | #define _RNBO_TimeSignatureEvent_H_ 8 | 9 | #include "RNBO_Types.h" 10 | 11 | namespace RNBO { 12 | 13 | class PatcherEventTarget; 14 | 15 | /** 16 | * An event representing changing the time signature 17 | */ 18 | class TimeSignatureEvent { 19 | 20 | public: 21 | 22 | TimeSignatureEvent() 23 | : _eventTime(0) 24 | , _numerator(-1) 25 | , _denominator(-1) 26 | { 27 | } 28 | 29 | ~TimeSignatureEvent() 30 | { 31 | } 32 | 33 | TimeSignatureEvent(MillisecondTime eventTime, int numerator, int denominator) 34 | : _eventTime(eventTime) 35 | , _numerator(numerator) 36 | , _denominator(denominator) 37 | { 38 | } 39 | 40 | TimeSignatureEvent(const TimeSignatureEvent& other) 41 | : _eventTime(other._eventTime) 42 | { 43 | _numerator = other._numerator; 44 | _denominator = other._denominator; 45 | } 46 | 47 | TimeSignatureEvent(TimeSignatureEvent&& other) 48 | : _eventTime(other._eventTime) 49 | { 50 | _numerator = other._numerator; 51 | _denominator = other._denominator; 52 | } 53 | 54 | TimeSignatureEvent& operator = (const TimeSignatureEvent& other) 55 | { 56 | _eventTime = other._eventTime; 57 | _numerator = other._numerator; 58 | _denominator = other._denominator; 59 | 60 | return *this; 61 | } 62 | 63 | bool operator==(const TimeSignatureEvent& rhs) const 64 | { 65 | return rhs.getTime() == getTime() 66 | && rhs.getNumerator() == getNumerator() 67 | && rhs.getDenominator() == getDenominator(); 68 | } 69 | 70 | MillisecondTime getTime() const { return _eventTime; } 71 | int getNumerator() const { return _numerator; } 72 | int getDenominator() const { return _denominator; } 73 | 74 | // we will always use the default event target (the top level patcher) 75 | PatcherEventTarget* getEventTarget() const { return nullptr; } 76 | 77 | // debugging 78 | void dumpEvent() const { 79 | // disabling for now to avoid requiring fprintf support in generated code 80 | // fprintf(stdout, "TimeSignatureEvent: time=%.3f numerator=%d denominator=%d", _eventTime, _numerator, _denominator); 81 | } 82 | 83 | protected: 84 | 85 | MillisecondTime _eventTime; 86 | int _numerator; 87 | int _denominator; 88 | 89 | friend class EventVariant; 90 | 91 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 92 | }; 93 | 94 | } // namespace RNBO 95 | 96 | #endif // #ifndef _RNBO_TimeSignatureEvent_H_ 97 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_TransportEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_TransportEvent.h 3 | // 4 | // 5 | 6 | #ifndef _RNBO_TransportEvent_H_ 7 | #define _RNBO_TransportEvent_H_ 8 | 9 | #include "RNBO_Types.h" 10 | 11 | namespace RNBO { 12 | 13 | class PatcherEventTarget; 14 | 15 | /** 16 | * An event representing stopping or starting the transport 17 | */ 18 | class TransportEvent { 19 | 20 | public: 21 | 22 | TransportEvent() 23 | : _eventTime(0) 24 | , _state(STOPPED) 25 | { 26 | } 27 | 28 | ~TransportEvent() 29 | { 30 | } 31 | 32 | TransportEvent( 33 | MillisecondTime eventTime, 34 | TransportState state 35 | ) 36 | : _eventTime(eventTime) 37 | , _state(state) 38 | { 39 | } 40 | 41 | TransportEvent(const TransportEvent& other) 42 | : _eventTime(other._eventTime) 43 | { 44 | _state = other._state; 45 | } 46 | 47 | TransportEvent(TransportEvent&& other) 48 | : _eventTime(other._eventTime) 49 | { 50 | _state = other._state; 51 | } 52 | 53 | TransportEvent& operator = (const TransportEvent& other) 54 | { 55 | _eventTime = other._eventTime; 56 | _state = other._state; 57 | 58 | return *this; 59 | } 60 | 61 | bool operator==(const TransportEvent& rhs) const 62 | { 63 | return rhs.getTime() == getTime() && rhs.getState() == getState(); 64 | } 65 | 66 | MillisecondTime getTime() const { return _eventTime; } 67 | TransportState getState() const { return _state; } 68 | 69 | // we will always use the default event target (the top level patcher) 70 | PatcherEventTarget* getEventTarget() const { return nullptr; } 71 | 72 | // debugging 73 | void dumpEvent() const { 74 | // disabling for now to avoid requiring fprintf support in generated code 75 | // fprintf(stdout, "TransportEvent: time=%.3f state=%d", _eventTime, _state); 76 | } 77 | 78 | protected: 79 | 80 | MillisecondTime _eventTime; 81 | TransportState _state; 82 | 83 | friend class EventVariant; 84 | 85 | void setTime(MillisecondTime eventTime) { _eventTime = eventTime; } 86 | }; 87 | 88 | } // namespace RNBO 89 | 90 | #endif // #ifndef _RNBO_TransportEvent_H_ 91 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_UnitTests.cpp: -------------------------------------------------------------------------------- 1 | //a place for for small misc tests 2 | 3 | #ifdef C74_UNIT_TESTS 4 | 5 | #include "RNBO.h" 6 | #include 7 | #include 8 | 9 | namespace RNBOUnitTests { 10 | using namespace RNBO; 11 | class ArrayTests : public UnitTest { 12 | public: 13 | ArrayTests() 14 | : UnitTest("Array Tests") 15 | {} 16 | void runTest() override { 17 | beginTest("bounds"); 18 | RNBO::array l = { 1.0 }; 19 | expectDoesNotThrow(l[0]); 20 | expectThrowsType(l[1], std::out_of_range); 21 | expectThrowsType(l[100], std::out_of_range); 22 | } 23 | }; 24 | ArrayTests tests; 25 | } 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_UnitTests.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_UnitTests.h 3 | // binding 4 | // 5 | // Created by Stefan Brunner on 27.08.15. 6 | // 7 | // 8 | 9 | #ifndef binding_RNBO_UnitTests_h 10 | #define binding_RNBO_UnitTests_h 11 | 12 | // for now we only want to compile unit tests in the debug version 13 | // the general idea is, that if you want unit tests, you inlcude this file BEFORE including 14 | // RNBO.h, this will define C74_UNIT_TESTS and therefore comoile the unit tests 15 | 16 | // generally running unit tests needs Juce for now, so be aware that your project has to be prepared to use Juce 17 | 18 | #if defined(DEBUG) && !defined(C74_UNIT_TESTS) 19 | #define C74_UNIT_TESTS 20 | #endif 21 | 22 | #ifdef C74_UNIT_TESTS 23 | 24 | #include "JuceHeader.h" 25 | 26 | namespace RNBO { 27 | 28 | class UnitTestRunner : public juce::UnitTestRunner 29 | { 30 | // no modifications needed for now 31 | }; 32 | 33 | } 34 | 35 | #endif // C74_UNIT_TESTS 36 | 37 | 38 | #endif // binding_RNBO_UnitTests_h 39 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/RNBO_Utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_Utils.h 3 | // 4 | // Created by Rob Sussman on 8/4/15. 5 | // 6 | // 7 | 8 | #ifndef _RNBO_Utils_H_ 9 | #define _RNBO_Utils_H_ 10 | 11 | #include 12 | 13 | namespace RNBO { 14 | 15 | // implementation of make_unique() 16 | // taken from: https://isocpp.org/files/papers/N3656.txt 17 | // linked to from: http://stackoverflow.com/questions/7038357/make-unique-and-perfect-forwarding 18 | 19 | /** 20 | * @private 21 | */ 22 | template struct _Unique_if { 23 | typedef std::unique_ptr _Single_object; 24 | }; 25 | 26 | /** 27 | * @private 28 | */ 29 | template struct _Unique_if { 30 | typedef std::unique_ptr _Unknown_bound; 31 | }; 32 | 33 | /** 34 | * @private 35 | */ 36 | template struct _Unique_if { 37 | typedef void _Known_bound; 38 | }; 39 | 40 | /** 41 | * @private 42 | */ 43 | template 44 | typename _Unique_if::_Single_object 45 | make_unique(Args&&... args) { 46 | return std::unique_ptr(new T(std::forward(args)...)); 47 | } 48 | 49 | /** 50 | * @private 51 | */ 52 | template 53 | typename _Unique_if::_Unknown_bound 54 | make_unique(size_t n) { 55 | typedef typename std::remove_extent::type U; 56 | return std::unique_ptr(new U[n]()); 57 | } 58 | 59 | template 60 | typename _Unique_if::_Known_bound 61 | make_unique(Args&&...) = delete; 62 | 63 | 64 | // helper template prevents single-argument universal-reference constructor from acting like the copy constructor 65 | // see: http://ericniebler.com/2013/08/07/universal-references-and-the-copy-constructo/ 66 | template 67 | using disable_if_same_or_derived = 68 | typename std::enable_if::type>::value>::type; 69 | 70 | 71 | } // namespace RNBO 72 | 73 | 74 | #endif // #ifndef _RNBO_Utils_H_ 75 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/src/platforms/nostdlib/RNBO_LoggerNoStdLib.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RNBO_LoggerNoStdLib.cpp 3 | // Created: 12 July 2016 2:42:32pm 4 | // Author: jb 5 | // 6 | // 7 | 8 | #include "RNBO_Common.h" 9 | 10 | namespace RNBO { 11 | 12 | Logger consoleInstance; 13 | LoggerInterface* console = &consoleInstance; 14 | 15 | Logger::Logger() 16 | : _outputCallback(&Logger::defaultLogOutputFunction) 17 | { 18 | } 19 | 20 | Logger::~Logger() 21 | { 22 | } 23 | 24 | void Logger::setLoggerOutputCallback(OutputCallback* callback) 25 | { 26 | _outputCallback = callback ? callback : defaultLogOutputFunction; 27 | } 28 | 29 | void Logger::defaultLogOutputFunction(LogLevel level, const char* message) 30 | { 31 | const static char* levelStr[] = { "[INFO]", "[WARNING]", "[ERROR]" }; 32 | String formattedMessage = levelStr[level]; 33 | formattedMessage += "\t"; 34 | formattedMessage += message; 35 | formattedMessage += "\n"; 36 | platform->printMessage(formattedMessage.c_str()); 37 | } 38 | 39 | Logger& Logger::getInstance() 40 | { 41 | return consoleInstance; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "RNBO_UnitTests.h" 3 | #include "RNBO.h" 4 | #include "RNBO_MidiStreamParser.h" 5 | 6 | int main (int /*argc*/, char** /*argv*/) 7 | { 8 | RNBO::UnitTestRunner runner; 9 | runner.runAllTests(); 10 | for (auto i = 0; i < runner.getNumResults(); i++) { 11 | auto res = runner.getResult(i); 12 | if (res == nullptr || res->failures > 0) { 13 | return -1; 14 | } 15 | } 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /rnbo-custom-vst/export/rnbo/version.cmake: -------------------------------------------------------------------------------- 1 | #automatically generated 2 | SET(RNBO_VERSION_MAJOR 1) 3 | SET(RNBO_VERSION_MINOR 0) 4 | SET(RNBO_VERSION_PATCH 1) 5 | SET(RNBO_VERSION_PRERELEASE "null") 6 | SET(RNBO_VERSION "1.0.1") 7 | -------------------------------------------------------------------------------- /rnbo-custom-vst/img/envelope-mod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/rnbo-adc-workshop/6bb30058d47eef1e06beec350966805d2d18b593/rnbo-custom-vst/img/envelope-mod.png -------------------------------------------------------------------------------- /rnbo-custom-vst/img/voice-counting-logic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/rnbo-adc-workshop/6bb30058d47eef1e06beec350966805d2d18b593/rnbo-custom-vst/img/voice-counting-logic.png -------------------------------------------------------------------------------- /rnbo-custom-vst/src/RNBO_JuceAudioProcessorEditor.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | RNBO_JuceAudioProcessorEditor.h 5 | Created: 21 Sep 2015 11:50:17am 6 | Author: stb 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #ifndef RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 12 | #define RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 13 | 14 | #include "JuceHeader.h" 15 | #include "RNBO.h" 16 | 17 | namespace RNBO { 18 | 19 | //============================================================================== 20 | class RNBOAudioProcessorEditor : 21 | public AudioProcessorEditor, 22 | public AsyncUpdater, 23 | public RNBO::EventHandler, 24 | public juce::Slider::Listener, 25 | public juce::AudioProcessorListener 26 | { 27 | public: 28 | //============================================================================== 29 | RNBOAudioProcessorEditor (AudioProcessor* owner, CoreObject& rnboObject); 30 | ~RNBOAudioProcessorEditor() override; 31 | 32 | //============================================================================== 33 | void paint (Graphics&) override; 34 | void resized() override; 35 | 36 | void handleAsyncUpdate() override; 37 | 38 | void eventsAvailable() override; 39 | void handleParameterEvent(const RNBO::ParameterEvent& event) override; 40 | 41 | private: 42 | 43 | //============================================================================== 44 | CoreObject& _rnboObject; 45 | ParameterEventInterfaceUniquePtr _parameterInterface; 46 | 47 | juce::Slider overblowSlider; 48 | juce::Slider harmonicsSlider; 49 | ParameterIndex overblowParamIndex; 50 | ParameterIndex harmonicsParamIndex; 51 | }; 52 | 53 | } // namespace RNBO 54 | 55 | #endif // RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 56 | -------------------------------------------------------------------------------- /rnbo-custom-vst/src/RNBO_JuceAudioProcessorEditor_final.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | RNBO_JuceAudioProcessorEditor.h 5 | Created: 21 Sep 2015 11:50:17am 6 | Author: stb 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #ifndef RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 12 | #define RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 13 | 14 | #include "JuceHeader.h" 15 | #include "RNBO.h" 16 | #include "BlobComponent.h" 17 | 18 | namespace RNBO { 19 | 20 | //============================================================================== 21 | class RNBOAudioProcessorEditor : 22 | public AudioProcessorEditor, 23 | public AsyncUpdater, 24 | public RNBO::EventHandler, 25 | public juce::Slider::Listener, 26 | public juce::AudioProcessorListener 27 | { 28 | public: 29 | //============================================================================== 30 | RNBOAudioProcessorEditor (AudioProcessor* owner, CoreObject& rnboObject); 31 | ~RNBOAudioProcessorEditor() override; 32 | 33 | //============================================================================== 34 | void paint (Graphics&) override; 35 | void resized() override; 36 | 37 | void handleAsyncUpdate() override; 38 | 39 | void eventsAvailable() override; 40 | void handleParameterEvent(const RNBO::ParameterEvent& event) override; 41 | void handleMessageEvent(const MessageEvent& event) override; 42 | 43 | // Slider listener 44 | void sliderValueChanged (juce::Slider* slider) override; 45 | 46 | // AudioProcessorListener 47 | void audioProcessorChanged (AudioProcessor*, const ChangeDetails&) override; 48 | void audioProcessorParameterChanged (AudioProcessor*, int parameterIndex, float value) override; 49 | 50 | private: 51 | 52 | //============================================================================== 53 | CoreObject& _rnboObject; 54 | ParameterEventInterfaceUniquePtr _parameterInterface; 55 | 56 | juce::Slider overblowSlider; 57 | juce::Slider harmonicsSlider; 58 | ParameterIndex overblowParamIndex; 59 | ParameterIndex harmonicsParamIndex; 60 | 61 | Array blobs; 62 | }; 63 | 64 | } // namespace RNBO 65 | 66 | #endif // RNBO_JUCEAUDIOPROCESSOREDITOR_H_INCLUDED 67 | -------------------------------------------------------------------------------- /rnbo-rpi-interface/README.md: -------------------------------------------------------------------------------- 1 | # rnbo-rpi-interface 2 | 3 | This example is going to be a little bit different. The idea is to try to 4 | control the motors connected to this Raspberry Pi, but with a synthesizer. 5 | 6 | ## Directions 7 | 8 | 1. You'll see at the start of the workshop that something more complex is 9 | currently running on the Raspberry Pi, but we'll do something simpler in this 10 | workshop. 11 | 2. Let's start with the RNBO intro synth again. 12 | 3. We're going to modify this slightly. Specifically, we're going to wrap the 13 | polyphonic parent patcher in a monophonic parent. We're doing this so that the 14 | parent patcher can have a single `outport` that will express the state of the 15 | polyphonic child patch. 16 | 4. Using the same trick as before, turn the envelopes of the polyphonic voices 17 | into a boolean signal, in order to create a single number that expresses how 18 | many voices are active. 19 | 5. Now, use some slightly fancy logic to make sure that the head lifts up 20 | whenever you press a new note. 21 | 22 | ![](./img/fish-head-logic.png) 23 | 24 | The basic idea is, whenever the voice count goes to zero, make the head go 25 | back down. Otherwise, make it go down, then very quickly back up, whenever 26 | a new voice becomes active. 27 | 28 | 6. With our runner program running on the pi, we can actually use `udpsend` 29 | to test. 30 | 7. With all that ready, we can do the final steps to run our code on the Raspberry Pi. 31 | I'm going to add the Node script to the Raspberry Pi's crontab, so it will 32 | start on its own when we restart the raspberry pi. 33 | 8. You'll see me add some somewhat dumb code to the Raspberry Pi to wait 34 | 10 seconds before sending a message to `/rnbo/listeners/add`. I've tried 35 | doing this in a better, smarter way, but for now this is what works. 36 | 8. Moment of truth, we upload our RNBO patch to the Pi and restart it. 37 | 9. It works! (or not) -------------------------------------------------------------------------------- /rnbo-rpi-interface/img/fish-head-logic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cycling74/rnbo-adc-workshop/6bb30058d47eef1e06beec350966805d2d18b593/rnbo-rpi-interface/img/fish-head-logic.png -------------------------------------------------------------------------------- /rnbo-rpi-interface/src/gpio.js: -------------------------------------------------------------------------------- 1 | const Gpio = require('../onoff').Gpio; 2 | const motorLeft = new Gpio(27, 'out'); 3 | const motorRight = new Gpio(27, 'out'); 4 | 5 | const { Server, Client } = require('node-osc'); 6 | 7 | // Add your server to the list of listeners 8 | const client = new Client('127.0.0.1', 1234); 9 | client.send('/rnbo/listeners/add', "127.0.0.1:4321", () => { 10 | client.close(); 11 | }); 12 | 13 | // Now listen for OSC messages 14 | let oscServer = new Server(4321, '0.0.0.0', () => { 15 | console.log('OSC Server is listening'); 16 | }); 17 | 18 | oscServer.on('message', function (msg, contents) { 19 | if (msg === "/rnbo/inst/0/messages/out/body") { 20 | if (contents === 1) { 21 | motorLeft.writeSync(1); 22 | motorRight.writeSync(0); 23 | } else if (contents === 2) { 24 | motorLeft.writeSync(1); 25 | motorRight.writeSync(0); 26 | } else { 27 | motorLeft.writeSync(0); 28 | motorRight.writeSync(0); 29 | } 30 | } 31 | }); 32 | -------------------------------------------------------------------------------- /rnbo-web-app/export/dependencies.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /rnbo-web-app/export/patch.export.license: -------------------------------------------------------------------------------- 1 | Cycling '74 License for Max-Generated Code for Export 2 | Copyright (c) 2022 Cycling '74 3 | The code that Max generates automatically and that end users are capable of exporting and using, and any 4 | associated documentation files (the “Software”) is a work of authorship for which Cycling '74 is the author 5 | and owner for copyright purposes. A license is hereby granted, free of charge, to any person obtaining a 6 | copy of the Software (“Licensee”) to use, copy, modify, merge, publish, and distribute copies of the Software, 7 | and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 8 | The Software is licensed to Licensee only for non-commercial use. Users who wish to make commercial use of the 9 | Software must contact the copyright owner to determine if a license for commercial use is available, and the 10 | terms and conditions for same, which may include fees or royalties. For commercial use, please send inquiries 11 | to licensing@cycling74.com. The determination of whether a use is commercial use or non-commercial use is based 12 | upon the use, not the user. The Software may be used by individuals, institutions, governments, corporations, or 13 | other business whether for-profit or non-profit so long as the use itself is not a commercialization of the 14 | materials or a use that generates or is intended to generate income, revenue, sales or profit. 15 | The above copyright notice and this license shall be included in all copies or substantial portions of the Software. 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO 17 | THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 19 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | 22 | Please see https://support.cycling74.com/hc/en-us/articles/10730637742483-RNBO-Export-Licensing-FAQ for additional information -------------------------------------------------------------------------------- /rnbo-web-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | RNBO Web Export 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 |
20 |

Parameters

21 | No parameters 22 |
23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /rnbo-web-app/style/style.css: -------------------------------------------------------------------------------- 1 | canvas { 2 | position: absolute; 3 | top: 0; 4 | left: 0; 5 | z-index: -1; 6 | } --------------------------------------------------------------------------------