Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
reviews:
path_filters:
- "!7.x/src/stk/src/**"
- "!7.x/src/stk/include/**"
- "!7.x/src/stk/rawwaves/**"
13 changes: 11 additions & 2 deletions .github/workflows/plugins_build_7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ jobs:
build/src/websockets/*.so \
build/src/hdf5/*.so \
build/src/py/*.so \
build/src/OpenCL/*.so package/
build/src/OpenCL/*.so \
build/src/stk/*.so package/
mkdir -p package/stk/rawwaves
cp 7.x/src/stk/rawwaves/*.raw package/stk/rawwaves/

- name: Upload plugins
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -219,7 +222,10 @@ jobs:
build/src/websockets/*.dylib \
build/src/hdf5/*.dylib \
build/src/py/*.dylib \
build/src/OpenCL/*.dylib package/
build/src/OpenCL/*.dylib \
build/src/stk/*.dylib package/
mkdir -p package/stk/rawwaves
cp 7.x/src/stk/rawwaves/*.raw package/stk/rawwaves/

- name: Upload plugins
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -319,6 +325,9 @@ jobs:
if (Test-Path $vcpkgBin) {
Copy-Item (Join-Path $vcpkgBin '*.dll') -Destination $package -ErrorAction SilentlyContinue
}
$rawwaves = Join-Path $package 'stk/rawwaves'
New-Item -ItemType Directory -Force -Path $rawwaves | Out-Null
Copy-Item '7.x\src\stk\rawwaves\*.raw' -Destination $rawwaves

- name: Upload plugins
uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions 7.x/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,4 @@ add_subdirectory(./src/wiimote)
add_subdirectory(./src/p5glove)
add_subdirectory(./src/CUDA)
add_subdirectory(./src/OpenCL)
add_subdirectory(./src/stk)
34 changes: 33 additions & 1 deletion 7.x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Currently, the plugins available in this tree are
- OpenCL (requires the OpenCL headers/loader; see note below)
**cladsyn**

- STK (port of the Synthesis ToolKit instruments; STK 4.6.2 is vendored under this directory, see note below)
**STKBandedWG STKBeeThree STKBlowBotl STKBlowHole STKBowed STKBrass STKClarinet STKDrummer STKFlute STKFMVoices STKHevyMetl STKMandolin STKModalBar STKMoog STKPercFlut STKPlucked STKResonate STKRhodey STKSaxofony STKShakers STKSimple STKSitar STKStifKarp STKTubeBell STKVoicForm STKWhistle STKWurley**


Fluid settings opcodes
---
Expand Down Expand Up @@ -123,6 +126,34 @@ compile-only (the hosted runners have no OpenCL device) and it is included in
the Linux, macOS and Windows release packages.


STK opcodes
---

The `STK` opcodes are a port of the Csound 6.x plugin to the Csound 7 plugin
API. They expose the instruments of Perry Cook and Gary Scavone's Synthesis
ToolKit in C++ (STK), each named `STK` followed by the STK class, e.g.
`STKSitar`. All of them share the same signature:

```
aout STKName ifrequency igain {kcontroller0, kvalue0, ..., kcontrollerN, kvalueN}
```

The STK sources are **vendored under this directory** (`include/`, `src/` and
`rawwaves/`) and built from source, so no external STK installation is needed
and the result is independent of any system or package-manager STK. The
vendored copy carries a fix for the sample buildup reported in
[csound/plugins#4](https://github.com/csound/plugins/issues/4): the noise
modulation of the sitar delay line in `Sitar::setFrequency`, which could make
`STKSitar` build up clipped output over time, has been removed.

It is built by default; configure with `-DBUILD_STK_OPCODES=OFF` to exclude
it. The wavetables the instruments need are installed alongside the plugin
(under `stk/rawwaves`). At run time the `RAWWAVE_PATH` environment variable,
if set, overrides the built-in default location; otherwise the installed
`rawwaves` directory is used. The plugin is included in the Linux, macOS and
Windows release packages.


Release binaries and macOS architecture
--------------

Expand Down Expand Up @@ -182,7 +213,8 @@ plugin from the build process, one can pass an option to the cmake command.
The options are `BUILD_CHUA_OPCODES`, `BUILD_CUDA_OPCODES`,
`BUILD_OPENCL_OPCODES`, `BUILD_FLUID_OPCODES`,
`BUILD_IMAGE_OPCODES`, `BUILD_HDF5_OPCODES`, `BUILD_LINEAR_ALGEBRA_OPCODES`,
`BUILD_P5GLOVE_OPCODES`, `BUILD_WIIMOTE_OPCODES`, `BUILD_WEBSOCKET_OPCODE` and
`BUILD_P5GLOVE_OPCODES`, `BUILD_STK_OPCODES`, `BUILD_WIIMOTE_OPCODES`,
`BUILD_WEBSOCKET_OPCODE` and
`BUILD_PYTHON_OPCODES`. For example, to
exclude the chua plugin, the `cmake` command would be:

Expand Down
28 changes: 28 additions & 0 deletions 7.x/src/stk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
option(BUILD_STK_OPCODES "Build the stk opcodes" ON)

# The STK sources are bundled under this directory (include/, src/ and
# rawwaves/) so that a patched copy is always built, independent of any system
# or package-manager STK installation. In particular, src/Sitar.cpp carries a
# fix for the sample buildup described in csound/plugins#4.
if(BUILD_STK_OPCODES)
file(GLOB stk_srcs "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
list(APPEND stk_srcs "${CMAKE_CURRENT_SOURCE_DIR}/stkOpcodes.cpp")

make_plugin(stkops "${stk_srcs}")
target_include_directories(stkops PRIVATE
${CSOUND_INCLUDE_DIRS}
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/src")
target_compile_definitions(stkops PRIVATE BUILD_PLUGINS)

# Install the rawwaves used by the STK instruments and make them the
# default raw wave path; the RAWWAVE_PATH environment variable overrides it.
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/rawwaves"
DESTINATION "${PLUGIN_INSTALL_DIR}/stk")
if(PLUGIN_INSTALL_DIR)
target_compile_definitions(stkops PRIVATE
DEFAULT_RAWWAVE_PATH="${PLUGIN_INSTALL_DIR}/stk/rawwaves")
endif()

message(STATUS "Building STK opcodes")
endif()
27 changes: 27 additions & 0 deletions 7.x/src/stk/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The Synthesis ToolKit in C++ (STK)

Copyright (c) 1995-2021 Perry R. Cook and Gary P. Scavone

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

Any person wishing to distribute modifications to the Software is
asked to send the modifications to the original developer so that they
can be incorporated into the canonical version. This is, however, not
a binding provision of this license.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading
Loading