├── 6.x ├── src │ ├── py │ │ ├── examples │ │ │ ├── ievent.sco │ │ │ ├── pycallt.sco │ │ │ ├── pyeval.sco │ │ │ ├── pyrun.sco │ │ │ ├── pyassign.sco │ │ │ ├── pycall1.sco │ │ │ ├── pycall2.sco │ │ │ ├── pycall3.sco │ │ │ ├── pyexect1.py │ │ │ ├── pyexect2.py │ │ │ ├── pyexect3.py │ │ │ ├── pyexect4.py │ │ │ ├── pyexec4.py │ │ │ ├── pyexect.sco │ │ │ ├── pyrunt.sco │ │ │ ├── pyexec.sco │ │ │ ├── pyexec2.py │ │ │ ├── pyexec3.py │ │ │ ├── pyassign.orc │ │ │ ├── pyexec1.py │ │ │ ├── pyeval.orc │ │ │ ├── pyexec.orc │ │ │ ├── cabrera │ │ │ │ ├── python0.csd │ │ │ │ ├── pythonlocal.csd │ │ │ │ ├── python5.csd │ │ │ │ ├── python2.csd │ │ │ │ ├── python3.csd │ │ │ │ ├── python4.csd │ │ │ │ ├── python1.csd │ │ │ │ ├── pythonlocal2.csd │ │ │ │ └── pythonmarkov.csd │ │ │ ├── pyrunt.orc │ │ │ ├── pyrun.orc │ │ │ ├── pycall1.orc │ │ │ ├── pyexect.orc │ │ │ ├── pyrun.csd │ │ │ ├── pycall2.orc │ │ │ ├── embeddedCtcsound.csd │ │ │ ├── ievent.orc │ │ │ ├── pycall3.orc │ │ │ └── pycallt.orc │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── src │ │ │ ├── README.md │ │ │ ├── pythonhelper.h │ │ │ ├── pythonopcodes.h │ │ │ └── pyx.auto.h │ ├── opencl │ │ ├── libcl.dylib │ │ ├── libclconv.dylib │ │ ├── build.sh │ │ ├── buildc.sh │ │ ├── buildcpp.sh │ │ ├── libclconv.dylib.dSYM │ │ │ └── Contents │ │ │ │ ├── Resources │ │ │ │ └── DWARF │ │ │ │ │ └── libclconv.dylib │ │ │ │ └── Info.plist │ │ ├── clconv.csd │ │ ├── cladsyn.csd │ │ └── CMakeLists.txt │ ├── fluidOpcodes │ │ ├── Android │ │ │ ├── .gitignore │ │ │ ├── build.sh │ │ │ └── jni │ │ │ │ ├── Application.mk │ │ │ │ └── Android.mk │ │ ├── CMakeLists.txt │ │ ├── test.csd │ │ ├── fluidOpcodes.html │ │ └── fluidOpcodes.h │ ├── AbletonLinkOpcodes │ │ ├── jni │ │ │ ├── Application.mk │ │ │ └── Android.mk │ │ └── CMakeLists.txt │ ├── image │ │ ├── README.md │ │ ├── CMakeLists.txt │ │ └── imageOpcodes.h │ ├── stk │ │ ├── Android │ │ │ └── jni │ │ │ │ ├── Application.mk │ │ │ │ └── Android.mk │ │ └── CMakeLists.txt │ ├── CUDA │ │ ├── pvsops2-build.sh │ │ ├── cudaconv.csd │ │ ├── cuda_sliding_example.csd │ │ ├── cuda_pvs_example.csd │ │ ├── cudadsyn_pvs_example.csd │ │ ├── build.sh │ │ ├── cudapconv.csd │ │ ├── CMakeLists.txt │ │ └── convf.cu │ ├── wiimote │ │ ├── CMakeLists.txt │ │ └── wii_mac.h │ ├── mp3 │ │ ├── CMakeLists.txt │ │ └── mp3out.c │ ├── linear_algebra │ │ └── CMakeLists.txt │ ├── p5glove │ │ ├── p5g_mac │ │ ├── CMakeLists.txt │ │ └── libp5glove │ │ │ ├── macosx_usb_hid.h │ │ │ └── usb_hid.h │ ├── chua │ │ └── CMakeLists.txt │ ├── faustcsound │ │ ├── README.md │ │ └── CMakeLists.txt │ ├── jackops │ │ ├── CMakeLists.txt │ │ ├── jacko_test.csd │ │ ├── jackTransport.c │ │ └── cs_jack.h │ ├── widgets │ │ ├── virtual_keyboard │ │ │ ├── Program.cpp │ │ │ ├── Program.hpp │ │ │ ├── SliderData.cpp │ │ │ ├── SliderData.hpp │ │ │ ├── keyboard.map │ │ │ ├── Bank.hpp │ │ │ ├── FLTKKeyboard.hpp │ │ │ ├── SliderBank.hpp │ │ │ ├── FLTKKeyboardWidget.hpp │ │ │ ├── FLTKKeyboardWindow.hpp │ │ │ ├── KeyboardMapping.hpp │ │ │ └── SliderBank.cpp │ │ ├── CMakeLists.txt │ │ └── winFLTK.h │ ├── websockets │ │ ├── CMakeLists.txt │ │ └── WebSocketOpcode.h │ └── hdf5 │ │ ├── CMakeLists.txt │ │ └── HDF5IO.h ├── installer │ ├── win64 │ │ ├── Output │ │ │ └── Csound6-Plugins-Windows_x86_64-1.0.exe │ │ └── buildWindows.sh │ └── macosx │ │ ├── scripts │ │ └── postinstall │ │ └── release-build.sh ├── x64-windows-csound.cmake ├── vcpkg.json ├── cmake │ ├── Modules │ │ ├── FindGMM.cmake │ │ ├── FindLAME.cmake │ │ ├── FindSTK.cmake │ │ ├── FindFLUIDSYNTH.cmake │ │ ├── FindFAUST.cmake │ │ ├── FindCSOUND.cmake │ │ └── FindEIGEN3.cmake │ └── CompilerOptimizations.cmake └── README.md ├── 7.x ├── src │ └── py │ │ ├── examples │ │ ├── ievent.sco │ │ ├── pycallt.sco │ │ ├── pyeval.sco │ │ ├── pyrun.sco │ │ ├── pyassign.sco │ │ ├── pycall1.sco │ │ ├── pycall2.sco │ │ ├── pycall3.sco │ │ ├── pyexect1.py │ │ ├── pyexect2.py │ │ ├── pyexect3.py │ │ ├── pyexect4.py │ │ ├── pyexec4.py │ │ ├── pyexect.sco │ │ ├── pyrunt.sco │ │ ├── pyexec.sco │ │ ├── pyexec2.py │ │ ├── pyexec3.py │ │ ├── pyassign.orc │ │ ├── pyexec1.py │ │ ├── pyeval.orc │ │ ├── pyexec.orc │ │ ├── cabrera │ │ │ ├── python0.csd │ │ │ ├── pythonlocal.csd │ │ │ ├── python5.csd │ │ │ ├── python2.csd │ │ │ ├── python3.csd │ │ │ ├── python4.csd │ │ │ ├── python1.csd │ │ │ ├── pythonlocal2.csd │ │ │ └── pythonmarkov.csd │ │ ├── pyrunt.orc │ │ ├── pyrun.orc │ │ ├── pycall1.orc │ │ ├── pyexect.orc │ │ ├── pyrun.csd │ │ ├── pycall2.orc │ │ ├── embeddedCtcsound.csd │ │ ├── ievent.orc │ │ ├── pycall3.orc │ │ └── pycallt.orc │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ └── src │ │ ├── README.md │ │ ├── pythonopcodes.h │ │ ├── pythonhelper.h │ │ └── pyx.auto.h ├── cmake │ ├── Modules │ │ ├── FindGMM.cmake │ │ ├── FindLAME.cmake │ │ ├── FindSTK.cmake │ │ ├── FindFLUIDSYNTH.cmake │ │ ├── FindFAUST.cmake │ │ ├── FindCSOUND.cmake │ │ └── FindEIGEN3.cmake │ └── CompilerOptimizations.cmake └── README.md ├── .gitignore ├── .vscode └── settings.json ├── .gitmodules ├── .editorconfig ├── README.md └── .github └── workflows └── plugins_build.yml /6.x/src/py/examples/ievent.sco: -------------------------------------------------------------------------------- 1 | f0 60 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pycallt.sco: -------------------------------------------------------------------------------- 1 | i1 0 10 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyeval.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.5 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyrun.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.1 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/ievent.sco: -------------------------------------------------------------------------------- 1 | f0 60 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pycallt.sco: -------------------------------------------------------------------------------- 1 | i1 0 10 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyeval.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.5 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyrun.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.1 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyassign.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.01 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pycall1.sco: -------------------------------------------------------------------------------- 1 | i1 0 10 0.01 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pycall2.sco: -------------------------------------------------------------------------------- 1 | i1 0 10 0.01 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pycall3.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.1 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexect1.py: -------------------------------------------------------------------------------- 1 | print 'zum' 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexect2.py: -------------------------------------------------------------------------------- 1 | print 'pa' 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexect3.py: -------------------------------------------------------------------------------- 1 | print 'zi' 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexect4.py: -------------------------------------------------------------------------------- 1 | print 'zut' 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyassign.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.01 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pycall1.sco: -------------------------------------------------------------------------------- 1 | i1 0 10 0.01 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pycall2.sco: -------------------------------------------------------------------------------- 1 | i1 0 10 0.01 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pycall3.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.1 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexect1.py: -------------------------------------------------------------------------------- 1 | print('zum') 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexect2.py: -------------------------------------------------------------------------------- 1 | print('pa') 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexect3.py: -------------------------------------------------------------------------------- 1 | print('zi') 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexect4.py: -------------------------------------------------------------------------------- 1 | print('zut') 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexec4.py: -------------------------------------------------------------------------------- 1 | print(message) 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexect.sco: -------------------------------------------------------------------------------- 1 | i1 0 5 2 | i1 0 5 3 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyrunt.sco: -------------------------------------------------------------------------------- 1 | i1 0 5 2 | i1 0 5 3 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexec4.py: -------------------------------------------------------------------------------- 1 | print(message) 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexect.sco: -------------------------------------------------------------------------------- 1 | i1 0 5 2 | i1 0 5 3 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyrunt.sco: -------------------------------------------------------------------------------- 1 | i1 0 5 2 | i1 0 5 3 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexec.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.01 2 | i1 0 0.01 3 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexec.sco: -------------------------------------------------------------------------------- 1 | i1 0 0.01 2 | i1 0 0.01 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | dist 3 | csound6-plugins-win_x86_64-* 4 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexec2.py: -------------------------------------------------------------------------------- 1 | print('your answer is "%s"' % answer) 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexec2.py: -------------------------------------------------------------------------------- 1 | print('your answer is "%s"' % answer) 2 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexec3.py: -------------------------------------------------------------------------------- 1 | message = 'a private random number: %f' % random.random() 2 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexec3.py: -------------------------------------------------------------------------------- 1 | message = 'a private random number: %f' % random.random() 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "lame.h": "c" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /6.x/src/opencl/libcl.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csound/plugins/HEAD/6.x/src/opencl/libcl.dylib -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "vcpkg"] 2 | path = 6.x/vcpkg 3 | url = https://github.com/microsoft/vcpkg.git 4 | -------------------------------------------------------------------------------- /6.x/src/opencl/libclconv.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csound/plugins/HEAD/6.x/src/opencl/libclconv.dylib -------------------------------------------------------------------------------- /6.x/src/opencl/build.sh: -------------------------------------------------------------------------------- 1 | cc -O3 -dynamiclib -o libclop1.dylib -DUSE_DOUBLE -D_FORTIFY_SOURCE=0 cladsynth.c -I../../include -framework OpenCL -Wno-deprecated-declarations 2 | -------------------------------------------------------------------------------- /6.x/installer/win64/Output/Csound6-Plugins-Windows_x86_64-1.0.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csound/plugins/HEAD/6.x/installer/win64/Output/Csound6-Plugins-Windows_x86_64-1.0.exe -------------------------------------------------------------------------------- /6.x/src/fluidOpcodes/Android/.gitignore: -------------------------------------------------------------------------------- 1 | *DS_Store 2 | obj 3 | libs 4 | bin 5 | gen 6 | src/csnd* 7 | *swp 8 | jni/csound_orc* 9 | jni/csound_prelex.c 10 | jni/java_interface* 11 | -------------------------------------------------------------------------------- /6.x/src/opencl/buildc.sh: -------------------------------------------------------------------------------- 1 | set -x 2 | c++ -g -O3 -dynamiclib -o libclconv.dylib -std=c++11 -DUSE_DOUBLE -D_FORTIFY_SOURCE=0 clconv.cpp -I../../include -framework OpenCL -Wno-deprecated-declarations 3 | -------------------------------------------------------------------------------- /6.x/src/opencl/buildcpp.sh: -------------------------------------------------------------------------------- 1 | set -x 2 | c++ -O3 -dynamiclib -o libclopp.dylib -DUSE_DOUBLE -D_FORTIFY_SOURCE=0 cladsynth2.cpp -I../../include -framework OpenCL -Wno-deprecated-declarations -std=c++11 3 | -------------------------------------------------------------------------------- /6.x/src/opencl/libclconv.dylib.dSYM/Contents/Resources/DWARF/libclconv.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/csound/plugins/HEAD/6.x/src/opencl/libclconv.dylib.dSYM/Contents/Resources/DWARF/libclconv.dylib -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | insert_final_newline = true 5 | trim_trailing_whitespace = true 6 | end_of_line = lf 7 | indent_style = space 8 | indent_size = 4 9 | 10 | [*.yml] 11 | indent_size = 2 12 | -------------------------------------------------------------------------------- /6.x/src/fluidOpcodes/Android/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | export ANDROID_NDK_ROOT=$NDK 4 | export NDK_MODULE_PATH=../../../../android 5 | 6 | $ANDROID_NDK_ROOT/ndk-build TARGET_PLATFORM=android-9 $@ 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CSOUND PLUGINS 2 | === 3 | 4 | This repository contains the code for Csound plugins that require 5 | external dependencies, as well as code for new third-party contributed 6 | plugins. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /6.x/src/AbletonLinkOpcodes/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi-v7a arm64-v8a 2 | APP_CPPFLAGS += -fexceptions -frtti 3 | APP_OPTIM := release 4 | APP_PLATFORM := android-21 5 | APP_STL := c++_shared 6 | NDK_TOOLCHAIN_VERSION := clang 7 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyassign.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | instr 1 9 | 10 | k1 rand 1000 11 | pyassign "a", k1 12 | pyrun "print(a)" 13 | endin 14 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyassign.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | instr 1 9 | 10 | k1 rand 1000 11 | pyassign "a", k1 12 | pyrun "print(a)" 13 | endin 14 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexec1.py: -------------------------------------------------------------------------------- 1 | import time, os 2 | 3 | print() 4 | print("Welcome to Csound!") 5 | 6 | try: 7 | s = ', %s?' % os.getenv('USER') 8 | except: 9 | s = '?' 10 | 11 | print('What sound do you want to hear today%s' % s) 12 | answer = input('--> ') 13 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexec1.py: -------------------------------------------------------------------------------- 1 | import time, os 2 | 3 | print() 4 | print("Welcome to Csound!") 5 | 6 | try: 7 | s = ', %s?' % os.getenv('USER') 8 | except: 9 | s = '?' 10 | 11 | print('What sound do you want to hear today%s' % s) 12 | answer = input('--> ') 13 | -------------------------------------------------------------------------------- /6.x/src/image/README.md: -------------------------------------------------------------------------------- 1 | Image opcodes 2 | ======= 3 | 4 | To build the image opcodes, you will need the libpng library, which can be easily built 5 | and installed from sources using CMake, see [http://www.libpng.org/pub/png/libpng.html](http://www.libpng.org/pub/png/libpng.html) 6 | 7 | -------------------------------------------------------------------------------- /6.x/src/fluidOpcodes/Android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi-v7a arm64-v8a 2 | APP_CPPFLAGS += -fexceptions -frtti 3 | APP_OPTIM := release 4 | APP_PLATFORM := android-21 5 | #APP_STL := gnustl_shared 6 | #NDK_TOOLCHAIN_VERSION := 4.9 7 | APP_STL := c++_shared 8 | NDK_TOOLCHAIN_VERSION := clang 9 | -------------------------------------------------------------------------------- /6.x/x64-windows-csound.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x64) 2 | set(VCPKG_CRT_LINKAGE dynamic) 3 | 4 | if(${PORT} MATCHES "fluidsynth|glib|zlib|pcre|libffi|gettext|libiconv|portmidi|portaudio|liblo") 5 | set(VCPKG_LIBRARY_LINKAGE dynamic) 6 | else() 7 | set(VCPKG_LIBRARY_LINKAGE static) 8 | endif() 9 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyeval.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni "from random import random" 9 | 10 | instr 1 11 | 12 | pyrun "a = random()" 13 | k1 pyeval "a" 14 | printk 0.1, k1 15 | endin 16 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyeval.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni "from random import random" 9 | 10 | instr 1 11 | 12 | pyrun "a = random()" 13 | k1 pyeval "a" 14 | printk 0.1, k1 15 | endin 16 | -------------------------------------------------------------------------------- /6.x/src/stk/Android/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi-v7a arm64-v8a 2 | APP_CPPFLAGS += -fexceptions -frtti 3 | APP_OPTIM := release 4 | APP_PLATFORM := android-21 5 | #APP_STL := gnustl_shared 6 | #NDK_TOOLCHAIN_VERSION := 4.9 7 | APP_STL := c++_shared 8 | NDK_TOOLCHAIN_VERSION := clang 9 | APP_MODULES := stk 10 | -------------------------------------------------------------------------------- /6.x/src/CUDA/pvsops2-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # use -Xptxas="-v" to check register usage and --maxrregcount 32 to limit it 3 | echo "building cuda opcodes ..." 4 | nvcc -O3 -shared -o libcudapvs2.dylib pvsops2.cu -use_fast_math -g -I../../debug/CsoundLib64.framework/Headers -arch=sm_30 -I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft 5 | echo "...done" 6 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexec.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni "import random" 9 | 10 | pyexeci "pyexec1.py" 11 | 12 | instr 1 13 | 14 | pyexec "pyexec2.py" 15 | 16 | pylexeci "pyexec3.py" 17 | pylexec "pyexec4.py" 18 | 19 | endin 20 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexec.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni "import random" 9 | 10 | pyexeci "pyexec1.py" 11 | 12 | instr 1 13 | 14 | pyexec "pyexec2.py" 15 | 16 | pylexeci "pyexec3.py" 17 | pylexec "pyexec4.py" 18 | 19 | endin 20 | -------------------------------------------------------------------------------- /6.x/installer/macosx/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -x 3 | if [ -d "$HOME/Library/csound/6.0/plugins64/" ]; then 4 | mv /tmp/csound/*.dylib $HOME/Library/csound/6.0/plugins64/. 5 | else 6 | mkdir -p $HOME/Library/csound/6.0/plugins64 7 | mv /tmp/csound/*.dylib $HOME/Library/csound/6.0/plugins64/. 8 | fi 9 | chown -R $USER $HOME/Library/csound 10 | 11 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/python0.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr=44100 8 | ksmps=128 9 | nchnls=2 10 | 11 | pyinit ;Start python interpreter 12 | 13 | pyruni "print(44100)" 14 | 15 | instr 1 16 | endin 17 | 18 | 19 | 20 | 21 | i 1 0 0.1 22 | 23 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/python0.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac -m0 4 | 5 | 6 | 7 | sr=44100 8 | ksmps=128 9 | nchnls=2 10 | 11 | pyinit ;Start python interpreter 12 | 13 | pyruni "print(44100)" 14 | 15 | instr 1 16 | endin 17 | 18 | 19 | 20 | 21 | i 1 0 0.1 22 | 23 | -------------------------------------------------------------------------------- /6.x/src/wiimote/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_WIIMOTE_OPCODES "Build the Wiimote opcodes" ON) 2 | 3 | find_path(WIIUSE_INCLUDE_DIR wiiuse.h /usr/local/include) 4 | find_library(WIIUSE_LIB wiiuse) 5 | check_deps(BUILD_WIIMOTE_OPCODES WIIUSE_LIB) 6 | 7 | if(BUILD_WIIMOTE_OPCODES) 8 | make_plugin(wiimote wiimote.c ${WIIUSE_LIB}) 9 | target_include_directories(wiimote PRIVATE ${WIIUSE_INCLUDE_DIR} ${CSOUND_INCLUDE_DIR}) 10 | endif() 11 | -------------------------------------------------------------------------------- /6.x/src/CUDA/cudaconv.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | --opcode-lib=libcudaop4.dylib 4 | 5 | 6 | ksmps = 128 7 | i1 ftgen 1,0,1024,1,"/Users/victor/audio/church.wav",0,0,1 8 | 9 | instr 1 10 | 11 | asig diskin2 "/Users/victor/audio/cornetto.wav",1,01 12 | a1 cudaconv asig,1 13 | ;a1 dconv asig,ftlen(1),1 14 | out a1/20 15 | endin 16 | 17 | 18 | 19 | i1 0 10 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /6.x/src/CUDA/cuda_sliding_example.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | --opcode-lib=./libcudaop3.dylib 4 | 5 | 6 | 7 | ksmps = 64 8 | 0dbfs = 1 9 | 10 | instr 1 11 | asig,adp diskin "metheny.wav",1,0,1 12 | amod = p4; oscil:a(2,3) 13 | asig2 = cudasliding(asig,amod,p5) 14 | asig = linenr(asig2,0.005,0.01,0.01) 15 | out(asig*0.5) 16 | endin 17 | 18 | 19 | 20 | i1 0 60 1 512 21 | ;i1 0 5 0.5 1024 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /6.x/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", 3 | "name": "csound-plugins", 4 | "version-string": "6.16.2", 5 | "builtin-baseline": "f6a5d4e8eb7476b8d7fc12a56dff300c1c986131", 6 | "dependencies": [ 7 | "ableton-link", 8 | "eigen3", 9 | "fltk", 10 | "fluidsynth", 11 | "hdf5", 12 | "libstk", 13 | "libwebsockets", 14 | "mp3lame", 15 | "zlib" 16 | ] 17 | } -------------------------------------------------------------------------------- /6.x/src/opencl/clconv.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | --opcode-lib=./libclconv.dylib 4 | 5 | 6 | 7 | ksmps = 1 8 | 0dbfs = 1 9 | 10 | gift ftgen 0, 0, 0, 1, "pianoc2.wav", 0,0,1 11 | ;tablew 1, 0, gift 12 | 13 | instr 1 14 | ipsize = 512 15 | idev = 1; /* device number */ 16 | ain mpulse 1, 7 17 | asig clconv ain, gift, ipsize, idev 18 | out(asig) 19 | 20 | endin 21 | 22 | 23 | 24 | 25 | i1 0 10 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /6.x/src/fluidOpcodes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_FLUID_OPCODES "Build the fluidsynth opcodes" ON) 2 | 3 | find_package(FLUIDSYNTH) 4 | check_deps(BUILD_FLUID_OPCODES FLUIDSYNTH_FOUND) 5 | 6 | if(BUILD_FLUID_OPCODES AND FLUIDSYNTH_FOUND) 7 | make_plugin(fluidOpcodes fluidOpcodes.cpp) 8 | target_include_directories(fluidOpcodes PRIVATE ${FLUIDSYNTH_INCLUDE_DIR}) 9 | target_include_directories(fluidOpcodes PRIVATE ${CSOUND_INCLUDE_DIR}) 10 | target_link_libraries(fluidOpcodes ${FLUIDSYNTH_LIBRARIES}) 11 | endif() 12 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/pythonlocal.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | gkprint init 0 8 | 9 | instr 1 10 | ivalue init p4 11 | ktrig changed gkprint 12 | if (ktrig == 1) then 13 | printk 0.5, ivalue 14 | endif 15 | endin 16 | 17 | instr 2 18 | gkprint init 1 19 | endin 20 | 21 | 22 | 23 | 24 | ; p4 25 | i 1 0 5 100 26 | i 1 1 5 200 27 | i 1 2 5 300 28 | i 1 3 5 400 29 | 30 | i 2 3 1 31 | 32 | 33 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/pythonlocal.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac -m0 4 | 5 | 6 | 7 | gkprint init 0 8 | 9 | instr 1 10 | ivalue init p4 11 | ktrig changed gkprint 12 | if (ktrig == 1) then 13 | printk 0.5, ivalue 14 | endif 15 | endin 16 | 17 | instr 2 18 | gkprint init 1 19 | endin 20 | 21 | 22 | 23 | 24 | ; p4 25 | i 1 0 5 100 26 | i 1 1 5 200 27 | i 1 2 5 300 28 | i 1 3 5 400 29 | 30 | i 2 3 1 31 | 32 | 33 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/python5.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr=44100 8 | kr=100 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | pyruni {{ 14 | def average(a,b): 15 | ave = (a + b)/2 16 | return ave 17 | }} ;Define function "average" 18 | 19 | instr 1 20 | iave pycall1i "average", p4, p5 21 | prints "a = %i\\n", iave 22 | endin 23 | 24 | 25 | 26 | 27 | 28 | i 1 0 1 100 200 29 | i 1 1 1 1000 2000 30 | 31 | 32 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/python5.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac -m0 4 | 5 | 6 | 7 | sr=44100 8 | kr=100 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | pyruni {{ 14 | def average(a,b): 15 | ave = (a + b)/2 16 | return ave 17 | }} ;Define function "average" 18 | 19 | instr 1 20 | iave pycall1i "average", p4, p5 21 | prints "a = %i\\n", iave 22 | endin 23 | 24 | 25 | 26 | 27 | 28 | i 1 0 1 100 200 29 | i 1 1 1 1000 2000 30 | 31 | 32 | -------------------------------------------------------------------------------- /6.x/src/image/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build image opcodes 2 | option(BUILD_IMAGE_OPCODES "Build the image opcodes" ON) 3 | 4 | if(${BUILD_IMAGE_OPCODES}) 5 | find_package(PNG) 6 | check_deps(BUILD_IMAGE_OPCODES PNG_FOUND) 7 | 8 | if(BUILD_IMAGE_OPCODES) 9 | make_plugin(image imageOpcodes.c) 10 | target_include_directories(image PRIVATE ${CSOUND_INCLUDE_DIRS}) 11 | target_include_directories(image PRIVATE ${PNG_INCLUDE_DIR}) 12 | target_link_libraries(image ${PNG_LIBRARIES}) 13 | target_compile_definitions(image PRIVATE ${PNG_DEFINITIONS}) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/python2.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr=44100 8 | kr=100 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | pyruni "a = 0" 14 | 15 | instr 1 16 | pyrun "a = a + 1" 17 | endin 18 | 19 | 20 | instr 2 21 | pyruni {{print("a = " + str(a))}} 22 | endin 23 | 24 | 25 | 26 | 27 | 28 | i 1 0 1 ;Adds to a for 1 second 29 | i 2 1 0.1 ;Prints a 30 | i 1 2 1 ;Adds to a for another second 31 | i 2 3 0.1 ;Prints a 32 | 33 | 34 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/python2.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac -m0 4 | 5 | 6 | 7 | sr=44100 8 | kr=100 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | pyruni "a = 0" 14 | 15 | instr 1 16 | pyrun "a = a + 1" 17 | endin 18 | 19 | 20 | instr 2 21 | pyruni {{print("a = " + str(a))}} 22 | endin 23 | 24 | 25 | 26 | 27 | 28 | i 1 0 1 ;Adds to a for 1 second 29 | i 2 1 0.1 ;Prints a 30 | i 1 2 1 ;Adds to a for another second 31 | i 2 3 0.1 ;Prints a 32 | 33 | 34 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/python3.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr=44100 8 | kr=100 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | pyruni "a = 0.0" 14 | 15 | instr 1 16 | pyrun "a = a + 1" 17 | endin 18 | 19 | 20 | instr 2 21 | ival pyevali "a" 22 | prints "a = %i\\n", ival 23 | endin 24 | 25 | 26 | 27 | 28 | 29 | i 1 0 1 ;Adds to a for 1 second 30 | i 2 1 0.1 ;Prints a 31 | i 1 2 1 ;Adds to a for another second 32 | i 2 3 0.1 ;Prints a 33 | 34 | 35 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/python4.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr=44100 8 | kr=100 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | pyassigni "a", 0 14 | 15 | instr 1 16 | pyrun "a = a + 1" 17 | endin 18 | 19 | 20 | instr 2 21 | ival pyevali "a" 22 | prints "a = %i\\n", ival 23 | endin 24 | 25 | 26 | 27 | 28 | 29 | i 1 0 1 ;Adds to a for 1 second 30 | i 2 1 0.1 ;Prints a 31 | i 1 2 1 ;Adds to a for another second 32 | i 2 3 0.1 ;Prints a 33 | 34 | 35 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/python3.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac -m0 4 | 5 | 6 | 7 | sr=44100 8 | kr=100 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | pyruni "a = 0.0" 14 | 15 | instr 1 16 | pyrun "a = a + 1" 17 | endin 18 | 19 | 20 | instr 2 21 | ival pyevali "a" 22 | prints "a = %i\\n", ival 23 | endin 24 | 25 | 26 | 27 | 28 | 29 | i 1 0 1 ;Adds to a for 1 second 30 | i 2 1 0.1 ;Prints a 31 | i 1 2 1 ;Adds to a for another second 32 | i 2 3 0.1 ;Prints a 33 | 34 | 35 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/python4.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac -m0 4 | 5 | 6 | 7 | sr=44100 8 | kr=100 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | pyassigni "a", 0 14 | 15 | instr 1 16 | pyrun "a = a + 1" 17 | endin 18 | 19 | 20 | instr 2 21 | ival pyevali "a" 22 | prints "a = %i\\n", ival 23 | endin 24 | 25 | 26 | 27 | 28 | 29 | i 1 0 1 ;Adds to a for 1 second 30 | i 2 1 0.1 ;Prints a 31 | i 1 2 1 ;Adds to a for another second 32 | i 2 3 0.1 ;Prints a 33 | 34 | 35 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyrunt.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | instr 1 9 | 10 | ktrigger1 metro 3 11 | ktrigger2 metro 6 12 | ktrigger3 metro 10 13 | 14 | pyrunt ktrigger1, "print('zum')" 15 | pyrunt ktrigger2, "print('pa')" 16 | pyrunt ktrigger3, "print('zi')" 17 | 18 | pylrunt ktrigger3 + ktrigger1, "print('zut')" 19 | 20 | a1 rand 5000 21 | 22 | out a1 23 | endin 24 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyrunt.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | instr 1 9 | 10 | ktrigger1 metro 3 11 | ktrigger2 metro 6 12 | ktrigger3 metro 10 13 | 14 | pyrunt ktrigger1, "print('zum')" 15 | pyrunt ktrigger2, "print('pa')" 16 | pyrunt ktrigger3, "print('zi')" 17 | 18 | pylrunt ktrigger3 + ktrigger1, "print('zut')" 19 | 20 | a1 rand 5000 21 | 22 | out a1 23 | endin 24 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyrun.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni "import random" 9 | 10 | instr 1 11 | ; This message is stored in the main namespace 12 | ; and is the same for every instance 13 | pyruni "message = 'a global random number: %f' % random.random()" 14 | pyrun "print(message)" 15 | 16 | ; This message is stored in the private namespace 17 | ; and is different for different instances 18 | pylruni "message = 'a private random number: %f' % random.random()" 19 | pylrun "print(message)" 20 | endin 21 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyrun.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni "import random" 9 | 10 | instr 1 11 | ; This message is stored in the main namespace 12 | ; and is the same for every instance 13 | pyruni "message = 'a global random number: %f' % random.random()" 14 | pyrun "print(message)" 15 | 16 | ; This message is stored in the private namespace 17 | ; and is different for different instances 18 | pylruni "message = 'a private random number: %f' % random.random()" 19 | pylrun "print(message)" 20 | endin 21 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/python1.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr=44100 8 | ksmps=128 9 | nchnls=2 10 | 11 | pyinit ;Start python interpreter 12 | 13 | pyruni {{ 14 | a = 2 15 | b = 3 16 | print("a + b = " + str(a+b)) 17 | }} ;Execute a python script on the header 18 | 19 | instr 1 20 | pyruni {{a = 6 21 | b = 5 22 | print("a + b = " + str(a+b))}} 23 | endin 24 | 25 | 26 | instr 2 27 | pyruni {{print("a + b = " + str(a+b))}} 28 | endin 29 | 30 | 31 | 32 | 33 | 34 | i 1 0 0.1 35 | i 2 1 0.1 36 | 37 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/python1.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac -m0 4 | 5 | 6 | 7 | sr=44100 8 | ksmps=128 9 | nchnls=2 10 | 11 | pyinit ;Start python interpreter 12 | 13 | pyruni {{ 14 | a = 2 15 | b = 3 16 | print("a + b = " + str(a+b)) 17 | }} ;Execute a python script on the header 18 | 19 | instr 1 20 | pyruni {{a = 6 21 | b = 5 22 | print("a + b = " + str(a+b))}} 23 | endin 24 | 25 | 26 | instr 2 27 | pyruni {{print("a + b = " + str(a+b))}} 28 | endin 29 | 30 | 31 | 32 | 33 | 34 | i 1 0 0.1 35 | i 2 1 0.1 36 | 37 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pycall1.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | giSinusoid ftgen 0, 0, 8192, 10, 1 7 | 8 | pyinit 9 | 10 | pyruni {{ 11 | import random 12 | 13 | pool = [(1 + i/10.0) ** 1.2 for i in range(100)] 14 | 15 | def get_number_from_pool(n, p): 16 | if random.random() < p: 17 | i = int(random.random() * len(pool)) 18 | pool[i] = n 19 | 20 | return random.choice(pool) 21 | }} 22 | 23 | instr 1 24 | 25 | k1 oscil 1, 3, giSinusoid 26 | 27 | k2 pycall1 "get_number_from_pool", k1 + 2, p4 28 | 29 | printk 0.01, k2 30 | 31 | endin 32 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pycall1.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | giSinusoid ftgen 0, 0, 8192, 10, 1 7 | 8 | pyinit 9 | 10 | pyruni {{ 11 | import random 12 | 13 | pool = [(1 + i/10.0) ** 1.2 for i in range(100)] 14 | 15 | def get_number_from_pool(n, p): 16 | if random.random() < p: 17 | i = int(random.random() * len(pool)) 18 | pool[i] = n 19 | 20 | return random.choice(pool) 21 | }} 22 | 23 | instr 1 24 | 25 | k1 oscil 1, 3, giSinusoid 26 | 27 | k2 pycall1 "get_number_from_pool", k1 + 2, p4 28 | 29 | printk 0.01, k2 30 | 31 | endin 32 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyexect.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | instr 1 9 | 10 | ktrigger1 metro 3 11 | ktrigger2 metro 6 12 | ktrigger3 metro 10 13 | ktrigger4 metro 0.5 14 | 15 | pyexect ktrigger1, "pyexect1.py" 16 | pyexect ktrigger2, "pyexect2.py" 17 | pyexect ktrigger3, "pyexect3.py" 18 | 19 | pylexect ktrigger3 + ktrigger1, "pyexect4.py" 20 | 21 | a1 rand 5000 22 | 23 | out a1 24 | 25 | endin 26 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyexect.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | instr 1 9 | 10 | ktrigger1 metro 3 11 | ktrigger2 metro 6 12 | ktrigger3 metro 10 13 | ktrigger4 metro 0.5 14 | 15 | pyexect ktrigger1, "pyexect1.py" 16 | pyexect ktrigger2, "pyexect2.py" 17 | pyexect ktrigger3, "pyexect3.py" 18 | 19 | pylexect ktrigger3 + ktrigger1, "pyexect4.py" 20 | 21 | a1 rand 5000 22 | 23 | out a1 24 | 25 | endin 26 | -------------------------------------------------------------------------------- /6.x/src/mp3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_MP3OUT_OPCODE "Build the mp3out opcode" ON) 2 | 3 | if(USE_VCPKG) 4 | find_package(mp3lame CONFIG REQUIRED) 5 | else() 6 | find_package(LAME) 7 | endif() 8 | 9 | if(BUILD_MP3OUT_OPCODE) 10 | if(LAME_FOUND) 11 | make_plugin(mp3out mp3out.c ${LAME_LIBRARY}) 12 | target_include_directories(mp3out PRIVATE ${LAME_INCLUDE_DIR} ${CSOUND_INCLUDE_DIR}) 13 | elseif(mp3lame_FOUND AND USE_VCPKG) 14 | make_plugin(mp3out mp3out.c mp3lame::mp3lame) 15 | target_include_directories(mp3out PRIVATE ${CSOUND_INCLUDE_DIR}) 16 | endif() 17 | 18 | message(STATUS "Building MP3 opcodes") 19 | endif() 20 | -------------------------------------------------------------------------------- /6.x/src/linear_algebra/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_LINEAR_ALGEBRA_OPCODES "Build the linear algebra opcodes" ON) 2 | 3 | find_package(GMM) 4 | check_deps(BUILD_LINEAR_ALGEBRA_OPCODES GMM_FOUND) 5 | 6 | if(BUILD_LINEAR_ALGEBRA_OPCODES AND GMM_FOUND) 7 | make_plugin(linear_algebra linear_algebra.cpp) 8 | target_include_directories(linear_algebra PRIVATE ${GMM_INCLUDE_DIR} ${CSOUND_INCLUDE_DIR}) 9 | target_compile_options(linear_algebra PRIVATE "-DGMM_VERSION") 10 | 11 | if (MSVC) 12 | target_compile_options(linear_algebra PRIVATE "/D_SCL_SECURE_NO_DEPRECATE") 13 | endif() 14 | 15 | message(STATUS "Building linear algebra opcodes") 16 | endif() 17 | -------------------------------------------------------------------------------- /6.x/cmake/Modules/FindGMM.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the GMM library. 2 | # Once done this will define: 3 | # GMM_FOUND - System has the GMM library. 4 | # GMM_VERSION 5 | # GMM_INCLUDE_DIR - The GMM include directories. 6 | # GMM_HAS_VECTOR_OSTREAM - Wether GMM defines operator<< for std::vector 7 | 8 | if (GMM_INCLUDE_DIR) 9 | # in cache already 10 | set(GMM_FOUND TRUE) 11 | else (GMM_INCLUDE_DIR) 12 | find_path(GMM_INCLUDE_DIR NAMES gmm/gmm.h 13 | PATHS 14 | ${INCLUDE_INSTALL_DIR} 15 | ${GMM_INCLUDE_PATH} 16 | ) 17 | include(FindPackageHandleStandardArgs) 18 | find_package_handle_standard_args(GMM DEFAULT_MSG GMM_INCLUDE_DIR) 19 | mark_as_advanced(GMM_INCLUDE_DIR) 20 | endif(GMM_INCLUDE_DIR) -------------------------------------------------------------------------------- /7.x/cmake/Modules/FindGMM.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the GMM library. 2 | # Once done this will define: 3 | # GMM_FOUND - System has the GMM library. 4 | # GMM_VERSION 5 | # GMM_INCLUDE_DIR - The GMM include directories. 6 | # GMM_HAS_VECTOR_OSTREAM - Wether GMM defines operator<< for std::vector 7 | 8 | if (GMM_INCLUDE_DIR) 9 | # in cache already 10 | set(GMM_FOUND TRUE) 11 | else (GMM_INCLUDE_DIR) 12 | find_path(GMM_INCLUDE_DIR NAMES gmm/gmm.h 13 | PATHS 14 | ${INCLUDE_INSTALL_DIR} 15 | ${GMM_INCLUDE_PATH} 16 | ) 17 | include(FindPackageHandleStandardArgs) 18 | find_package_handle_standard_args(GMM DEFAULT_MSG GMM_INCLUDE_DIR) 19 | mark_as_advanced(GMM_INCLUDE_DIR) 20 | endif(GMM_INCLUDE_DIR) -------------------------------------------------------------------------------- /6.x/src/py/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build py opcodes 2 | option(BUILD_PYTHON_OPCODES "Build the py opcodes" ON) 3 | 4 | if(BUILD_PYTHON_OPCODES) 5 | find_package(Python3 COMPONENTS Interpreter Development) 6 | check_deps(BUILD_PYTHON_OPCODES Python3_FOUND) 7 | 8 | set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS}) 9 | set(PYTHON_LIBRARIES ${Python3_LIBRARIES}) 10 | 11 | message("-- Python include dirs: ${Python3_INCLUDE_DIRS}") 12 | message("-- Python libraries: ${PYTHON_LIBRARIES}") 13 | 14 | make_plugin(py src/pythonopcodes.c) 15 | target_include_directories(py PRIVATE ${CSOUND_INCLUDE_DIRS}) 16 | target_include_directories(py PRIVATE ${PYTHON_INCLUDE_DIRS}) 17 | target_link_libraries(py ${PYTHON_LIBRARIES}) 18 | endif() 19 | -------------------------------------------------------------------------------- /7.x/src/py/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build py opcodes 2 | option(BUILD_PYTHON_OPCODES "Build the py opcodes" ON) 3 | 4 | if(BUILD_PYTHON_OPCODES) 5 | find_package(Python3 COMPONENTS Interpreter Development) 6 | check_deps(BUILD_PYTHON_OPCODES Python3_FOUND) 7 | 8 | set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS}) 9 | set(PYTHON_LIBRARIES ${Python3_LIBRARIES}) 10 | 11 | message("-- Python include dirs: ${Python3_INCLUDE_DIRS}") 12 | message("-- Python libraries: ${PYTHON_LIBRARIES}") 13 | 14 | make_plugin(py src/pythonopcodes.c) 15 | target_include_directories(py PRIVATE ${CSOUND_INCLUDE_DIRS}) 16 | target_include_directories(py PRIVATE ${PYTHON_INCLUDE_DIRS}) 17 | target_link_libraries(py ${PYTHON_LIBRARIES}) 18 | endif() 19 | -------------------------------------------------------------------------------- /6.x/src/py/README.md: -------------------------------------------------------------------------------- 1 | Python opcodes 2 | === 3 | 4 | This is the porting to Python 3.x of the Python opcodes of Csound which ran under Python 2.7 until know. 5 | The backward compatibility is preserved for the Csound code of the orchestra, however it is not maintained 6 | for the Python code that would be embedded in a Csound orchestra or in Csound instruments, due to the lack 7 | of backward compatibility between Python 3.x and Python 2.7. 8 | 9 | Python 2.7 will not be maintained past 2020. The 10 | [official porting guide](https://docs.python.org/3/howto/pyporting.html) has advice for 11 | running Python 2 code in Python 3. 12 | 13 | To build these opcodes, you will need to install Python from 14 | [www.python.org](www.python.org), or the devel package (on linux). 15 | -------------------------------------------------------------------------------- /7.x/src/py/README.md: -------------------------------------------------------------------------------- 1 | Python opcodes 2 | === 3 | 4 | This is the porting to Python 3.x of the Python opcodes of Csound which ran under Python 2.7 until know. 5 | The backward compatibility is preserved for the Csound code of the orchestra, however it is not maintained 6 | for the Python code that would be embedded in a Csound orchestra or in Csound instruments, due to the lack 7 | of backward compatibility between Python 3.x and Python 2.7. 8 | 9 | Python 2.7 will not be maintained past 2020. The 10 | [official porting guide](https://docs.python.org/3/howto/pyporting.html) has advice for 11 | running Python 2 code in Python 3. 12 | 13 | To build these opcodes, you will need to install Python from 14 | [www.python.org](www.python.org), or the devel package (on linux). 15 | -------------------------------------------------------------------------------- /6.x/src/opencl/libclconv.dylib.dSYM/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleIdentifier 8 | com.apple.xcode.dsym.libclconv.dylib 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundlePackageType 12 | dSYM 13 | CFBundleSignature 14 | ???? 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleVersion 18 | 1 19 | 20 | 21 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/pythonlocal2.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | pyinit 8 | 9 | gkprint init 0 10 | 11 | instr 1 12 | ;assign 4th p-field to local python variable "value" 13 | pylassigni "value", p4 14 | ktrig changed gkprint 15 | 16 | ; If gkprint has changed (i.e. instr 2 was triggered) 17 | ; print the value of the local python variable "value" 18 | if (ktrig == 1) then 19 | kvalue pyleval "value" 20 | printk 0.5, kvalue 21 | endif 22 | endin 23 | 24 | instr 2 25 | gkprint init 1 26 | endin 27 | 28 | 29 | 30 | 31 | ; p4 32 | i 1 0 5 100 33 | i 1 1 5 200 34 | i 1 2 5 300 35 | i 1 3 5 400 36 | 37 | i 2 3 1 38 | 39 | 40 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/pythonlocal2.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac -m0 4 | 5 | 6 | 7 | pyinit 8 | 9 | gkprint init 0 10 | 11 | instr 1 12 | ;assign 4th p-field to local python variable "value" 13 | pylassigni "value", p4 14 | ktrig changed gkprint 15 | 16 | ; If gkprint has changed (i.e. instr 2 was triggered) 17 | ; print the value of the local python variable "value" 18 | if (ktrig == 1) then 19 | kvalue pyleval "value" 20 | printk 0.5, kvalue 21 | endif 22 | endin 23 | 24 | instr 2 25 | gkprint init 1 26 | endin 27 | 28 | 29 | 30 | 31 | ; p4 32 | i 1 0 5 100 33 | i 1 1 5 200 34 | i 1 2 5 300 35 | i 1 3 5 400 36 | 37 | i 2 3 1 38 | 39 | 40 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pyrun.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | sr=44100 7 | kr=4410 8 | ksmps=10 9 | nchnls=1 10 | 11 | pyinit 12 | 13 | pyruni "import random" 14 | 15 | instr 1 16 | ; This message is stored in the main namespace 17 | ; and is the same for every instance 18 | pyruni "message = 'a global random number: %f' % random.random()" 19 | pyrun "print(message)" 20 | 21 | ; This message is stored in the private namespace 22 | ; and is different for different instances 23 | pylruni "message = 'a private random number: %f' % random.random()" 24 | pylrun "print(message)" 25 | 26 | endin 27 | 28 | 29 | i1 0 0.01 30 | 31 | 32 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pyrun.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | sr=44100 7 | kr=4410 8 | ksmps=10 9 | nchnls=1 10 | 11 | pyinit 12 | 13 | pyruni "import random" 14 | 15 | instr 1 16 | ; This message is stored in the main namespace 17 | ; and is the same for every instance 18 | pyruni "message = 'a global random number: %f' % random.random()" 19 | pyrun "print(message)" 20 | 21 | ; This message is stored in the private namespace 22 | ; and is different for different instances 23 | pylruni "message = 'a private random number: %f' % random.random()" 24 | pylrun "print(message)" 25 | 26 | endin 27 | 28 | 29 | i1 0 0.01 30 | 31 | 32 | -------------------------------------------------------------------------------- /6.x/src/p5glove/p5g_mac: -------------------------------------------------------------------------------- 1 | #define P5G_BUTTONS #0# 2 | #define P5G_BUTTON_A #1# 3 | #define P5G_BUTTON_B #2# 4 | #define P5G_BUTTON_C #4# 5 | #define P5G_JUSTPUSH #8# 6 | #define P5G_JUSTPU_A #9# 7 | #define P5G_JUSTPU_B #10# 8 | #define P5G_JUSTPU_C #12# 9 | #define P5G_RELEASED #16# 10 | #define P5G_RELSED_A #17# 11 | #define P5G_RELSED_B #18# 12 | #define P5G_RELSED_C #20# 13 | #define P5G_FINGER_INDEX #32# 14 | #define P5G_FINGER_MIDDLE #33# 15 | #define P5G_FINGER_RING #34# 16 | #define P5G_FINGER_PINKY #35# 17 | #define P5G_FINGER_THUMB #36# 18 | #define P5G_DELTA_X #37# 19 | #define P5G_DELTA_Y #38# 20 | #define P5G_DELTA_Z #39# 21 | #define P5G_DELTA_XR #40# 22 | #define P5G_DELTA_YR #41# 23 | #define P5G_DELTA_ZR #42# 24 | #define P5G_ANGLES #43# 25 | -------------------------------------------------------------------------------- /6.x/cmake/Modules/FindLAME.cmake: -------------------------------------------------------------------------------- 1 | # - Find LAME 2 | # Find the native LAME includes and library 3 | # 4 | # LAME_INCLUDE_DIR - where to find lame.h 5 | # LAME_LIBRARY - lame library 6 | # LAME_FOUND - lame found 7 | 8 | if (LAME_INCLUDE_DIR AND LAME_LIBRARY) 9 | # Already in cache, be silent 10 | set (LAME_FIND_QUIETLY TRUE) 11 | endif () 12 | 13 | find_path (LAME_INCLUDE_DIR lame/lame.h HINTS /usr/local/include) 14 | find_library (LAME_LIBRARY NAMES mp3lame libmp3lame HINTS /usr/local/lib) 15 | mark_as_advanced (LAME_LIBRARIES LAME_INCLUDE_DIR) 16 | 17 | # handle the QUIETLY and REQUIRED arguments and set LAME_FOUND to TRUE if 18 | # all listed variables are TRUE 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(LAME DEFAULT_MSG LAME_LIBRARY LAME_INCLUDE_DIR) 21 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pycall2.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | giSinusoid ftgen 0, 0, 8192, 10, 1 7 | 8 | pyinit 9 | 10 | pyruni {{ 11 | import random 12 | 13 | class GetNumberFromPool: 14 | def __init__(self, e=1.2, a=1.0, f=0.1, N=100): 15 | self.pool = [(a + i*f) ** e for i in range(N)] 16 | 17 | def __call__(self, n, p): 18 | if random.random() < p: 19 | i = int(random.random() * len(self.pool)) 20 | self.pool[i] = n 21 | 22 | return random.choice(self.pool) 23 | 24 | get_number_from_pool = GetNumberFromPool() 25 | }} 26 | 27 | instr 1 28 | 29 | k1 oscil 1, 3, giSinusoid 30 | 31 | k2 pycall1 "get_number_from_pool", k1 + 2, p4 32 | 33 | printk 0.01, k2 34 | 35 | endin 36 | -------------------------------------------------------------------------------- /7.x/cmake/Modules/FindLAME.cmake: -------------------------------------------------------------------------------- 1 | # - Find LAME 2 | # Find the native LAME includes and library 3 | # 4 | # LAME_INCLUDE_DIR - where to find lame.h 5 | # LAME_LIBRARY - lame library 6 | # LAME_FOUND - lame found 7 | 8 | if (LAME_INCLUDE_DIR AND LAME_LIBRARY) 9 | # Already in cache, be silent 10 | set (LAME_FIND_QUIETLY TRUE) 11 | endif () 12 | 13 | find_path (LAME_INCLUDE_DIR lame/lame.h HINTS /usr/local/include) 14 | find_library (LAME_LIBRARY NAMES mp3lame libmp3lame HINTS /usr/local/lib) 15 | mark_as_advanced (LAME_LIBRARIES LAME_INCLUDE_DIR) 16 | 17 | # handle the QUIETLY and REQUIRED arguments and set LAME_FOUND to TRUE if 18 | # all listed variables are TRUE 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(LAME DEFAULT_MSG LAME_LIBRARY LAME_INCLUDE_DIR) 21 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pycall2.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | giSinusoid ftgen 0, 0, 8192, 10, 1 7 | 8 | pyinit 9 | 10 | pyruni {{ 11 | import random 12 | 13 | class GetNumberFromPool: 14 | def __init__(self, e=1.2, a=1.0, f=0.1, N=100): 15 | self.pool = [(a + i*f) ** e for i in range(N)] 16 | 17 | def __call__(self, n, p): 18 | if random.random() < p: 19 | i = int(random.random() * len(self.pool)) 20 | self.pool[i] = n 21 | 22 | return random.choice(self.pool) 23 | 24 | get_number_from_pool = GetNumberFromPool() 25 | }} 26 | 27 | instr 1 28 | 29 | k1 oscil 1, 3, giSinusoid 30 | 31 | k2 pycall1 "get_number_from_pool", k1 + 2, p4 32 | 33 | printk 0.01, k2 34 | 35 | endin 36 | -------------------------------------------------------------------------------- /6.x/src/chua/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build chuap opcodes 2 | option(BUILD_CHUA_OPCODES "Build the chua opcodes" ON) 3 | 4 | if(USE_VCPKG) 5 | find_package(Eigen3 CONFIG REQUIRED) 6 | else() 7 | find_package(EIGEN3) 8 | endif() 9 | 10 | check_deps(BUILD_CHUA_OPCODES EIGEN3_FOUND) 11 | 12 | if(BUILD_CHUA_OPCODES AND EIGEN3_FOUND) 13 | make_plugin(chua ChuaOscillator.cpp) 14 | target_include_directories(chua PRIVATE ${EIGEN3_INCLUDE_DIR} ${CSOUND_INCLUDE_DIRS}) 15 | 16 | if(USE_VCPKG) 17 | target_link_libraries(chua PRIVATE Eigen3::Eigen) 18 | else() 19 | target_link_libraries(chua PRIVATE ${EIGEN_LIBRARIES}) 20 | endif() 21 | 22 | if(APPLE) 23 | set_target_properties(chua PROPERTIES 24 | COMPILE_FLAGS "-Wno-unused-local-typedef" 25 | ) 26 | endif() 27 | endif() 28 | -------------------------------------------------------------------------------- /6.x/cmake/Modules/FindSTK.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the STK library. 2 | # Once done this will define: 3 | # STK_FOUND - System has the STK library. 4 | # STK_INCLUDE_DIRS - The STK include directories. 5 | # STK_LIBRARIES - The libraries needed to use the STK. 6 | 7 | find_path(STK_INCLUDE_DIR Stk.h PATH_SUFFIXES stk HINTS "${STK_INCLUDE_DIR_HINT}") 8 | find_library(STK_LIBRARY NAMES stk HINTS "${STK_LIBRARY_DIR_HINT}") 9 | 10 | set(STK_INCLUDE_DIRS ${STK_INCLUDE_DIR}) 11 | set(STK_LIBRARIES ${STK_LIBRARY} ) 12 | 13 | include(FindPackageHandleStandardArgs) 14 | # handle the QUIETLY and REQUIRED arguments and set STK_FOUND to TRUE 15 | # if all listed variables are TRUE 16 | find_package_handle_standard_args(STK DEFAULT_MSG 17 | STK_LIBRARY STK_INCLUDE_DIR) 18 | 19 | mark_as_advanced(STK_INCLUDE_DIR STK_LIBRARY) 20 | -------------------------------------------------------------------------------- /7.x/cmake/Modules/FindSTK.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the STK library. 2 | # Once done this will define: 3 | # STK_FOUND - System has the STK library. 4 | # STK_INCLUDE_DIRS - The STK include directories. 5 | # STK_LIBRARIES - The libraries needed to use the STK. 6 | 7 | find_path(STK_INCLUDE_DIR Stk.h PATH_SUFFIXES stk HINTS "${STK_INCLUDE_DIR_HINT}") 8 | find_library(STK_LIBRARY NAMES stk HINTS "${STK_LIBRARY_DIR_HINT}") 9 | 10 | set(STK_INCLUDE_DIRS ${STK_INCLUDE_DIR}) 11 | set(STK_LIBRARIES ${STK_LIBRARY} ) 12 | 13 | include(FindPackageHandleStandardArgs) 14 | # handle the QUIETLY and REQUIRED arguments and set STK_FOUND to TRUE 15 | # if all listed variables are TRUE 16 | find_package_handle_standard_args(STK DEFAULT_MSG 17 | STK_LIBRARY STK_INCLUDE_DIR) 18 | 19 | mark_as_advanced(STK_INCLUDE_DIR STK_LIBRARY) 20 | -------------------------------------------------------------------------------- /6.x/src/CUDA/cuda_pvs_example.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | ;--opcode-lib=./libcudaop2.dylib 4 | 5 | 6 | 7 | ksmps = 64 8 | 0dbfs = 1 9 | 10 | instr 1 11 | ifftsize = 4096 12 | ihopsize = 512 13 | asig = diskin2:a("flutec3.wav",1,0,1) 14 | fsig = cudanal(asig, 15 | ifftsize, 16 | ihopsize, 17 | ifftsize, 1) 18 | asig = cudasynth(fsig) 19 | asig = linenr(asig,0.005,0.01,0.01) 20 | out(asig) 21 | endin 22 | 23 | instr 2 24 | S1 = "flutec3.wav" 25 | ifftsize = 32768 26 | ihopsize = 512 27 | asig diskin2 S1, 1, 0, 1 28 | fsig pvsanal asig, ifftsize, ihopsize, ifftsize, 1 29 | a1 pvsynth fsig 30 | a2 linenr a1*0.5,0.005,0.01,0.01 31 | out a2 32 | endin 33 | 34 | 35 | 36 | 37 | i1 0 60 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /6.x/src/p5glove/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_P5GLOVE_OPCODES "Build the P5Glove opcodes" ON) 2 | 3 | if (NOT APPLE) 4 | find_path(P5GLOVE_INCLUDE_DIR p5glove.h /usr/local/include) 5 | find_library(P5GLOVE_LIB p5glove) 6 | check_deps(BUILD_P5GLOVE_OPCODES P5GLOVE_LIB) 7 | 8 | if(BUILD_P5GLOVE_OPCODES) 9 | make_plugin(p5g p5glove.c ${P5GLOVE_LIB}) 10 | target_include_directories(p5g PRIVATE ${P5GLOVE_INCLUDE_DIR}) 11 | target_include_directories(p5g PRIVATE ${CSOUND_INCLUDE_DIR}) 12 | endif() 13 | else() 14 | if(BUILD_P5GLOVE_OPCODES) 15 | make_plugin(p5g "p5glove.c;libp5glove/p5glove.c;libp5glove/usb_hid_macosx.c") 16 | target_link_libraries(p5g "-framework IOKit" "-framework CoreFoundation") 17 | target_include_directories(p5g PRIVATE ./libp5glove ${CSOUND_INCLUDE_DIR}) 18 | endif() 19 | endif() 20 | -------------------------------------------------------------------------------- /6.x/src/opencl/cladsyn.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | --opcode-lib=./libclop1.dylib 4 | 5 | 6 | 7 | ksmps = 1 8 | 0dbfs = 1 9 | 10 | 11 | instr 1 12 | ifftsize = 2048 13 | ihopsize = 512 14 | ibins = 1024 15 | idev = 1; /* device number */ 16 | asig1 vco2 0.5, 300 17 | fsig = pvsanal(asig1, ifftsize,ihopsize, ifftsize, 1) 18 | asig = cladsyn(fsig,1,1,ibins,idev) 19 | asig = linenr(asig,0.001,0.01,0.01) 20 | out(asig*0.5) 21 | 22 | endin 23 | 24 | instr 2 25 | ifftsize = 2048 26 | ihopsize = 512 27 | ibins = 1024 28 | asig1 vco2 0.5, 440 29 | fsig = pvsanal(asig1, ifftsize,ihopsize, ifftsize, 1) 30 | asig = pvsadsyn(fsig,ibins,1) 31 | asig = linenr(asig,0.001,0.01,0.01) 32 | out(asig*0.5) 33 | 34 | endin 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | i1 0 60 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /6.x/src/py/examples/embeddedCtcsound.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr = 48000 8 | ksmps = 100 9 | nchnls = 2 10 | 11 | pyinit ;Start python interpreter 12 | 13 | pyruni {{ 14 | import ctcsound 15 | import sys 16 | 17 | # Get an opaque pointer to the running Csound instance 18 | # and print Python version number 19 | p = _CSOUND_ 20 | print("\\n --> Python version number: {}\\n".format(sys.version_info[0])) 21 | # Create an object called cs from the ctcsound.Csound class 22 | # using the opaque pointer to the Csound instance 23 | cs = ctcsound.Csound(pointer_=p) 24 | }} 25 | 26 | instr 1 27 | ; Use the cs python object 28 | pyruni {{ 29 | print("\\n --> Sample Rate: {}, Control Rate: {}\\n".format(cs.sr(), cs.kr())) 30 | }} 31 | endin 32 | 33 | 34 | 35 | i1 0 1 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /7.x/src/py/examples/embeddedCtcsound.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr = 48000 8 | ksmps = 100 9 | nchnls = 2 10 | 11 | pyinit ;Start python interpreter 12 | 13 | pyruni {{ 14 | import ctcsound 15 | import sys 16 | 17 | # Get an opaque pointer to the running Csound instance 18 | # and print Python version number 19 | p = _CSOUND_ 20 | print("\\n --> Python version number: {}\\n".format(sys.version_info[0])) 21 | # Create an object called cs from the ctcsound.Csound class 22 | # using the opaque pointer to the Csound instance 23 | cs = ctcsound.Csound(pointer_=p) 24 | }} 25 | 26 | instr 1 27 | ; Use the cs python object 28 | pyruni {{ 29 | print("\\n --> Sample Rate: {}, Control Rate: {}\\n".format(cs.sr(), cs.kr())) 30 | }} 31 | endin 32 | 33 | 34 | 35 | i1 0 1 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /6.x/src/CUDA/cudadsyn_pvs_example.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | --opcode-lib=./libcudaop1.dylib --opcode-lib=./libcudaop2.dylib 4 | 5 | 6 | 7 | ksmps = 64 8 | 0dbfs = 1 9 | 10 | instr 1 11 | ifftsize = 2048 12 | ihopsize = 512 13 | ibins = 1024 14 | asig1,adp diskin "/users/victor/audio/metheny.wav",1,0,1 15 | fsig = pvsanal(asig1, ifftsize,ihopsize, ifftsize, 1) 16 | asig = cudasynth(fsig,1,1,ibins) 17 | asig = linenr(asig,0.001,0.01,0.01) 18 | out(asig*0.5) 19 | 20 | endin 21 | 22 | instr 2 23 | ifftsize = 2048 24 | ihopsize = 512 25 | ibins = 1024 26 | asig1,adp diskin "/users/victor/audio/metheny.wav",1,0,1 27 | fsig = pvsanal(asig1, ifftsize,ihopsize, ifftsize, 1) 28 | asig = pvsadsyn(fsig,ibins,1) 29 | asig = linenr(asig,0.001,0.01,0.01) 30 | out(asig*0.5) 31 | 32 | endin 33 | 34 | 35 | 36 | i1 0 60 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /6.x/src/py/examples/ievent.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=2 5 | 6 | giSinusoid ftgen 0, 0, 8192, 10, 1 7 | 8 | pyinit 9 | 10 | pyruni {{ 11 | import ctcsound 12 | import sys 13 | from random import random 14 | p = _CSOUND_ 15 | print("\\n --> Python version number: {}\\n".format(sys.version_info[0])) 16 | cs = ctcsound.Csound(pointer_=p) 17 | for i in range(800): 18 | cs.scoreEvent('i', [1, i * .2, 0.05, 6.8 + random() * 3, 70.0]) 19 | cs.scoreEvent('i', [1, i * .2, 0.05, 8.8 + random() * 3, 70.0]) 20 | }} 21 | 22 | instr 1 23 | 24 | iDuration = p3 25 | iFrequency = cpsoct(p4) 26 | iAmplitude = ampdb(p5) 27 | 28 | aAmplitude linseg iAmplitude, iDuration - 0.01, iAmplitude, 0.002 ,0, 1,0 29 | aOutput oscili aAmplitude, iFrequency, giSinusoid 30 | 31 | outs aOutput, aOutput 32 | 33 | endin 34 | -------------------------------------------------------------------------------- /6.x/src/faustcsound/README.md: -------------------------------------------------------------------------------- 1 | Faust opcodes 2 | ======= 3 | 4 | To build the faust opcodes, you will need the Faust library, which can downloaded 5 | from [https://github.com/grame-cncm/faust/releases] (https://github.com/grame-cncm/faust/releases) 6 | or built from sources (you will also need libcrypto and LLVM 7 | installed). 8 | 9 | If using the pre-built binaries the following CMake variables are 10 | important: 11 | 12 | `FAUST_INCLUDE_DIR_HINT` 13 | 14 | and 15 | 16 | `FAUST_LIB_DIR_HINT` 17 | 18 | They should point to the include and lib directories inside the faust 19 | binary package. For example, if the package (for example, 20 | Faust 2.33.1) is placed at the top-level user directory use the CMake command 21 | 22 | ``` 23 | cmake .. -DFAUST_INCLUDE_DIR_HINT=$HOME/faust-2.33.1/include 24 | -DFAUST_LIB_DIR_HINT=$HOME/faust-2.33.1/lib 25 | ``` 26 | 27 | to correctly find the library and headers. The library will be built 28 | and linked to the installed faust library. 29 | 30 | -------------------------------------------------------------------------------- /6.x/src/CUDA/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # use -Xptxas="-v" to check register usage and --maxrregcount 32 to limit it 3 | echo "building cuda opcodes ..." 4 | nvcc -O3 -shared -o libcudaop1.dylib adsyn.cu -use_fast_math -I../../debug/CsoundLib64.framework/Headers -arch=sm_30 -I/usr/local/cuda/include -L/usr/local/cuda/lib 5 | nvcc -O3 -shared -o libcudaop2.dylib pvsops.cu -use_fast_math -g -I../../debug/CsoundLib64.framework/Headers -arch=sm_30 -I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft 6 | nvcc -O3 -shared -o libcudaop3.dylib slidingm.cu -use_fast_math -I../../debug/CsoundLib64.framework/Headers -arch=sm_30 -I/usr/local/cuda/include -L/usr/local/cuda/lib 7 | nvcc -O3 -shared -o libcudaop4.dylib conv.cu -I../../debug/CsoundLib64.framework/Headers -arch=sm_30 -I/usr/local/cuda/include -L/usr/local/cuda/lib 8 | nvcc -O3 -shared -o libcudaop5.dylib pconv.cu -I../../debug/CsoundLib64.framework/Headers -arch=sm_30 -I/usr/local/cuda/include -L/usr/local/cuda/lib -lcufft 9 | echo "...done" 10 | -------------------------------------------------------------------------------- /7.x/src/py/examples/ievent.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=2 5 | 6 | giSinusoid ftgen 0, 0, 8192, 10, 1 7 | 8 | pyinit 9 | 10 | pyruni {{ 11 | import ctcsound 12 | import sys 13 | from random import random 14 | p = _CSOUND_ 15 | print("\\n --> Python version number: {}\\n".format(sys.version_info[0])) 16 | cs = ctcsound.Csound(pointer_=p) 17 | for i in range(800): 18 | cs.event(ctcsound.CS_INSTR_EVENT, [1, i*0.2, 0.05, 6.8 + random()*3, 70.0]) 19 | cs.event(ctcsound.CS_INSTR_EVENT, [1, i*0.2, 0.05, 8.8 + random()*3, 70.0]) 20 | }} 21 | 22 | instr 1 23 | 24 | iDuration = p3 25 | iFrequency = cpsoct(p4) 26 | iAmplitude = ampdb(p5) 27 | 28 | aAmplitude linseg iAmplitude, iDuration - 0.01, iAmplitude, 0.002 ,0, 1,0 29 | aOutput oscili aAmplitude, iFrequency, giSinusoid 30 | 31 | outs aOutput, aOutput 32 | 33 | endin 34 | -------------------------------------------------------------------------------- /6.x/src/jackops/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_JACK_OPCODES "Build the JACK related opcodes" ON) 2 | 3 | find_library(JACK_LIB NAMES jack) 4 | find_path (JACK_INCLUDE_DIR jack/jack.h HINTS /usr/local/include) 5 | 6 | check_deps(BUILD_JACK_OPCODES JACK_LIB) 7 | 8 | if(BUILD_JACK_OPCODES AND JACK_LIB) 9 | 10 | list(APPEND jack_LIBS ${JACK_LIB}) 11 | 12 | make_plugin(jacko jacko.cpp "${jack_LIBS}") 13 | target_include_directories(jacko PRIVATE ${CSOUND_INCLUDE_DIRS}) 14 | target_include_directories(jacko PRIVATE ${JACK_INCLUDE_DIR}) 15 | set_property(TARGET jacko PROPERTY CXX_STANDARD 20) 16 | set_property(TARGET jacko PROPERTY CXX_STANDARD_REQUIRED On) 17 | set_property(TARGET jacko PROPERTY CXX_EXTENSIONS Off) 18 | 19 | make_plugin(jackTransport jackTransport.c "${jack_LIBS}") 20 | target_include_directories(jackTransport PRIVATE ${CSOUND_INCLUDE_DIRS}) 21 | target_include_directories(jackTransport PRIVATE ${JACK_INCLUDE_DIR}) 22 | 23 | endif() 24 | -------------------------------------------------------------------------------- /6.x/src/opencl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_OPENCL_OPCODES "Build the OpenCL parallel opcodes" OFF) 2 | 3 | find_library (OpenCL_library NAMES OpenCL) 4 | check_deps(BUILD_OPENCL_OPCODES OpenCL_FOUND) 5 | 6 | if(BUILD_OPENCL_OPCODES AND OpenCL_FOUND) 7 | 8 | function(make_opencl_plugin libname srcs) 9 | if(APPLE) 10 | add_library(${libname} SHARED ${srcs}) 11 | else() 12 | add_library(${libname} MODULE ${srcs}) 13 | endif() 14 | 15 | set(i 2) 16 | while( ${i} LESS ${ARGC} ) 17 | target_link_libraries(${libname} ${ARGV${i}}) 18 | math(EXPR i "${i}+1") 19 | endwhile() 20 | 21 | target_include_directories(${libname} PRIVATE ${CSOUND_INCLUDE_DIRS}) 22 | 23 | install(TARGETS ${libname} 24 | LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}" ) 25 | endfunction() 26 | 27 | make_opencl_plugin(clop cladsynth.c) 28 | target_link_libraries(clop ${OpenCL_library}) 29 | endif() 30 | -------------------------------------------------------------------------------- /6.x/src/CUDA/cudapconv.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ksmps = 8 6 | nchnls =2 7 | i1 ftgen 1,0,0,1,"church.wav",0,0,1 8 | i2 ftgen 2,0,64,1,"church.wav",0,0,1 9 | ;i1 ftgen 1,0,65536,7,1,1,1,0,65534,0 10 | i1 ftgen 1,0,0,1,"/Users/victor/audio/metheny.wav",0,0,1 11 | instr 1 12 | 13 | ;asig oscili 0dbfs/4, 440; 14 | 15 | asig diskin2 "/Users/victor/audio/cornetto.wav",1,0,1 16 | a1 cudapconv asig,1,16384 17 | ;a2 cudaconv asig,2 18 | ;a1 ftconv asig,1,64 19 | ;a1 pconvolve asig,"/Users/victor/audio/church_00.wav",1024 20 | out a1/500, a1/500 21 | endin 22 | 23 | 24 | 25 | i1 0 60 26 | 27 | 28 | 29 | 30 | 31 | 32 | 100 33 | 100 34 | 320 35 | 240 36 | true 37 | 38 | 39 | 255 40 | 255 41 | 255 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /6.x/src/fluidOpcodes/Android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LIBSNDFILE_SRC_DIR := $(NDK_MODULE_PATH)/libsndfile-android/jni/ 6 | LIBFLUIDSYNTH_SRC_DIR := $(NDK_MODULE_PATH)/fluidsynth-android/jni/ 7 | 8 | LOCAL_MODULE := fluidOpcodes 9 | 10 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../H $(LOCAL_PATH)/../../../../include $(LOCAL_PATH)/../../../.. $(LOCAL_PATH)/../../../ $(LIBSNDFILE_SRC_DIR) $(LIBFLUIDSYNTH_SRC_DIR)/include $(LOCAL_PATH)/../.. $(LOCAL_PATH)/../../../CsoundAndroid/jni 11 | LOCAL_CFLAGS := -O3 -D__BUILDING_LIBCSOUND -DENABLE_NEW_PARSER -DLINUX -DHAVE_DIRENT_H -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H 12 | LOCAL_CPPFLAGS :=$(LOCAL_CFLAGS) 13 | LOCAL_CPPFLAGS += -std=c++11 -pthread -frtti -fexceptions 14 | ### 15 | 16 | LOCAL_SRC_FILES := ../../fluidOpcodes.cpp 17 | 18 | LOCAL_LDLIBS += -ldl 19 | 20 | LOCAL_STATIC_LIBRARIES := fluidsynth-android 21 | 22 | include $(BUILD_SHARED_LIBRARY) 23 | 24 | $(call import-module,fluidsynth-android/jni) 25 | -------------------------------------------------------------------------------- /6.x/src/AbletonLinkOpcodes/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | CSOUND_SRC_ROOT := ../../../.. 6 | ABLETON_LINK_HOME :=/home/mkg/link 7 | 8 | LOCAL_MODULE := ableton_link_opcodes 9 | 10 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../Engine $(LOCAL_PATH)/../../../../H $(LOCAL_PATH)/../../../../include $(LOCAL_PATH)/../../../.. $(LOCAL_PATH)/../../../ $(NDK_MODULE_PATH)/libsndfile-android/jni $(LOCAL_PATH)/../../../CsoundAndroid/jni $(ABLETON_LINK_HOME)/include $(ABLETON_LINK_HOME)/modules/asio-standalone/asio/include 11 | LOCAL_CFLAGS := -O3 -D__BUILDING_LIBCSOUND -DENABLE_NEW_PARSER -DLINUX -DHAVE_DIRENT_H -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H -DLINK_PLATFORM_LINUX=1 -DANDROID=1 12 | LOCAL_CPPFLAGS :=$(LOCAL_CFLAGS) 13 | LOCAL_CPPFLAGS += -std=c++11 -pthread -frtti -fcxx-exceptions -Wno-multichar -fexceptions #-Werror 14 | LOCAL_LDLIBS := -latomic 15 | LOCAL_LDFLAGS += -Wl,--export-dynamic 16 | 17 | LOCAL_SRC_FILES := $(CSOUND_SRC_ROOT)/Opcodes/ableton_link_opcodes.cpp 18 | 19 | include $(BUILD_SHARED_LIBRARY) 20 | 21 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/Program.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Program.cpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #include "Program.hpp" 25 | 26 | Program::Program(int num, char *programName) 27 | { 28 | this->programNum = num; 29 | this->name = programName; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /6.x/src/fluidOpcodes/test.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | sr=44100 9 | kr=441 10 | ksmps=100 11 | nchnls=2 12 | 13 | giFluidEngine fluid_engine 14 | 15 | giSF_piano fluid_load "sf2/Piano Grand Steinway V1.0b (29,651KB).SF2", giFluidEngine 16 | giSF_mutedViolin fluid_load "sf2/MutedViolin.sf2", giFluidEngine 17 | 18 | fluid_program_select giFluidEngine, 0, giSF_piano, 0, 0 19 | fluid_program_select giFluidEngine, 1, giSF_mutedViolin, 0, 0 20 | 21 | instr 1 ;untitled 22 | 23 | fluid_play giFluidEngine, 0, p4, p5 24 | 25 | endin 26 | 27 | instr 2 28 | 29 | fluid_play giFluidEngine, 1, p4, p5 30 | 31 | endin 32 | 33 | instr 10 ; fluid out instrument 34 | 35 | aleft, aright fluid_out giFluidEngine 36 | 37 | outs aleft * 0dbfs, aright * 0dbfs 38 | endin 39 | 40 | 41 | 42 | 43 | 44 | i1 0 2 60 110 45 | i1 0 2 64 110 46 | i1 0 2 67 110 47 | 48 | i2 0 1 72 110 49 | i2 0 1 76 70 50 | i2 0 1 79 80 51 | 52 | i10 0 6 53 | 54 | e 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /6.x/src/websockets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_WEBSOCKET_OPCODE "Build the websocket opcode" ON) 2 | 3 | if(USE_VCPKG) 4 | find_package(libuv CONFIG) 5 | find_package(libwebsockets CONFIG) 6 | else() 7 | find_path(WEBSOCKETS_H libwebsockets.h /usr/local/include /usr/include) 8 | find_library(websockets_library NAMES websockets) 9 | endif() 10 | 11 | if(APPLE) 12 | find_library(ssl_library NAMES ssl) 13 | find_library(crypto_library NAMES crypto) 14 | 15 | check_deps(BUILD_WEBSOCKET_OPCODE websockets_library ssl_library crypto_library WEBSOCKETS_H) 16 | endif() 17 | 18 | if(BUILD_WEBSOCKET_OPCODE) 19 | make_plugin(websocketIO WebSocketOpcode.c) 20 | target_include_directories(websocketIO PRIVATE ${CSOUND_INCLUDE_DIRS}) 21 | 22 | if(USE_VCPKG) 23 | target_link_libraries(websocketIO websockets uv_a) 24 | else() 25 | target_link_libraries(websocketIO ${websockets_library}) 26 | target_include_directories(websocketIO PRIVATE ${WEBSOCKETS_H}) 27 | endif() 28 | 29 | if(APPLE) 30 | target_link_libraries(websocketIO ${ssl_library} ${crypto_library} z) 31 | endif() 32 | endif() 33 | -------------------------------------------------------------------------------- /6.x/src/py/src/README.md: -------------------------------------------------------------------------------- 1 | PYTHON OPCODES FOR CSOUND 2 | === 3 | By Maurizio Umberto Puxeddu.
4 | Modified by Michael Gogins for Csound 5, 2004 July 24.
5 | Modified by François Pinot for using with Python 3.x, 2019 November.
6 | 7 | BEFORE COMPILING 8 | --- 9 | To generate the source code for the Python opcodes just run the **pycall-gen.py** 10 | and **pyx-gen.py** scripts in this directory. 11 | 12 | This way of doing had been broken by adding different modifications directly to 13 | the **pycall.auto.c** and **pyx.auto.c** files. These modifications have been integrated 14 | back into the **pycall-gen.py** and **pyx-gen.py** scripts. 15 | So if one has to modifiy the opcodes, one should do this in the two scripts 16 | **pycall-gen.py** and **pyx-gen.py**, and then regenerate the 17 | opcodes files by running these scripts. 18 | 19 | NOTES 20 | --- 21 | These opcodes require the Python virtual machine to be initialized, which 22 | can be done by putting the `pyinit` opcode in the orchestra header. 23 | 24 | See the [Python opcodes pages](https://csound.com/docs/manual/py.html) of the Csound manual, 25 | and examples in the **examples** directory. 26 | -------------------------------------------------------------------------------- /7.x/src/py/src/README.md: -------------------------------------------------------------------------------- 1 | PYTHON OPCODES FOR CSOUND 2 | === 3 | By Maurizio Umberto Puxeddu.
4 | Modified by Michael Gogins for Csound 5, 2004 July 24.
5 | Modified by François Pinot for using with Python 3.x, 2019 November.
6 | 7 | BEFORE COMPILING 8 | --- 9 | To generate the source code for the Python opcodes just run the **pycall-gen.py** 10 | and **pyx-gen.py** scripts in this directory. 11 | 12 | This way of doing had been broken by adding different modifications directly to 13 | the **pycall.auto.c** and **pyx.auto.c** files. These modifications have been integrated 14 | back into the **pycall-gen.py** and **pyx-gen.py** scripts. 15 | So if one has to modifiy the opcodes, one should do this in the two scripts 16 | **pycall-gen.py** and **pyx-gen.py**, and then regenerate the 17 | opcodes files by running these scripts. 18 | 19 | NOTES 20 | --- 21 | These opcodes require the Python virtual machine to be initialized, which 22 | can be done by putting the `pyinit` opcode in the orchestra header. 23 | 24 | See the [Python opcodes pages](https://csound.com/docs/manual/py.html) of the Csound manual, 25 | and examples in the **examples** directory. 26 | -------------------------------------------------------------------------------- /6.x/installer/win64/buildWindows.sh: -------------------------------------------------------------------------------- 1 | #Simple script to build plugins on Windows. Modify each of the paths below for your own needs.. 2 | 3 | cd ../../build 4 | cmake -DFLTK_BASE_LIBRARY_DEBUG=../../../../vcpkg/installed/x64-windows-csound/lib/fltkd.lib \ 5 | -DFLTK_BASE_LIBRARY_RELEASE=../../vcpkg/installed/x64-windows-csound/lib/fltk.lib \ 6 | -DFLTK_INCLUDE_DIR=../../vcpkg/packages/fltk_x64-windows-csound/include \ 7 | -DFLTK_FLUID_EXECUTABLE=../../vcpkg/installed/x64-windows-csound/tools/fluidsynth/fluidsynth.exe \ 8 | -DFLTK_FORMS_LIBRARY_RELEASE=../../vcpkg/installed/x64-windows-csound/lib/fltk_forms.lib \ 9 | -DFLTK_IMAGES_LIBRARY_RELEASE=../../vcpkg/installed/x64-windows-csound/lib/fltk_images.lib \ 10 | -DABLETON_LINK_HOME=D:/sourcecode/link \ 11 | -DPNG_PNG_INCLUDE_DIR=../../vcpkg/installed/x64-windows-csound/include \ 12 | -DPNG_LIBRARY_RELEASE=C:/Python36/DLLs/png.lib \ 13 | -DEIGEN3_INCLUDE_DIR=D:/sourcecode/eigen-3.4-rc1 \ 14 | -DFAUST_INCLUDE_DIR_HINT="C:/Program Files/Faust/include" \ 15 | -DFAUST_LIB_DIR_HINT="C:/Program Files/Faust/lib" \ 16 | -DBUILD_FAUST_OPCODES=ON .. 17 | 18 | cmake --build . --config Release 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/Program.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Program.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef PROGRAM_HPP_ 25 | #define PROGRAM_HPP_ 26 | 27 | class Program 28 | { 29 | public: 30 | Program(int num, char * programName); 31 | int programNum; 32 | char * name; 33 | }; 34 | 35 | #endif /*PROGRAM_HPP_*/ 36 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/SliderData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SliderData.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #include "SliderData.hpp" 25 | 26 | SliderData::SliderData() 27 | { 28 | for(int i = 0; i < 10; i++) { 29 | controllerNumber[i] = (i + 1); 30 | previousControllerNumber[i] = -1; 31 | controllerValue[i] = 0; 32 | previousControllerValue[i] = -1; 33 | } 34 | } 35 | 36 | SliderData::~SliderData() 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/SliderData.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | SliderData.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef SLIDERDATA_HPP_ 25 | #define SLIDERDATA_HPP_ 26 | 27 | class SliderData 28 | { 29 | public: 30 | SliderData(); 31 | virtual ~SliderData(); 32 | 33 | int controllerNumber[10]; 34 | int previousControllerNumber[10]; 35 | int controllerValue[10]; 36 | int previousControllerValue[10]; 37 | }; 38 | 39 | #endif /*SLIDERDATA_HPP_*/ 40 | -------------------------------------------------------------------------------- /6.x/cmake/Modules/FindFLUIDSYNTH.cmake: -------------------------------------------------------------------------------- 1 | # - Find fluidsynth 2 | # Find the native fluidsynth includes and library 3 | # 4 | # FLUIDSYNTH_INCLUDE_DIR - where to find fluidsynth.h 5 | # FLUIDSYNTH_LIBRARIES - List of libraries when using fluidsynth. 6 | # FLUIDSYNTH_FOUND - True if fluidsynth found. 7 | 8 | if (FLUIDSYNTH_INCLUDE_DIR AND FLUIDSYNTH_LIBRARIES) 9 | # Already in cache, be silent 10 | set (FLUIDSYNTH_FIND_QUIETLY TRUE) 11 | endif () 12 | 13 | if(APPLE) 14 | find_path(FLUIDSYNTH_INCLUDE_DIR fluidsynth.h HINTS 15 | /Library/Frameworks/FluidSynth.framework/Headers 16 | ${FLUIDSYNTH_INCLUDE_DIR_HINT}) 17 | else() 18 | find_path (FLUIDSYNTH_INCLUDE_DIR fluidsynth.h) 19 | endif() 20 | 21 | if(APPLE) 22 | find_library(FLUIDSYNTH_LIBRARIES NAMES FluidSynth HINTS 23 | /Library/Frameworks/FluidSynth.framework/ 24 | ${FLUIDSYNTH_LIBRARY_DIR_HINT}) 25 | else() 26 | find_library (FLUIDSYNTH_LIBRARIES NAMES fluidsynth libfluidsynth) 27 | endif() 28 | 29 | mark_as_advanced (FLUIDSYNTH_LIBRARIES FLUIDSYNTH_INCLUDE_DIR) 30 | 31 | # handle the QUIETLY and REQUIRED arguments and set FLUIDSYNTH_FOUND to TRUE if 32 | # all listed variables are TRUE 33 | include(FindPackageHandleStandardArgs) 34 | find_package_handle_standard_args(FLUIDSYNTH DEFAULT_MSG FLUIDSYNTH_LIBRARIES FLUIDSYNTH_INCLUDE_DIR) 35 | -------------------------------------------------------------------------------- /6.x/src/hdf5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_HDF5_OPCODES "Build the hdf5 read/write opcodes" ON) 2 | 3 | find_package(HDF5) 4 | check_deps(BUILD_HDF5_OPCODES HDF5_FOUND) 5 | 6 | if(BUILD_HDF5_OPCODES AND HDF5_FOUND) 7 | # split version string, as cmake doesn't do this automatically 8 | string(REPLACE "." ";" VERSION_LIST ${HDF5_VERSION}) 9 | list(GET VERSION_LIST 0 HDF5_VERSION_MAJOR) 10 | list(GET VERSION_LIST 1 HDF5_VERSION_MINOR) 11 | list(GET VERSION_LIST 2 HDF5_VERSION_PATCH) 12 | 13 | make_plugin(hdf5ops HDF5IO.c) 14 | 15 | target_compile_definitions(hdf5ops PRIVATE 16 | -DHDF5_VERSION_MAJOR=${HDF5_VERSION_MAJOR} 17 | -DHDF5_VERSION_MINOR=${HDF5_VERSION_MINOR} 18 | -DHDF5_VERSION_PATCH=${HDF5_VERSION_PATCH} 19 | ) 20 | 21 | if(USE_VCPKG) 22 | target_include_directories(hdf5ops PRIVATE ${HDF5_INCLUDE_DIRS} ${CSOUND_INCLUDE_DIRS}) 23 | target_link_libraries(hdf5ops PRIVATE hdf5::hdf5-static hdf5::hdf5_hl-static) 24 | else() 25 | message(STATUS "HDF5_INCLUDE_DIRS: ${HDF5_INCLUDE_DIRS}") 26 | message(STATUS "HDF5_LIBRARIES: ${HDF5_LIBRARIES}") 27 | 28 | target_include_directories(hdf5ops PRIVATE ${HDF5_INCLUDE_DIRS} ${CSOUND_INCLUDE_DIRS}) 29 | target_link_libraries(hdf5ops ${HDF5_LIBRARIES}) 30 | endif() 31 | endif() 32 | -------------------------------------------------------------------------------- /7.x/cmake/Modules/FindFLUIDSYNTH.cmake: -------------------------------------------------------------------------------- 1 | # - Find fluidsynth 2 | # Find the native fluidsynth includes and library 3 | # 4 | # FLUIDSYNTH_INCLUDE_DIR - where to find fluidsynth.h 5 | # FLUIDSYNTH_LIBRARIES - List of libraries when using fluidsynth. 6 | # FLUIDSYNTH_FOUND - True if fluidsynth found. 7 | 8 | if (FLUIDSYNTH_INCLUDE_DIR AND FLUIDSYNTH_LIBRARIES) 9 | # Already in cache, be silent 10 | set (FLUIDSYNTH_FIND_QUIETLY TRUE) 11 | endif () 12 | 13 | if(APPLE) 14 | find_path(FLUIDSYNTH_INCLUDE_DIR fluidsynth.h HINTS 15 | /Library/Frameworks/FluidSynth.framework/Headers 16 | ${FLUIDSYNTH_INCLUDE_DIR_HINT}) 17 | else() 18 | find_path (FLUIDSYNTH_INCLUDE_DIR fluidsynth.h) 19 | endif() 20 | 21 | if(APPLE) 22 | find_library(FLUIDSYNTH_LIBRARIES NAMES FluidSynth HINTS 23 | /Library/Frameworks/FluidSynth.framework/ 24 | ${FLUIDSYNTH_LIBRARY_DIR_HINT}) 25 | else() 26 | find_library (FLUIDSYNTH_LIBRARIES NAMES fluidsynth libfluidsynth) 27 | endif() 28 | 29 | mark_as_advanced (FLUIDSYNTH_LIBRARIES FLUIDSYNTH_INCLUDE_DIR) 30 | 31 | # handle the QUIETLY and REQUIRED arguments and set FLUIDSYNTH_FOUND to TRUE if 32 | # all listed variables are TRUE 33 | include(FindPackageHandleStandardArgs) 34 | find_package_handle_standard_args(FLUIDSYNTH DEFAULT_MSG FLUIDSYNTH_LIBRARIES FLUIDSYNTH_INCLUDE_DIR) 35 | -------------------------------------------------------------------------------- /6.x/src/py/src/pythonhelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pythonhelper.h 3 | * 4 | * Copyright (C) 2002 Maurizio Umberto Puxeddu 5 | * 6 | * This software is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This software is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this software; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef _pycsound_pythonhelper_h_ 22 | #define _pycsound_pythonhelper_h_ 23 | 24 | #ifdef _DEBUG 25 | # undef _DEBUG 26 | # include 27 | # define _DEBUG 28 | #else 29 | # include 30 | #endif 31 | 32 | /* 33 | I do it because I can't #include in "csoundCore.h". 34 | */ 35 | 36 | #define GETPYLOCAL(ids) ((PyObject *)ids->pylocal) 37 | #define SETPYLOCAL(ids, p) { ids->pylocal = (void *)p; } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /6.x/src/faustcsound/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build faustcsound opcodes 2 | option(BUILD_FAUST_OPCODES "Build the Faust opcodes" ON) 3 | 4 | find_package(FAUST) 5 | check_deps(BUILD_FAUST_OPCODES FAUST_FOUND) 6 | 7 | if(BUILD_FAUST_OPCODES AND FAUST_FOUND) 8 | make_plugin(faustcsound faustgen.cpp) 9 | 10 | if(APPLE) 11 | set_target_properties(faustcsound PROPERTIES 12 | INSTALL_RPATH_USE_LINK_PATH TRUE 13 | ) 14 | endif() 15 | 16 | target_include_directories(faustcsound PRIVATE ${CSOUND_INCLUDE_DIRS}) 17 | target_link_libraries(faustcsound ${PTHREAD_LIBRARY}) 18 | target_compile_definitions(faustcsound PRIVATE "-DFAUSTFLOAT=MYFLT") 19 | 20 | if(PTHREAD_LIBRARY) 21 | target_compile_definitions(faustcsound PRIVATE "-DHAVE_PTHREAD") 22 | endif() 23 | 24 | if(APPLE) 25 | if(${OSX_VERSION} STREQUAL "10.6") 26 | target_link_libraries(faustcsound ${FAUST_LIBRARIES}) 27 | else() 28 | target_compile_options(faustcsound PRIVATE "-stdlib=libc++") 29 | target_link_libraries(faustcsound ${FAUST_LIBRARIES} -stdlib=libc++) 30 | endif() 31 | else() 32 | target_link_libraries(faustcsound ${FAUST_LIBRARIES}) 33 | endif() 34 | 35 | target_include_directories(faustcsound PRIVATE ${FAUST_INCLUDE_DIR}) 36 | message("-- FAUST INCLUDE DIR: ${FAUST_INCLUDE_DIR}") 37 | endif() 38 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/keyboard.map: -------------------------------------------------------------------------------- 1 | # Custom Keyboard Map for Virtual Keyboard 2 | # Steven Yi 3 | # 4 | # USAGE 5 | # 6 | # When using the Virtual Keyboard, you can supply a filename for a mapping 7 | # of banks and programs via the -M flag, for example: 8 | # 9 | # csound -+rtmidi=virtual -Mkeyboard.map my_project.csd 10 | # 11 | # INFORMATION ON THE FORMAT 12 | # 13 | # -lines that start with '#' are comments 14 | # -lines that have [] start new bank definitions, 15 | # the contents are bankNum=bankName, with bankNum=[1,16384] 16 | # -lines following bank statements are program definitions 17 | # in the format programNum=programName, with programNum=[1,128] 18 | # -bankNumbers and programNumbers are defined in this file 19 | # starting with 1, but are converted to midi values (starting 20 | # with 0) when read 21 | # 22 | # NOTES 23 | # 24 | # -if an invalid bank definition is found, all program 25 | # defintions that follow will be ignored until a new 26 | # valid bank definition is found 27 | # -if a valid bank is defined by no valid programs found 28 | # for that bank, it will default to General MIDI program 29 | # definitions 30 | # -if an invalid program definition is found, it will be 31 | # ignored 32 | 33 | [1=My Bank] 34 | 1=My Test Patch 1 35 | 2=My Test Patch 2 36 | 30=My Test Patch 30 37 | 38 | [2=My Bank2] 39 | 1=My Test Patch 1(bank2) 40 | 2=My Test Patch 2(bank2) 41 | 30=My Test Patch 30(bank3) 42 | -------------------------------------------------------------------------------- /6.x/src/py/src/pythonopcodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pythonopcodes.h 3 | * 4 | * Copyright (C) 2002 Maurizio Umberto Puxeddu 5 | * 6 | * This software is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This software is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this software; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef _pycsound_pythonopcodes_h_ 22 | #define _pycsound_pythonopcodes_h_ 23 | 24 | #ifdef _DEBUG 25 | # undef _DEBUG 26 | # include 27 | # define _DEBUG 28 | #else 29 | # include 30 | #endif 31 | #include "csdl.h" 32 | #include "pyx.auto.h" 33 | #include "pycall.auto.h" 34 | 35 | typedef struct { 36 | OPDS h; 37 | } PYINIT; 38 | 39 | typedef struct { 40 | OPDS h; 41 | STRINGDAT *function; 42 | MYFLT *nresult; 43 | MYFLT *args[VARGMAX]; 44 | } PYCALLN; 45 | 46 | #endif /* _pycsound_pythonopcodes_h_ */ 47 | 48 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/Bank.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Bank.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef BANK_HPP_ 25 | #define BANK_HPP_ 26 | 27 | #include 28 | #include "csdl.h" 29 | #include "Program.hpp" 30 | 31 | using namespace std; 32 | 33 | class Bank 34 | { 35 | public: 36 | Bank(CSOUND *csound, char *bankName); 37 | virtual ~Bank(); 38 | 39 | char *name; 40 | int bankNum; 41 | 42 | vector programs; 43 | 44 | int previousProgram; 45 | int currentProgram; 46 | 47 | void initializeGM(); 48 | }; 49 | 50 | #endif /*BANK_HPP_*/ 51 | -------------------------------------------------------------------------------- /7.x/src/py/src/pythonopcodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pythonopcodes.h 3 | * 4 | * Copyright (C) 2002 Maurizio Umberto Puxeddu 5 | * 6 | * This software is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This software is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this software; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef _pycsound_pythonopcodes_h_ 22 | #define _pycsound_pythonopcodes_h_ 23 | 24 | #ifdef _DEBUG 25 | # undef _DEBUG 26 | # include 27 | # define _DEBUG 28 | #else 29 | # include 30 | #endif 31 | #include "csdl.h" 32 | #include "pyx.auto.h" 33 | #include "pycall.auto.h" 34 | 35 | typedef struct { 36 | OPDS h; 37 | } PYINIT; 38 | 39 | typedef struct { 40 | OPDS h; 41 | STRINGDAT *function; 42 | MYFLT *nresult; 43 | MYFLT *args[VARGMAX]; 44 | } PYCALLN; 45 | 46 | #endif /* _pycsound_pythonopcodes_h_ */ 47 | 48 | -------------------------------------------------------------------------------- /6.x/src/p5glove/libp5glove/macosx_usb_hid.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2004 Tim Kreger 3 | 4 | Macintosh OS X USB HID I/O routines 5 | 6 | Created by Tim Kreger on Wed Mar 17 2004. 7 | */ 8 | /* 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation; either version 2.1 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 | */ 23 | 24 | 25 | #ifndef INCLUDED_WIN32_USB_HID_H 26 | #define INCLUDED_WIN32_USB_HID_H 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /* 33 | these calls are roughly equivalent to those defined in win32_usb_hid.h 34 | */ 35 | 36 | typedef void* USBHIDHandle; 37 | 38 | #define INVALID_USBHIDHANDLE_VALUE (0) 39 | 40 | 41 | USBHIDHandle OpenUSBHID( int index, int idVendor, int idProduct, int versionNumber, int flags ); 42 | 43 | 44 | void CloseUSBHID( USBHIDHandle usbHidHandle ); 45 | 46 | 47 | int ReadUSBHID( USBHIDHandle usbHidHandle, void *data, int count ); 48 | 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* INCLUDED_WIN32_USB_HID_H */ -------------------------------------------------------------------------------- /6.x/src/widgets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(USE_FLTK "Use FLTK for graphs and widget opcodes" ON) 2 | 3 | set(FLTK_SKIP_OPENGL true) 4 | 5 | if(USE_VCPKG) 6 | find_package(FLTK CONFIG) 7 | else() 8 | find_package(FLTK) 9 | endif() 10 | 11 | check_deps(USE_FLTK FLTK_FOUND) 12 | 13 | if(USE_FLTK) 14 | set(widgets_SRCS FL_graph.cpp winFLTK.c widgets.cpp) 15 | 16 | make_plugin(widgets "${widgets_SRCS}" "${FLTK_LIBRARIES}") 17 | target_include_directories(widgets PRIVATE ${CSOUND_INCLUDE_DIRS} ${FLTK_INCLUDE_DIR}) 18 | 19 | if(USE_VCPKG) 20 | target_link_libraries(widgets PRIVATE fltk fltk_gl fltk_forms fltk_images) 21 | else() 22 | target_link_libraries(widgets PRIVATE 23 | ${FLTK_BASE_LIBRARY} ${FLTK_FORMS_LIBRARY} ${FLTK_IMAGES_LIBRARY} 24 | ) 25 | endif() 26 | endif() 27 | 28 | if(USE_FLTK) 29 | set(virtual_SRCS 30 | virtual_keyboard/FLTKKeyboard.cpp 31 | virtual_keyboard/FLTKKeyboardWindow.cpp 32 | virtual_keyboard/FLTKKeyboardWidget.cpp 33 | virtual_keyboard/virtual_keyboard.cpp 34 | virtual_keyboard/Bank.cpp 35 | virtual_keyboard/KeyboardMapping.cpp 36 | virtual_keyboard/Program.cpp 37 | virtual_keyboard/SliderBank.cpp 38 | virtual_keyboard/SliderData.cpp) 39 | 40 | make_plugin(virtual "${virtual_SRCS}" "${FLTK_LIBRARIES}") 41 | target_include_directories(virtual PRIVATE ${CSOUND_INCLUDE_DIRS} ${FLTK_INCLUDE_DIR} ".") 42 | 43 | if (USE_VCPKG) 44 | target_link_libraries(virtual PRIVATE fltk fltk_gl fltk_forms fltk_images) 45 | else() 46 | target_link_libraries(virtual PRIVATE 47 | ${FLTK_BASE_LIBRARY} ${FLTK_FORMS_LIBRARY} ${FLTK_IMAGES_LIBRARY} 48 | ) 49 | endif() 50 | endif() 51 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pycall3.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni {{ 9 | def f0(a, b, c, d, e, f, g, h): 10 | pass 11 | 12 | def f1(a, b, c, d, e, f, g, h): 13 | return a 14 | 15 | def f2(a, b, c, d, e, f, g, h): 16 | return a, b 17 | 18 | def f3(a, b, c, d, e, f, g, h): 19 | return a, b, c 20 | 21 | def f4(a, b, c, d, e, f, g, h): 22 | return a, b, c, d 23 | 24 | def f5(a, b, c, d, e, f, g, h): 25 | return a, b, c, d, e 26 | 27 | def f6(a, b, c, d, e, f, g, h): 28 | return a, b, c, d, e, f 29 | 30 | def f7(a, b, c, d, e, f, g, h): 31 | return a, b, c, d, e, f, g 32 | 33 | def f8(a, b, c, d, e, f, g, h): 34 | return a, b, c, d, e, f, g, h 35 | }} 36 | 37 | instr 1 38 | 39 | pycall "f0", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 40 | k1 pycall1 "f1", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 41 | k1, k2 pycall2 "f2", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 42 | k1, k2, k3 pycall3 "f3", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 43 | k1, k2, k3, k4 pycall4 "f4", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 44 | k1, k2, k3, k4, k5 pycall5 "f5", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 45 | k1, k2, k3, k4, k5, k6 pycall6 "f6", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 46 | k1, k2, k3, k4, k5, k6, k7 pycall7 "f7", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 47 | k1, k2, k3, k4, k5, k6, k7, k8 pycall8 "f8", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 48 | 49 | printk 0.01, k1 50 | printk 0.01, k2 51 | printk 0.01, k3 52 | printk 0.01, k4 53 | printk 0.01, k5 54 | printk 0.01, k6 55 | printk 0.01, k7 56 | printk 0.01, k8 57 | endin 58 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pycall3.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni {{ 9 | def f0(a, b, c, d, e, f, g, h): 10 | pass 11 | 12 | def f1(a, b, c, d, e, f, g, h): 13 | return a 14 | 15 | def f2(a, b, c, d, e, f, g, h): 16 | return a, b 17 | 18 | def f3(a, b, c, d, e, f, g, h): 19 | return a, b, c 20 | 21 | def f4(a, b, c, d, e, f, g, h): 22 | return a, b, c, d 23 | 24 | def f5(a, b, c, d, e, f, g, h): 25 | return a, b, c, d, e 26 | 27 | def f6(a, b, c, d, e, f, g, h): 28 | return a, b, c, d, e, f 29 | 30 | def f7(a, b, c, d, e, f, g, h): 31 | return a, b, c, d, e, f, g 32 | 33 | def f8(a, b, c, d, e, f, g, h): 34 | return a, b, c, d, e, f, g, h 35 | }} 36 | 37 | instr 1 38 | 39 | pycall "f0", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 40 | k1 pycall1 "f1", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 41 | k1, k2 pycall2 "f2", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 42 | k1, k2, k3 pycall3 "f3", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 43 | k1, k2, k3, k4 pycall4 "f4", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 44 | k1, k2, k3, k4, k5 pycall5 "f5", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 45 | k1, k2, k3, k4, k5, k6 pycall6 "f6", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 46 | k1, k2, k3, k4, k5, k6, k7 pycall7 "f7", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 47 | k1, k2, k3, k4, k5, k6, k7, k8 pycall8 "f8", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 48 | 49 | printk 0.01, k1 50 | printk 0.01, k2 51 | printk 0.01, k3 52 | printk 0.01, k4 53 | printk 0.01, k5 54 | printk 0.01, k6 55 | printk 0.01, k7 56 | printk 0.01, k8 57 | endin 58 | -------------------------------------------------------------------------------- /6.x/src/image/imageOpcodes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * IMAGE OPCODES 3 | * 4 | * imageOpcodes.h 5 | * 6 | * Copyright (c) 2007 by Cesare Marilungo. All rights reserved. 7 | * 8 | * L I C E N S E 9 | * 10 | * This software is free software; you can redistribute it and/or 11 | * modify it under the terms of the GNU Lesser General Public 12 | * License as published by the Free Software Foundation; either 13 | * version 2.1 of the License, or (at your option) any later version. 14 | * 15 | * This software is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | * Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public 21 | * License along with this software; if not, write to the Free Software 22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 | * 24 | */ 25 | 26 | typedef struct 27 | { 28 | unsigned char *imageData; 29 | int32_t 30 | w,h; 31 | } Image; 32 | 33 | typedef struct 34 | { 35 | Image **images; 36 | size_t cnt; 37 | } Images; 38 | 39 | typedef struct 40 | { 41 | OPDS h; 42 | MYFLT *kn; 43 | STRINGDAT *ifilnam ; 44 | } IMGLOAD; 45 | 46 | typedef struct 47 | { 48 | OPDS h; 49 | MYFLT *kn, *kw, *kh ; 50 | } IMGCREATE; 51 | 52 | typedef struct 53 | { 54 | OPDS h; 55 | MYFLT *kw, *kh, *kn; 56 | } IMGSIZE; 57 | 58 | typedef struct 59 | { 60 | OPDS h; 61 | MYFLT *kr,*kg,*kb, *kn, *kx,*ky; 62 | } IMGGETPIXEL; 63 | 64 | typedef struct 65 | { 66 | OPDS h; 67 | MYFLT *kn,*kx,*ky,*kr,*kg,*kb; 68 | } IMGSETPIXEL; 69 | typedef struct 70 | { 71 | OPDS h; 72 | MYFLT *kn; 73 | STRINGDAT *ifilnam; 74 | } IMGSAVE; 75 | 76 | typedef struct 77 | { 78 | OPDS h; 79 | MYFLT *kn; 80 | } IMGFREE; 81 | -------------------------------------------------------------------------------- /7.x/src/py/src/pythonhelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pythonhelper.h 3 | * 4 | * Copyright (C) 2002 Maurizio Umberto Puxeddu 5 | * 6 | * This software is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This software is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this software; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef _pycsound_pythonhelper_h_ 22 | #define _pycsound_pythonhelper_h_ 23 | 24 | #ifdef _DEBUG 25 | # undef _DEBUG 26 | # include 27 | # define _DEBUG 28 | #else 29 | # include 30 | #endif 31 | 32 | /* PyLocal variable is now a global variable indexed by INSDS */ 33 | static inline PyObject *GetPyLocal(INSDS *ids){ 34 | char insds[32]; 35 | CSOUND *csound = ids->csound; 36 | snprintf(insds, 32, "PYLOCAL:%p", ids); 37 | PyObject **p = (PyObject **) csound->QueryGlobalVariable(csound,insds); 38 | return *p; 39 | } 40 | 41 | static inline void SetPyLocal(INSDS *ids, void *pp){ 42 | char insds[32]; 43 | CSOUND *csound = ids->csound; 44 | snprintf(insds, 32, "PYLOCAL:%p", ids); 45 | PyObject **p = (PyObject **) csound->QueryGlobalVariable(csound,insds); 46 | *p = (PyObject *) pp; 47 | } 48 | 49 | #define GETPYLOCAL(ids) (GetPyLocal(ids)) 50 | #define SETPYLOCAL(ids, p) { SetPyLocal(ids, p); } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /6.x/cmake/CompilerOptimizations.cmake: -------------------------------------------------------------------------------- 1 | 2 | check_c_compiler_flag(-ftree-vectorize HAS_TREE_VECTORIZE) 3 | check_cxx_compiler_flag(-ftree-vectorize HAS_CXX_TREE_VECTORIZE) 4 | if (HAS_TREE_VECTORISE) 5 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize") 6 | endif() 7 | if (HAS_CXX_TREE_VECTORISE) 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize") 9 | endif() 10 | 11 | 12 | check_c_compiler_flag(-ffast-math HAS_FAST_MATH) 13 | check_cxx_compiler_flag(-ffast-math HAS_CXX_FAST_MATH) 14 | if (HAS_FAST_MATH AND NOT MINGW) 15 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math") 16 | endif() 17 | if (HAS_CXX_FAST_MATH AND NOT MINGW) 18 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math") 19 | endif() 20 | 21 | 22 | 23 | if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 24 | check_c_compiler_flag(-mfpmath=sse HAS_FPMATH_SSE) 25 | check_cxx_compiler_flag(-mfpmath=sse HAS_CXX_FPMATH_SSE) 26 | if (HAS_FPMATH_SSE) 27 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse") 28 | endif() 29 | if (HAS_CXX_FPMATH_SSE) 30 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse") 31 | endif() 32 | 33 | endif() 34 | 35 | 36 | check_c_compiler_flag(-msse2 HAS_SSE2) 37 | check_cxx_compiler_flag(-msse2 HAS_CXX_SSE2) 38 | if (HAS_SSE2 AND NOT IOS AND NOT WASM) 39 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") 40 | endif() 41 | if (HAS_CXX_SSE2 AND NOT IOS AND NOT WASM) 42 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2") 43 | endif() 44 | 45 | 46 | check_c_compiler_flag(-fomit-frame-pointer HAS_OMIT_FRAME_POINTER) 47 | check_cxx_compiler_flag(-fomit-frame-pointer HAS_CXX_OMIT_FRAME_POINTER) 48 | if (HAS_OMIT_FRAME_POINTER) 49 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer") 50 | endif() 51 | if (HAS_CXX_OMIT_FRAME_POINTER) 52 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer") 53 | endif() 54 | -------------------------------------------------------------------------------- /7.x/cmake/CompilerOptimizations.cmake: -------------------------------------------------------------------------------- 1 | 2 | check_c_compiler_flag(-ftree-vectorize HAS_TREE_VECTORIZE) 3 | check_cxx_compiler_flag(-ftree-vectorize HAS_CXX_TREE_VECTORIZE) 4 | if (HAS_TREE_VECTORISE) 5 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize") 6 | endif() 7 | if (HAS_CXX_TREE_VECTORISE) 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize") 9 | endif() 10 | 11 | 12 | check_c_compiler_flag(-ffast-math HAS_FAST_MATH) 13 | check_cxx_compiler_flag(-ffast-math HAS_CXX_FAST_MATH) 14 | if (HAS_FAST_MATH AND NOT MINGW) 15 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math") 16 | endif() 17 | if (HAS_CXX_FAST_MATH AND NOT MINGW) 18 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math") 19 | endif() 20 | 21 | 22 | 23 | if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 24 | check_c_compiler_flag(-mfpmath=sse HAS_FPMATH_SSE) 25 | check_cxx_compiler_flag(-mfpmath=sse HAS_CXX_FPMATH_SSE) 26 | if (HAS_FPMATH_SSE) 27 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpmath=sse") 28 | endif() 29 | if (HAS_CXX_FPMATH_SSE) 30 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse") 31 | endif() 32 | 33 | endif() 34 | 35 | 36 | check_c_compiler_flag(-msse2 HAS_SSE2) 37 | check_cxx_compiler_flag(-msse2 HAS_CXX_SSE2) 38 | if (HAS_SSE2 AND NOT IOS AND NOT WASM) 39 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2") 40 | endif() 41 | if (HAS_CXX_SSE2 AND NOT IOS AND NOT WASM) 42 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2") 43 | endif() 44 | 45 | 46 | check_c_compiler_flag(-fomit-frame-pointer HAS_OMIT_FRAME_POINTER) 47 | check_cxx_compiler_flag(-fomit-frame-pointer HAS_CXX_OMIT_FRAME_POINTER) 48 | if (HAS_OMIT_FRAME_POINTER) 49 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fomit-frame-pointer") 50 | endif() 51 | if (HAS_CXX_OMIT_FRAME_POINTER) 52 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fomit-frame-pointer") 53 | endif() 54 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/FLTKKeyboard.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | FLTKKeyboard.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef FLTKKEYBOARD_HPP_ 25 | #define FLTKKEYBOARD_HPP_ 26 | 27 | #include 28 | #include 29 | #include "csdl.h" 30 | #include "SliderBank.hpp" 31 | 32 | class FLTKKeyboard : public Fl_Widget { 33 | public: 34 | FLTKKeyboard(CSOUND *csound, SliderBank *sliderBank, 35 | int X, int Y, int W, int H, const char *L); 36 | ~FLTKKeyboard(); 37 | int handle(int event); 38 | void draw(); 39 | int keyStates[88]; 40 | int changedKeyStates[88]; 41 | int whiteKeys[7]; 42 | void lock(); 43 | void unlock(); 44 | void allNotesOff(); 45 | int aNotesOff; 46 | int octave; 47 | private: 48 | int getMIDIKey(int x, int y); 49 | int lastMidiKey; 50 | int isWhiteKey(int key); 51 | int getMidiValForWhiteKey(int whiteKeyNum); 52 | void handleKey(int key, int value); 53 | void handleControl(int key); 54 | 55 | CSOUND *csound; 56 | void * mutex; 57 | SliderBank *sliderBank; 58 | }; 59 | 60 | #endif /*FLTKKEYBOARD_HPP_*/ 61 | -------------------------------------------------------------------------------- /6.x/src/py/src/pyx.auto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pyx.auto.h 3 | * 4 | * Copyright (C) 2002 Maurizio Umberto Puxeddu, Michael Gogins 5 | * 6 | * This software is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This software is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this software; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | * Don't modify this file. It's automatically generated by pyx-gen.py 21 | */ 22 | 23 | typedef struct { 24 | OPDS h; 25 | STRINGDAT *string; 26 | } PYEXEC; 27 | 28 | typedef struct { 29 | OPDS h; 30 | MYFLT *trigger; 31 | STRINGDAT *string; 32 | } PYEXECT; 33 | 34 | typedef struct { 35 | OPDS h; 36 | STRINGDAT *string; 37 | } PYRUN; 38 | 39 | typedef struct { 40 | OPDS h; 41 | MYFLT *trigger; 42 | STRINGDAT *string; 43 | } PYRUNT; 44 | 45 | typedef struct { 46 | OPDS h; 47 | MYFLT *result; 48 | STRINGDAT *string; 49 | } PYEVAL; 50 | 51 | typedef struct { 52 | OPDS h; 53 | MYFLT *result; 54 | MYFLT *trigger; 55 | STRINGDAT *string; 56 | MYFLT oresult; 57 | } PYEVALT; 58 | 59 | typedef struct { 60 | OPDS h; 61 | STRINGDAT *string; 62 | MYFLT *value; 63 | } PYASSIGN; 64 | 65 | typedef struct { 66 | OPDS h; 67 | MYFLT *trigger; 68 | STRINGDAT *string; 69 | MYFLT *value; 70 | } PYASSIGNT; 71 | 72 | -------------------------------------------------------------------------------- /7.x/src/py/src/pyx.auto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pyx.auto.h 3 | * 4 | * Copyright (C) 2002 Maurizio Umberto Puxeddu, Michael Gogins 5 | * 6 | * This software is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2.1 of the License, or (at your option) any later version. 10 | * 11 | * This software is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this software; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | * 20 | * Don't modify this file. It's automatically generated by pyx-gen.py 21 | */ 22 | 23 | typedef struct { 24 | OPDS h; 25 | STRINGDAT *string; 26 | } PYEXEC; 27 | 28 | typedef struct { 29 | OPDS h; 30 | MYFLT *trigger; 31 | STRINGDAT *string; 32 | } PYEXECT; 33 | 34 | typedef struct { 35 | OPDS h; 36 | STRINGDAT *string; 37 | } PYRUN; 38 | 39 | typedef struct { 40 | OPDS h; 41 | MYFLT *trigger; 42 | STRINGDAT *string; 43 | } PYRUNT; 44 | 45 | typedef struct { 46 | OPDS h; 47 | MYFLT *result; 48 | STRINGDAT *string; 49 | } PYEVAL; 50 | 51 | typedef struct { 52 | OPDS h; 53 | MYFLT *result; 54 | MYFLT *trigger; 55 | STRINGDAT *string; 56 | MYFLT oresult; 57 | } PYEVALT; 58 | 59 | typedef struct { 60 | OPDS h; 61 | STRINGDAT *string; 62 | MYFLT *value; 63 | } PYASSIGN; 64 | 65 | typedef struct { 66 | OPDS h; 67 | MYFLT *trigger; 68 | STRINGDAT *string; 69 | MYFLT *value; 70 | } PYASSIGNT; 71 | 72 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/SliderBank.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | SliderBank.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef SLIDERBANK_HPP_ 25 | #define SLIDERBANK_HPP_ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include "csdl.h" 32 | #include "SliderData.hpp" 33 | 34 | class WheelSlider: public Fl_Value_Slider 35 | { 36 | int handle(int); 37 | public: 38 | WheelSlider(int x, int y, int w, int h, const char *l=0) : 39 | Fl_Value_Slider (x,y,w,h,l) {} 40 | }; 41 | 42 | class SliderBank : public Fl_Group 43 | { 44 | public: 45 | SliderBank(CSOUND *csound, int X, int Y, int W, int H); 46 | virtual ~SliderBank(); 47 | 48 | CSOUND *csound; 49 | void * mutex; 50 | 51 | void setChannel(int channel); 52 | SliderData *getSliderData(); 53 | 54 | void incrementSlider(int index, int n); 55 | 56 | void lock(); 57 | void unlock(); 58 | 59 | WheelSlider* sliders[10]; 60 | Fl_Spinner* spinners[10]; 61 | 62 | private: 63 | int channel; 64 | SliderData sliderData[16]; 65 | }; 66 | #endif /*SLIDERBANK_HPP_*/ 67 | -------------------------------------------------------------------------------- /6.x/cmake/Modules/FindFAUST.cmake: -------------------------------------------------------------------------------- 1 | # Find Faust2 2 | include(FindPackageHandleStandardArgs) 3 | 4 | find_path(FAUST_INCLUDE_DIR faust/dsp/llvm-dsp.h 5 | HINTS 6 | C:/Program Files/Faust/include/ 7 | /opt/lib/faust/architecture/ 8 | /usr/lib/faust/architecture/ 9 | /usr/local/lib/faust/architecture/ 10 | "${FAUST_INCLUDE_DIR_HINT}" 11 | ) 12 | 13 | find_library(FAUST_LIBRARY 14 | NAMES 15 | libfaust.so 16 | libfaust.dylib 17 | faust.dll 18 | faust 19 | libfaust 20 | HINTS 21 | "${FAUST_LIB_DIR_HINT}" 22 | ) 23 | 24 | find_package_handle_standard_args(FAUST FAUST_INCLUDE_DIR FAUST_LIBRARY) 25 | 26 | if(FAUST_FOUND) 27 | set(FAUST_LIBRARIES ${FAUST_LIBRARY}) 28 | set(FAUST_INCLUDE_DIRS ${FAUST_INCLUDE_DIR}) 29 | 30 | if("${FAUST_LIBRARY}" MATCHES ".*\\.a") 31 | # This is a static build of faust, hence 32 | # we have to add all the LLVM flags... 33 | 34 | find_program(LLVM_CONFIG llvm-config 35 | HINTS 36 | /usr/bin 37 | /usr/local/bin 38 | /usr/local/opt/llvm/bin 39 | ) 40 | 41 | if(NOT LLVM_CONFIG) 42 | message(WARNING "Using a static Faust library requires LLVM tooling to be present in the path.") 43 | UNSET(FAUST_FOUND) 44 | else() 45 | exec_program(${LLVM_CONFIG} ARGS --includedir OUTPUT_VARIABLE LLVM_DIR) 46 | exec_program(${LLVM_CONFIG} ARGS --libs OUTPUT_VARIABLE LLVM_LIBS) 47 | exec_program(${LLVM_CONFIG} ARGS --version OUTPUT_VARIABLE LLVM_VERSION) 48 | exec_program(${LLVM_CONFIG} ARGS --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS) 49 | 50 | set(LLVM_VERSION LLVM_${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}) 51 | 52 | find_package(OpenSSL REQUIRED) 53 | set(FAUST_LIBRARIES ${FAUST_LIBRARIES} dl ${OPENSSL_LIBRARIES} ncurses z ${LLVM_LDFLAGS} ${LLVM_LIBS} ) 54 | endif() 55 | endif() 56 | else() 57 | set(FAUST_LIBRARIES) 58 | set(FAUST_INCLUDE_DIRS) 59 | endif() 60 | -------------------------------------------------------------------------------- /7.x/cmake/Modules/FindFAUST.cmake: -------------------------------------------------------------------------------- 1 | # Find Faust2 2 | include(FindPackageHandleStandardArgs) 3 | 4 | find_path(FAUST_INCLUDE_DIR faust/dsp/llvm-dsp.h 5 | HINTS 6 | C:/Program Files/Faust/include/ 7 | /opt/lib/faust/architecture/ 8 | /usr/lib/faust/architecture/ 9 | /usr/local/lib/faust/architecture/ 10 | "${FAUST_INCLUDE_DIR_HINT}" 11 | ) 12 | 13 | find_library(FAUST_LIBRARY 14 | NAMES 15 | libfaust.so 16 | libfaust.dylib 17 | faust.dll 18 | faust 19 | libfaust 20 | HINTS 21 | "${FAUST_LIB_DIR_HINT}" 22 | ) 23 | 24 | find_package_handle_standard_args(FAUST FAUST_INCLUDE_DIR FAUST_LIBRARY) 25 | 26 | if(FAUST_FOUND) 27 | set(FAUST_LIBRARIES ${FAUST_LIBRARY}) 28 | set(FAUST_INCLUDE_DIRS ${FAUST_INCLUDE_DIR}) 29 | 30 | if("${FAUST_LIBRARY}" MATCHES ".*\\.a") 31 | # This is a static build of faust, hence 32 | # we have to add all the LLVM flags... 33 | 34 | find_program(LLVM_CONFIG llvm-config 35 | HINTS 36 | /usr/bin 37 | /usr/local/bin 38 | /usr/local/opt/llvm/bin 39 | ) 40 | 41 | if(NOT LLVM_CONFIG) 42 | message(WARNING "Using a static Faust library requires LLVM tooling to be present in the path.") 43 | UNSET(FAUST_FOUND) 44 | else() 45 | exec_program(${LLVM_CONFIG} ARGS --includedir OUTPUT_VARIABLE LLVM_DIR) 46 | exec_program(${LLVM_CONFIG} ARGS --libs OUTPUT_VARIABLE LLVM_LIBS) 47 | exec_program(${LLVM_CONFIG} ARGS --version OUTPUT_VARIABLE LLVM_VERSION) 48 | exec_program(${LLVM_CONFIG} ARGS --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS) 49 | 50 | set(LLVM_VERSION LLVM_${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR}) 51 | 52 | find_package(OpenSSL REQUIRED) 53 | set(FAUST_LIBRARIES ${FAUST_LIBRARIES} dl ${OPENSSL_LIBRARIES} ncurses z ${LLVM_LDFLAGS} ${LLVM_LIBS} ) 54 | endif() 55 | endif() 56 | else() 57 | set(FAUST_LIBRARIES) 58 | set(FAUST_INCLUDE_DIRS) 59 | endif() 60 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/FLTKKeyboardWidget.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | FLTKKeyboardWidget.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef FLTKKEYBOARDWIDGET_HPP_ 25 | #define FLTKKEYBOARDWIDGET_HPP_ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include "FLTKKeyboard.hpp" 33 | #include "KeyboardMapping.hpp" 34 | #include "csdl.h" 35 | 36 | class FLTKKeyboardWidget : public Fl_Group { 37 | public: 38 | FLTKKeyboardWidget(CSOUND * csound, const char *deviceMap, 39 | int x, int y, int w, int h); 40 | ~FLTKKeyboardWidget(); 41 | 42 | FLTKKeyboard *keyboard; 43 | Fl_Button *allNotesOffButton; 44 | Fl_Spinner *channelSpinner; 45 | Fl_Choice *bankChoice; 46 | Fl_Choice *programChoice; 47 | Fl_Choice *octaveChoice; 48 | 49 | KeyboardMapping *keyboardMapping; 50 | 51 | int handle(int event); 52 | 53 | void lock(); 54 | void unlock(); 55 | 56 | void setSelectedBank(); 57 | void setProgramNames(); 58 | 59 | private: 60 | CSOUND* csound; 61 | void * mutex; 62 | 63 | }; 64 | 65 | 66 | #endif /*FLTKKEYBOARDWIDGET_HPP_*/ 67 | -------------------------------------------------------------------------------- /6.x/src/wiimote/wii_mac.h: -------------------------------------------------------------------------------- 1 | /* wii_mac.h: Names for WiiMote opcodes in Csound. 2 | Copyright 2009 John ffitch 3 | 4 | This file is part of Csound. 5 | 6 | The Csound Library is free software; you can redistribute it 7 | and/or modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | Csound is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with Csound; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 19 | 02110-1301 USA 20 | */ 21 | 22 | #define WII_BUTTONS (0) 23 | #define WII_TWO (1) 24 | #define WII_ONE (2) 25 | #define WII_B (3) 26 | #define WII_A (4) 27 | #define WII_MINUS (5) 28 | #define WII_HOME (8) 29 | #define WII_LEFT (9) 30 | #define WII_RIGHT (10) 31 | #define WII_DOWN (11) 32 | #define WII_UP (12) 33 | #define WII_PLUS (13) 34 | 35 | #define WII_AXIS_X (17) 36 | #define WII_AXIS_Y (18) 37 | #define WII_AXIS_Z (19) 38 | #define WII_PITCH (20) 39 | #define WII_ROLL (21) 40 | #define WII_YAW (22) 41 | #define WII_FORCE_X (23) 42 | #define WII_FORCE_Y (24) 43 | #define WII_FORCE_Z (25) 44 | #define WII_FORCE_TOTAL (26) 45 | #define WII_BATTERY (27) 46 | #define WII_NUNCHUK_ANG (28) 47 | #define WII_NUNCHUK_MAG (29) 48 | #define WII_NUNCHUK_PITCH (30) 49 | #define WII_NUNCHUK_ROLL (31) 50 | #define WII_NUNCHUK_YAW (32) 51 | #define WII_NUNCHUK_Z (33) 52 | #define WII_NUNCHUK_C (34) 53 | #define WII_IR1_X (35) 54 | #define WII_IR1_Y (36) 55 | #define WII_IR1_Z (37) 56 | 57 | #define WII_RUMBLE (3) 58 | #define WII_SET_LEDS (4) 59 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/FLTKKeyboardWindow.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | FLTKKeyboardWindow.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef FLTKKEYBOARDWINDOW_HPP_ 25 | #define FLTKKEYBOARDWINDOW_HPP_ 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include "FLTKKeyboard.hpp" 33 | #include "KeyboardMapping.hpp" 34 | #include "SliderBank.hpp" 35 | #include "csdl.h" 36 | 37 | class FLTKKeyboardWindow : public Fl_Double_Window { 38 | public: 39 | FLTKKeyboardWindow(CSOUND * csound, const char *deviceMap, 40 | int w, int h, const char* t); 41 | ~FLTKKeyboardWindow(); 42 | 43 | FLTKKeyboard *keyboard; 44 | Fl_Button *allNotesOffButton; 45 | Fl_Spinner *channelSpinner; 46 | Fl_Choice *bankChoice; 47 | Fl_Choice *programChoice; 48 | Fl_Choice *octaveChoice; 49 | 50 | KeyboardMapping *keyboardMapping; 51 | SliderBank *sliderBank; 52 | 53 | int handle(int event); 54 | 55 | void lock(); 56 | void unlock(); 57 | 58 | void setSelectedBank(); 59 | void setProgramNames(); 60 | 61 | private: 62 | CSOUND* csound; 63 | void * mutex; 64 | 65 | }; 66 | 67 | 68 | #endif /*FLTKKEYBOARDWINDOW_HPP_*/ 69 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/KeyboardMapping.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | KeyboardMapping.hpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef KEYBOARDMAPPING_HPP_ 25 | #define KEYBOARDMAPPING_HPP_ 26 | 27 | #include "csdl.h" 28 | #include "Bank.hpp" 29 | #include 30 | #include 31 | #include 32 | 33 | using namespace std; 34 | 35 | class KeyboardMapping { 36 | public: 37 | KeyboardMapping(CSOUND *csound, const char *mapFileName); 38 | ~KeyboardMapping(); 39 | vector banks; 40 | 41 | int getCurrentChannel(); 42 | int getCurrentBank(); 43 | int getPreviousBank(); 44 | int getCurrentProgram(); 45 | int getPreviousProgram(); 46 | 47 | void setCurrentChannel(int index); 48 | void setCurrentBank(int index); 49 | void setPreviousBank(int index); 50 | void setCurrentProgram(int index); 51 | void setPreviousProgram(int index); 52 | 53 | int getCurrentBankMIDINumber(); 54 | 55 | int previousChannel; 56 | int previousProgram; 57 | 58 | private: 59 | void initializeDefaults(CSOUND *); 60 | void initializeMap(CSOUND *, FILE *); 61 | 62 | int currentChannel; 63 | int previousBank[16]; 64 | int currentBank[16]; 65 | }; 66 | 67 | #endif /*KEYBOARDMAPPING_HPP_*/ 68 | -------------------------------------------------------------------------------- /6.x/src/websockets/WebSocketOpcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | WebSocketOpcode.h 4 | WebSockets 5 | 6 | Created by Edward Costello on 10/06/2015. 7 | Copyright (c) 2015 Edward Costello. 8 | 9 | This file is part of Csound. 10 | 11 | The Csound Library is free software; you can redistribute it 12 | and/or modify it under the terms of the GNU Lesser General Public 13 | License as published by the Free Software Foundation; either 14 | version 2.1 of the License, or (at your option) any later version. 15 | 16 | Csound is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU Lesser General Public License for more details. 20 | 21 | You should have received a copy of the GNU Lesser General Public 22 | License along with Csound; if not, write to the Free Software 23 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 24 | 02110-1301 USA 25 | */ 26 | 27 | 28 | #include 29 | #include "csdl.h" 30 | //#include "csound.h" 31 | 32 | #ifdef WIN32 33 | 34 | #define WIN32_LEAN_AND_MEAN 35 | #include 36 | 37 | void usleep(unsigned int usec) 38 | { 39 | HANDLE timer; 40 | LARGE_INTEGER ft; 41 | 42 | ft.QuadPart = -(10 * (__int64)usec); 43 | 44 | timer = CreateWaitableTimer(NULL, TRUE, NULL); 45 | SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0); 46 | WaitForSingleObject(timer, INFINITE); 47 | CloseHandle(timer); 48 | } 49 | 50 | #endif 51 | 52 | 53 | #ifdef __cplusplus 54 | extern "C" 55 | { 56 | #endif 57 | typedef struct OpcodeArgument OpcodeArgument; 58 | typedef struct WebSocket WebSocket; 59 | 60 | typedef struct WebSocketOpcode 61 | { 62 | OPDS h; 63 | MYFLT *arguments[20]; 64 | int32_t inputArgumentCount; 65 | int32_t outputArgumentCount; 66 | WebSocket *webSocket; 67 | OpcodeArgument *inputArguments; 68 | OpcodeArgument *outputArguments; 69 | bool isRunning; 70 | CSOUND *csound; 71 | } WebSocketOpcode; 72 | 73 | int32_t WebSocketOpcode_initialise(CSOUND *csound, WebSocketOpcode *self); 74 | int32_t WebSocketOpcode_process(CSOUND *csound, WebSocketOpcode *self); 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | -------------------------------------------------------------------------------- /6.x/src/AbletonLinkOpcodes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Build Ableton Link Opcodes 2 | option(BUILD_ABLETON_LINK_OPCODES "Build the Ableton link opcodes" OFF) 3 | 4 | if(BUILD_ABLETON_LINK_OPCODES) 5 | message(STATUS "Ableton Link home: ${ABLETON_LINK_HOME}") 6 | 7 | if(APPLE) 8 | make_plugin(ableton_link_opcodes ableton_link_opcodes.cpp) 9 | set_target_properties(ableton_link_opcodes 10 | PROPERTIES 11 | COMPILE_FLAGS "-std=c++11 -stdlib=libc++ -Wno-multichar -DLINK_PLATFORM_MACOSX=1" 12 | LINK_FLAGS "-std=c++11 -stdlib=libc++" 13 | ) 14 | elseif(LINUX) 15 | include(CheckCXXCompilerFlag) 16 | CHECK_CXX_COMPILER_FLAG("-std=gnu++11" COMPILER_SUPPORTS_CXX11) 17 | 18 | if(COMPILER_SUPPORTS_CXX11) 19 | make_plugin(ableton_link_opcodes ableton_link_opcodes.cpp) 20 | set_target_properties(ableton_link_opcodes PROPERTIES COMPILE_FLAGS "-std=gnu++11 -Wno-multichar -DLINK_PLATFORM_LINUX=1") 21 | else() 22 | message(STATUS "Not building ableton_link_opcodes as no C++11 support found.") 23 | endif() 24 | else() 25 | make_plugin(ableton_link_opcodes ableton_link_opcodes.cpp) 26 | 27 | if(WIN32) 28 | if(USE_VCPKG) 29 | find_package(AbletonLink CONFIG REQUIRED PATH_SUFFIXES share/ableton-link) 30 | target_link_libraries(ableton_link_opcodes PRIVATE Ableton::Link) 31 | else() 32 | set_target_properties(ableton_link_opcodes 33 | PROPERTIES 34 | COMPILE_FLAGS "-std=gnu++11 -Wno-multichar -DLINK_PLATFORM_WINDOWS=1" 35 | LINK_FLAGS "-std=gnu++11" 36 | ) 37 | target_link_libraries(ableton_link_opcodes wsock32 ws2_32 iphlpapi) 38 | endif() 39 | endif() 40 | endif() 41 | 42 | target_include_directories(ableton_link_opcodes 43 | PRIVATE 44 | ${CSOUND_INCLUDE_DIRS} 45 | ${ABLETON_LINK_HOME}/include 46 | ${ABLETON_LINK_HOME}/modules/asio-standalone/asio/include 47 | ) 48 | 49 | install(TARGETS ableton_link_opcodes 50 | LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR} 51 | ARCHIVE DESTINATION ${LIBRARY_INSTALL_DIR} 52 | ) 53 | endif() 54 | -------------------------------------------------------------------------------- /6.x/src/py/examples/cabrera/pythonmarkov.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr=44100 8 | ksmps=128 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | ; Python script to define probabilities for each note as lists within a list 14 | ; Definition of the get_new_note function which randomly generates a new 15 | ; note based on the probabilities of each note occuring. 16 | ; Each note list must total 1, or there will be problems! 17 | 18 | pyruni {{c = [0.1, 0.2, 0.05, 0.4, 0.25] 19 | d = [0.4, 0.1, 0.1, 0.2, 0.2] 20 | e = [0.2, 0.35, 0.05, 0.4, 0] 21 | g = [0.7, 0.1, 0.2, 0, 0] 22 | a = [0.1, 0.2, 0.05, 0.4, 0.25] 23 | 24 | markov = [c, d, e, g, a] 25 | 26 | import random 27 | 28 | random.seed() 29 | 30 | def get_new_note(previous_note): 31 | number = random.random() 32 | accum = 0 33 | i = 0 34 | while accum < number: 35 | accum = accum + markov[int(previous_note)][int(i)] 36 | i = i + 1 37 | return i - 1.0 38 | 39 | }} 40 | 41 | 42 | 43 | instr 1 ;Markov chain reader and note spawner 44 | ;p4 = frequency of note generation 45 | ;p5 = octave 46 | ioct init p5 47 | klastnote init 0 ;Used to remember last note played (start at first note of scale) 48 | ktrig metro p4 ;generate a trigger with frequency p4 49 | knewnote pycall1t ktrig, "get_new_note", klastnote ;get new note from chain 50 | schedkwhen ktrig, 0, 10, 2, 0, 0.2, knewnote, ioct ;launch note on instrument 2 51 | klastnote = knewnote ;New note is now the old note 52 | endin 53 | 54 | 55 | instr 2 ;A simple sine wave instrument 56 | ;p4 = note to be played 57 | ;p5 = octave 58 | ioct init p5 59 | ipclass table p4, 2 60 | ipclass = ioct + (ipclass / 100) ; Pitch class of the note 61 | ifreq = cpspch(ipclass) ;Note frequency in Hertz 62 | aenv linen 6000, 0.05, p3, 0.1 ;Amplitude envelope 63 | aout oscil aenv, ifreq , 1 ;Simple oscillator 64 | outs aout, aout 65 | endin 66 | 67 | 68 | 69 | 70 | 71 | f 1 0 2048 10 1 ;sine wave 72 | f 2 0 8 -2 0 2 4 7 9 ;Pitch classes for pentatonic scale 73 | 74 | ; frequency of Octave of 75 | ; note generation melody 76 | i 1 0 30 3 7 77 | i 1 5 25 6 9 78 | i 1 10 20 7.5 10 79 | i 1 15 15 1 8 80 | 81 | 82 | -------------------------------------------------------------------------------- /7.x/src/py/examples/cabrera/pythonmarkov.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | -odac 4 | 5 | 6 | 7 | sr=44100 8 | ksmps=128 9 | nchnls=2 10 | 11 | pyinit 12 | 13 | ; Python script to define probabilities for each note as lists within a list 14 | ; Definition of the get_new_note function which randomly generates a new 15 | ; note based on the probabilities of each note occuring. 16 | ; Each note list must total 1, or there will be problems! 17 | 18 | pyruni {{c = [0.1, 0.2, 0.05, 0.4, 0.25] 19 | d = [0.4, 0.1, 0.1, 0.2, 0.2] 20 | e = [0.2, 0.35, 0.05, 0.4, 0] 21 | g = [0.7, 0.1, 0.2, 0, 0] 22 | a = [0.1, 0.2, 0.05, 0.4, 0.25] 23 | 24 | markov = [c, d, e, g, a] 25 | 26 | import random 27 | 28 | random.seed() 29 | 30 | def get_new_note(previous_note): 31 | number = random.random() 32 | accum = 0 33 | i = 0 34 | while accum < number: 35 | accum = accum + markov[int(previous_note)][int(i)] 36 | i = i + 1 37 | return i - 1.0 38 | 39 | }} 40 | 41 | 42 | 43 | instr 1 ;Markov chain reader and note spawner 44 | ;p4 = frequency of note generation 45 | ;p5 = octave 46 | ioct init p5 47 | klastnote init 0 ;Used to remember last note played (start at first note of scale) 48 | ktrig metro p4 ;generate a trigger with frequency p4 49 | knewnote pycall1t ktrig, "get_new_note", klastnote ;get new note from chain 50 | schedkwhen ktrig, 0, 10, 2, 0, 0.2, knewnote, ioct ;launch note on instrument 2 51 | klastnote = knewnote ;New note is now the old note 52 | endin 53 | 54 | 55 | instr 2 ;A simple sine wave instrument 56 | ;p4 = note to be played 57 | ;p5 = octave 58 | ioct init p5 59 | ipclass table p4, 2 60 | ipclass = ioct + (ipclass / 100) ; Pitch class of the note 61 | ifreq = cpspch(ipclass) ;Note frequency in Hertz 62 | aenv linen 6000, 0.05, p3, 0.1 ;Amplitude envelope 63 | aout oscil aenv, ifreq , 1 ;Simple oscillator 64 | outs aout, aout 65 | endin 66 | 67 | 68 | 69 | 70 | 71 | f 1 0 2048 10 1 ;sine wave 72 | f 2 0 8 -2 0 2 4 7 9 ;Pitch classes for pentatonic scale 73 | 74 | ; frequency of Octave of 75 | ; note generation melody 76 | i 1 0 30 3 7 77 | i 1 5 25 6 9 78 | i 1 10 20 7.5 10 79 | i 1 15 15 1 8 80 | 81 | 82 | -------------------------------------------------------------------------------- /6.x/cmake/Modules/FindCSOUND.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the Csound library. 2 | # Once done this will define: 3 | # CSOUND_FOUND - System has the Csound library 4 | # CSOUND_INCLUDE_DIRS - The Csound include directories. 5 | # CSOUND_LIBRARIES - The libraries needed to use the Csound library. 6 | 7 | if(APPLE) 8 | find_path(CSOUND_INCLUDE_DIR csound.h 9 | HINTS 10 | "$ENV{HOME}/Library/Frameworks/CsoundLib64.framework/Headers" 11 | "$ENV{HOME}/Library/Frameworks/CsoundLib.framework/Headers" 12 | /Library/Frameworks/CsoundLib64.framework/Headers 13 | /Library/Frameworks/CsoundLib.framework/Headers 14 | ${CSOUND_INCLUDE_DIR_HINT} 15 | ) 16 | 17 | find_path(CSOUND_FRAMEWORK CsoundLib64 18 | HINTS 19 | "$ENV{HOME}/Library/Frameworks/CsoundLib64.framework" 20 | /Library/Frameworks/CsoundLib64.framework 21 | ${CSOUND_FRAMEWORK_DIR_HINT} 22 | ) 23 | 24 | find_path(CSOUND_FRAMEWORK32 CsoundLib 25 | HINTS 26 | "$ENV{HOME}/Library/Frameworks/CsoundLib64.framework" 27 | "$ENV{HOME}/Library/Frameworks/CsoundLib.framework" 28 | /Library/Frameworks/CsoundLib64.framework 29 | /Library/Frameworks/CsoundLib.framework 30 | ${CSOUND_FRAMEWORK32_DIR_HINT} 31 | ) 32 | else() 33 | find_path(CSOUND_INCLUDE_DIR csound.h 34 | PATH_SUFFIXES csound 35 | HINTS ${CSOUND_INCLUDE_DIR_HINT} 36 | ) 37 | endif() 38 | 39 | if(APPLE) 40 | find_library(CSOUND_LIBRARY 41 | NAMES CsoundLib64 42 | HINTS 43 | /Library/Frameworks/CsoundLib64.framework/ 44 | "$ENV{HOME}/Library/Frameworks/CsoundLib64.framework" 45 | ${CSOUND_LIBRARY_DIR_HINT} 46 | ) 47 | else() 48 | find_library(CSOUND_LIBRARY 49 | NAMES csound64 csound 50 | HINTS ${CSOUND_LIBRARY_DIR_HINT} 51 | ) 52 | endif() 53 | 54 | include(FindPackageHandleStandardArgs) 55 | 56 | # handle the QUIETLY and REQUIRED arguments and set CSOUND_FOUND to TRUE 57 | # if all listed variables are TRUE 58 | find_package_handle_standard_args(CSOUND 59 | CSOUND_LIBRARY CSOUND_INCLUDE_DIR 60 | ) 61 | 62 | mark_as_advanced(CSOUND_INCLUDE_DIR CSOUND_LIBRARY) 63 | 64 | set(CSOUND_INCLUDE_DIRS ${CSOUND_INCLUDE_DIR}) 65 | set(CSOUND_LIBRARIES ${CSOUND_LIBRARY}) 66 | -------------------------------------------------------------------------------- /7.x/cmake/Modules/FindCSOUND.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the Csound library. 2 | # Once done this will define: 3 | # CSOUND_FOUND - System has the Csound library 4 | # CSOUND_INCLUDE_DIRS - The Csound include directories. 5 | # CSOUND_LIBRARIES - The libraries needed to use the Csound library. 6 | 7 | if(APPLE) 8 | find_path(CSOUND_INCLUDE_DIR csound.h 9 | HINTS 10 | "$ENV{HOME}/Library/Frameworks/CsoundLib64.framework/Headers" 11 | "$ENV{HOME}/Library/Frameworks/CsoundLib.framework/Headers" 12 | /Library/Frameworks/CsoundLib64.framework/Headers 13 | /Library/Frameworks/CsoundLib.framework/Headers 14 | ${CSOUND_INCLUDE_DIR_HINT} 15 | ) 16 | 17 | find_path(CSOUND_FRAMEWORK CsoundLib64 18 | HINTS 19 | "$ENV{HOME}/Library/Frameworks/CsoundLib64.framework" 20 | /Library/Frameworks/CsoundLib64.framework 21 | ${CSOUND_FRAMEWORK_DIR_HINT} 22 | ) 23 | 24 | find_path(CSOUND_FRAMEWORK32 CsoundLib 25 | HINTS 26 | "$ENV{HOME}/Library/Frameworks/CsoundLib64.framework" 27 | "$ENV{HOME}/Library/Frameworks/CsoundLib.framework" 28 | /Library/Frameworks/CsoundLib64.framework 29 | /Library/Frameworks/CsoundLib.framework 30 | ${CSOUND_FRAMEWORK32_DIR_HINT} 31 | ) 32 | else() 33 | find_path(CSOUND_INCLUDE_DIR csound.h 34 | PATH_SUFFIXES csound 35 | HINTS ${CSOUND_INCLUDE_DIR_HINT} 36 | ) 37 | endif() 38 | 39 | if(APPLE) 40 | find_library(CSOUND_LIBRARY 41 | NAMES CsoundLib64 42 | HINTS 43 | /Library/Frameworks/CsoundLib64.framework/ 44 | "$ENV{HOME}/Library/Frameworks/CsoundLib64.framework" 45 | ${CSOUND_LIBRARY_DIR_HINT} 46 | ) 47 | else() 48 | find_library(CSOUND_LIBRARY 49 | NAMES csound64 csound 50 | HINTS ${CSOUND_LIBRARY_DIR_HINT} 51 | ) 52 | endif() 53 | 54 | include(FindPackageHandleStandardArgs) 55 | 56 | # handle the QUIETLY and REQUIRED arguments and set CSOUND_FOUND to TRUE 57 | # if all listed variables are TRUE 58 | find_package_handle_standard_args(CSOUND 59 | CSOUND_LIBRARY CSOUND_INCLUDE_DIR 60 | ) 61 | 62 | mark_as_advanced(CSOUND_INCLUDE_DIR CSOUND_LIBRARY) 63 | 64 | set(CSOUND_INCLUDE_DIRS ${CSOUND_INCLUDE_DIR}) 65 | set(CSOUND_LIBRARIES ${CSOUND_LIBRARY}) 66 | -------------------------------------------------------------------------------- /6.x/installer/macosx/release-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # set -x 3 | # directories 4 | export OPVERSION=$2 5 | export BRANCH_NAME=$1 6 | echo "Using branch: $BRANCH_NAME" 7 | export RELEASE_DIR=`date +%Y-%m-%d-%H%M%S` 8 | export BASEDIR=`pwd`/$RELEASE_DIR 9 | export INSTALLDIR=Package_Contents 10 | export DMGNAME="Csound6-Plugins-MacOS_x86_64-${OPVERSION}.dmg" 11 | 12 | # build 13 | mkdir $RELEASE_DIR 14 | cd $RELEASE_DIR 15 | export BUILD_DIR=build 16 | mkdir $BUILD_DIR 17 | git clone -b $BRANCH_NAME https://github.com/csound/plugins 18 | cd $BUILD_DIR 19 | cmake ../plugins -DCMAKE_BUILD_TYPE=Release 20 | make 21 | 22 | # zip install 23 | 24 | # image opcodes (LIB_PNG needs to be set correctly) 25 | echo "--- making image zip ---" 26 | cd .. 27 | export IMAGE_DIR=$BUILD_DIR/image 28 | export LIB_PNG=/usr/local/lib/libpng16.16.dylib 29 | cp $IMAGE_DIR/libimage.dylib . 30 | cp $LIB_PNG . 31 | install_name_tool -id libpng16.16.dylib libpng16.16.dylib 32 | install_name_tool -change /usr/local/lib/libpng16.16.dylib libpng16.16.dylib libimage.dylib 33 | mkdir image 34 | mv *.dylib image 35 | zip image.zip image/*.dylib 36 | 37 | # chua 38 | echo "--- making chua zip ---" 39 | export CHUA_DIR=$BUILD_DIR/chua 40 | mkdir chua 41 | cp $CHUA_DIR/libchua.dylib chua 42 | zip chua.zip chua/*.dylib 43 | 44 | # faustcsound 45 | echo "--- making faustcsound zip ---" 46 | export FCS_DIR=$BUILD_DIR/faustcsound 47 | mkdir faustcsound 48 | cp $FCS_DIR/libfaustcsound.dylib faustcsound 49 | zip faustcsound.zip faustcsound/*.dylib 50 | 51 | # python opcodes (python PYVERSION used needs to be set correctly) 52 | echo "--- making py zip ---" 53 | export PYVERSION=3.9 54 | export PY_ZIP_DIR="python${PYVERSION}-opcodes" 55 | export PY_DIR=$BUILD_DIR/py 56 | mkdir $PY_ZIP_DIR 57 | cp $PY_DIR/libpy.dylib $PY_ZIP_DIR/libpy${PYVERSION}.dylib 58 | zip $PY_ZIP_DIR.zip $PY_ZIP_DIR/*.dylib 59 | 60 | # installer (ALL) 61 | cd $BASEDIR 62 | mkdir -p $INSTALLDIR/tmp/csound 63 | 64 | cp chua/*.dylib $INSTALLDIR/tmp/csound/. 65 | cp faustcsound/*.dylib $INSTALLDIR/tmp/csound/. 66 | cp $PY_ZIP_DIR/*.dylib $INSTALLDIR/tmp/csound/. 67 | cp image/*.dylib $INSTALLDIR/tmp/csound/. 68 | 69 | mkdir dmgsrc 70 | pkgbuild --identifier com.csound.csound6Environment.csoundOps64 --root $INSTALLDIR --version 1 --scripts ../scripts dmgsrc/CsoundPlugins64.pkg 71 | hdiutil create $DMGNAME -srcfolder dmgsrc -fs HFS+ 72 | 73 | open $BASEDIR 74 | -------------------------------------------------------------------------------- /6.x/src/py/examples/pycallt.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni {{ 9 | def f0(a, b, c, d, e, f, g, h): 10 | print('f0 got', a, b, c, d, e, f, g, h) 11 | print('f0 returning None') 12 | 13 | def f1(a, b, c, d, e, f, g, h): 14 | print('f1 got', a, b, c, d, e, f, g, h) 15 | print('f1 returning', a) 16 | return a 17 | 18 | def f2(a, b, c, d, e, f, g, h): 19 | print('f2 got', a, b, c, d, e, f, g, h) 20 | print('f2 returning', a, b) 21 | return a, b 22 | 23 | def f3(a, b, c, d, e, f, g, h): 24 | print('f3 got', a, b, c, d, e, f, g, h) 25 | print('f3 returning', a, b, c) 26 | return a, b, c 27 | 28 | def f4(a, b, c, d, e, f, g, h): 29 | print('f4 got', a, b, c, d, e, f, g, h) 30 | print('f4 returning', a, b, c, d) 31 | return a, b, c, d 32 | 33 | def f5(a, b, c, d, e, f, g, h): 34 | print('f5 got', a, b, c, d, e, f, g, h) 35 | print('f5 returning', a, b, c, d, e) 36 | return a, b, c, d, e 37 | 38 | def f6(a, b, c, d, e, f, g, h): 39 | print('f6 got', a, b, c, d, e, f, g, h) 40 | print('f6 returning', a, b, c, d, e, f) 41 | return a, b, c, d, e, f 42 | 43 | def f7(a, b, c, d, e, f, g, h): 44 | print('f7 got', a, b, c, d, e, f, g, h) 45 | print('f7 returning', a, b, c, d, e, f, g) 46 | return a, b, c, d, e, f, g 47 | 48 | def f8(a, b, c, d, e, f, g, h): 49 | print('f8 got', a, b, c, d, e, f, g, h) 50 | print('f8 returning', a, b, c, d, e, f, g, h) 51 | return a, b, c, d, e, f, g, h 52 | }} 53 | 54 | instr 1 55 | 56 | kt metro 1.5 57 | 58 | pycallt kt, "f0", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 59 | k1 pycall1t kt, "f1", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 60 | k1, k2 pycall2t kt, "f2", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 61 | k1, k2, k3 pycall3t kt, "f3", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 62 | k1, k2, k3, k4 pycall4t kt, "f4", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 63 | k1, k2, k3, k4, k5 pycall5t kt, "f5", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 64 | k1, k2, k3, k4, k5, k6 pycall6t kt, "f6", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 65 | k1, k2, k3, k4, k5, k6, k7 pycall7t kt, "f7", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 66 | k1, k2, k3, k4, k5, k6, k7, k8 pycall8t kt, "f8", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 67 | endin 68 | -------------------------------------------------------------------------------- /7.x/src/py/examples/pycallt.orc: -------------------------------------------------------------------------------- 1 | sr=44100 2 | kr=4410 3 | ksmps=10 4 | nchnls=1 5 | 6 | pyinit 7 | 8 | pyruni {{ 9 | def f0(a, b, c, d, e, f, g, h): 10 | print('f0 got', a, b, c, d, e, f, g, h) 11 | print('f0 returning None') 12 | 13 | def f1(a, b, c, d, e, f, g, h): 14 | print('f1 got', a, b, c, d, e, f, g, h) 15 | print('f1 returning', a) 16 | return a 17 | 18 | def f2(a, b, c, d, e, f, g, h): 19 | print('f2 got', a, b, c, d, e, f, g, h) 20 | print('f2 returning', a, b) 21 | return a, b 22 | 23 | def f3(a, b, c, d, e, f, g, h): 24 | print('f3 got', a, b, c, d, e, f, g, h) 25 | print('f3 returning', a, b, c) 26 | return a, b, c 27 | 28 | def f4(a, b, c, d, e, f, g, h): 29 | print('f4 got', a, b, c, d, e, f, g, h) 30 | print('f4 returning', a, b, c, d) 31 | return a, b, c, d 32 | 33 | def f5(a, b, c, d, e, f, g, h): 34 | print('f5 got', a, b, c, d, e, f, g, h) 35 | print('f5 returning', a, b, c, d, e) 36 | return a, b, c, d, e 37 | 38 | def f6(a, b, c, d, e, f, g, h): 39 | print('f6 got', a, b, c, d, e, f, g, h) 40 | print('f6 returning', a, b, c, d, e, f) 41 | return a, b, c, d, e, f 42 | 43 | def f7(a, b, c, d, e, f, g, h): 44 | print('f7 got', a, b, c, d, e, f, g, h) 45 | print('f7 returning', a, b, c, d, e, f, g) 46 | return a, b, c, d, e, f, g 47 | 48 | def f8(a, b, c, d, e, f, g, h): 49 | print('f8 got', a, b, c, d, e, f, g, h) 50 | print('f8 returning', a, b, c, d, e, f, g, h) 51 | return a, b, c, d, e, f, g, h 52 | }} 53 | 54 | instr 1 55 | 56 | kt metro 1.5 57 | 58 | pycallt kt, "f0", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 59 | k1 pycall1t kt, "f1", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 60 | k1, k2 pycall2t kt, "f2", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 61 | k1, k2, k3 pycall3t kt, "f3", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 62 | k1, k2, k3, k4 pycall4t kt, "f4", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 63 | k1, k2, k3, k4, k5 pycall5t kt, "f5", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 64 | k1, k2, k3, k4, k5, k6 pycall6t kt, "f6", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 65 | k1, k2, k3, k4, k5, k6, k7 pycall7t kt, "f7", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 66 | k1, k2, k3, k4, k5, k6, k7, k8 pycall8t kt, "f8", 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 67 | endin 68 | -------------------------------------------------------------------------------- /6.x/src/p5glove/libp5glove/usb_hid.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2004 Ross Bencina 3 | Copyright (c) 2004 Jason McMullan 4 | 5 | USB/HID I/O routines 6 | */ 7 | /* 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published by 10 | * the Free Software Foundation; either version 2.1 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | */ 22 | #ifndef USB_HID_H 23 | #define USB_HID_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | typedef struct USBHID_struct *USBHID; 30 | 31 | #define INVALID_USBHID_VALUE (0) 32 | 33 | 34 | #define SELECT_VENDOR_ID_FLAG (0x01) 35 | #define SELECT_PRODUCT_ID_FLAG (0x02) 36 | #define SELECT_VERSION_NUMBER_FLAG (0x04) 37 | 38 | 39 | /* 40 | Open the indexth USBHID device which match the delection criteria. The 41 | selection criteria may be any combination of vendor id, product id and 42 | version number as specified by the flags parameter. 43 | 44 | Returns an open handle on success, or INVALID_USBHIDHANDLE if an error 45 | occurred. 46 | */ 47 | USBHID OpenUSBHID( int index, int vendorId, int productId, int versionNumber, int flags ); 48 | 49 | 50 | /* 51 | Close a USB HID handle previously opened with OpenUSBHID() 52 | */ 53 | void CloseUSBHID( USBHID handle ); 54 | 55 | 56 | /* 57 | Read count bytes from the USB HID into dest. Returns the number of bytes 58 | read. This routine reads from the Kernel HID ring buffer, if it is no called 59 | frequently enough the data returned may lag behind the latest HID reports 60 | from the device. 61 | 62 | HidD_GetInputReport will read the most recent report, but is only 63 | implemented on Windows XP. 64 | */ 65 | int ReadUSBHID( USBHID handle, void *dest, int count ); 66 | 67 | 68 | int SetUSBHIDFeature( USBHID handle, char *report, int count ); 69 | 70 | int GetUSBHIDFeature( USBHID handle, char *report, int count ); 71 | 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif /* USB_HID_H */ 78 | -------------------------------------------------------------------------------- /6.x/src/CUDA/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_CUDA_OPCODES "Build the CUDA GPU opcodes" OFF) 2 | 3 | function(make_cuda_plugin libname srcs) 4 | SET(LIB_TYPE_DYNAMIC) #set the lib type 5 | CUDA_ADD_LIBRARY(${libname} ${LIB_TYPE} ${srcs}) 6 | 7 | set(i 2) 8 | while( ${i} LESS ${ARGC} ) 9 | target_link_libraries(${libname} ${ARGV${i}}) 10 | math(EXPR i "${i}+1") 11 | endwhile() 12 | 13 | target_include_directories(${libname} PRIVATE ${CSOUND_INCLUDE_DIRS}) 14 | 15 | # set_target_properties(${libname} PROPERTIES 16 | # RUNTIME_OUTPUT_DIRECTORY ${BUILD_PLUGINS_DIR} 17 | # LIBRARY_OUTPUT_DIRECTORY ${BUILD_PLUGINS_DIR} 18 | # ARCHIVE_OUTPUT_DIRECTORY ${BUILD_PLUGINS_DIR}) 19 | 20 | install(TARGETS ${libname} LIBRARY DESTINATION "${PLUGIN_INSTALL_DIR}" ) 21 | endfunction() 22 | 23 | if(BUILD_CUDA_OPCODES) 24 | find_package(CUDA REQUIRED) 25 | check_deps(BUILD_CUDA_OPCODES CUDA_FOUND) 26 | message(STATUS "Building the CUDA opcodes") 27 | 28 | include_directories(${CMAKE_HOME_DIRECTORY}/include) 29 | include_directories(/usr/local/include) 30 | LIST(APPEND CUDA_NVCC_FLAGS "-use_fast_math") 31 | 32 | if(APPLE) 33 | if(CMAKE_OSX_DEPLOYMENT_TARGET MATCHES 10.6) 34 | LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_11") 35 | make_cuda_plugin(cudaop1 adsyn11.cu) 36 | make_cuda_plugin(cudaop2 pvsopsf.cu) 37 | make_cuda_plugin(cudaop3 slidingm.cu) 38 | make_cuda_plugin(cudaop4 convf.cu) 39 | make_cuda_plugin(cudaop5 pconv11.cu) 40 | else() 41 | LIST(APPEND CUDA_NVCC_FLAGS "-ccbin /usr/bin/clang -arch=sm_30 -Xcompiler -stdlib=libstdc++") 42 | make_cuda_plugin(cudaop1 adsyn.cu) 43 | make_cuda_plugin(cudaop2 pvsops.cu) 44 | make_cuda_plugin(cudaop3 slidingm.cu) 45 | make_cuda_plugin(cudaop4 conv.cu) 46 | make_cuda_plugin(cudaop5 pconv.cu) 47 | endif() 48 | else() 49 | if(CUDA_VERSION VERSION_LESS 9.0) 50 | LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_20") 51 | else() 52 | LIST(APPEND CUDA_NVCC_FLAGS "-arch=sm_75") 53 | endif() 54 | 55 | make_cuda_plugin(cudaop1 adsyn.cu) 56 | make_cuda_plugin(cudaop2 pvsops.cu) 57 | # make_cuda_plugin(cudaop3 slidingm.cu) 58 | make_cuda_plugin(cudaop4 conv.cu) 59 | make_cuda_plugin(cudaop5 pconv.cu) 60 | endif() 61 | 62 | CUDA_ADD_CUFFT_TO_TARGET(cudaop2) 63 | CUDA_ADD_CUFFT_TO_TARGET(cudaop5) 64 | 65 | SET(CUDA_VERBOSE_BUILD ON CACHE BOOL "nvcc verbose" FORCE) 66 | else() 67 | message(STATUS "Not building the CUDA opcodes") 68 | endif() 69 | -------------------------------------------------------------------------------- /6.x/src/jackops/jacko_test.csd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TEST JACKO OPCODES 5 | Michael Gogins 6 | 7 | This csd tests the Jacko opcodes. 8 | 9 | There is a segmentation fault at the end of the performance. This does happen 10 | in the Jacko plugin, but it does not affect the performance. 11 | 12 | Csound not only writes a soundfile using -o, but also sends realtime audio and 13 | MIDI to other Jack clients using Jack connections. 14 | 15 | Before running this piece, in a terminal execute: 16 | 17 | zynaddsubfx --input JACK --output JACK --auto-connect --sample-rate 48000 --buffer-size 128 18 | 19 | 20 | 21 | 22 | 23 | 24 | ; Sampling rate must be the same as Jack's. 25 | sr=48000 26 | ; ksmps must be the same as Jack's frames/period. 27 | ksmps=128 28 | nchnls=2 29 | 0dbfs=40000 30 | 31 | ga_audio_out init 0 32 | 33 | ; Initialize the Jack connections. 34 | JackoInit "default", "csound6" 35 | prints "Initial ports and connections:\n" 36 | JackoInfo 37 | JackoAudioInConnect "system:capture_1", "audio_in_left" 38 | JackoAudioInConnect "system:capture_2", "audio_in_right" 39 | JackoAudioOutConnect "audio_out_left", "system:playback_1" 40 | JackoAudioOutConnect "audio_out_right", "system:playback_2" 41 | JackoMidiInConnect "system:midi_capture_1", "midiin" 42 | JackoMidiOutConnect "midiout", "zynaddsubfx:midi_input" 43 | prints "Final ports and connections:\n" 44 | JackoInfo 45 | 46 | instr 1 47 | print p1, p2, p3, p4, p5 48 | i_frequency = cpsmidinn(p4) 49 | i_amplitude = ampdb(p5) 50 | print i_frequency, i_amplitude 51 | a_out oscil i_amplitude, i_frequency 52 | ga_audio_out += a_out; 53 | endin 54 | 55 | ; Sends notes to an external MIDI synthesizer. 56 | instr 801 57 | print p1, p2, p3, p4, p5 58 | JackoNoteOut "midiout", 0, p4, p5 59 | prints "Sent note to midiout.\n" 60 | endin 61 | 62 | instr 900 63 | print p1, p2, p3 64 | outs ga_audio_out, ga_audio_out 65 | ; Input test is only to see if connection is created. 66 | audio_in_left_ init 0 67 | audio_in_right_ init 0 68 | audio_in_left_ JackoAudioIn "audio_in_left" 69 | audio_in_right_ JackoAudioIn "audio_in_right" 70 | JackoAudioOut "audio_out_left", ga_audio_out 71 | JackoAudioOut "audio_out_right", ga_audio_out 72 | ga_audio_out = 0 73 | endin 74 | 75 | instr 1000 76 | print p1, p2, p3 77 | ; Uncomment the following two lines to test if Jacko hangs Csound. 78 | event "e", 0, 0, 0.1 79 | prints "Ending Csound performance with 'e' event\n" 80 | endin 81 | 82 | 83 | 84 | f 0 60 85 | i1 5 3 63 10 86 | i801 10 3 69 100 87 | i1 15 3 72 10 88 | i900 0 -1 89 | i1000 20 1 90 | e 91 | 92 | 93 | -------------------------------------------------------------------------------- /7.x/README.md: -------------------------------------------------------------------------------- 1 | Plugins for Csound 7.x 2 | ======= 3 | 4 | Currently, the plugins available in this tree are 5 | 6 | - py (requires a Python 3.x installation with dev libs) 7 | **Many opcodes to call Python code** 8 | 9 | 10 | Install location 11 | -------------- 12 | The CMake scripts in this repository use the default CS_USER_PLUGIN 13 | location on MacOS and Windows as defined in the Csound build, or a 14 | library instalation directory (customisable) on LINUX. These are: 15 | 16 | - LINUX: depends on both `CMAKE_INSTALL_PREFIX` and `USE_LIB64`. It is then installed in: 17 | * if `USE_LIB64=1` then to 18 | * for doubles: `${CSOUND_INSTALL_PREFIX}/lib64/csound/plugins64-${APIVERSION}` 19 | * for floats: `${CSOUND_INSTALL_PREFIX}/lib64/csound/plugins-${APIVERSION}` (floats)` 20 | * if `USE_LIB64=0` then to 21 | * for doubles: `${CSOUND_INSTALL_PREFIX}/lib/csound/plugins64-${APIVERSION}` 22 | * for floats: `${CSOUND_INSTALL_PREFIX}/lib/csound/plugins-${APIVERSION}` 23 | 24 | - MACOS: 25 | * For doubles: `$HOME/Library/csound/${APIVERSION}/plugins64` 26 | * For floats: `$HOME/Library/csound/${APIVERSION}/plugins` 27 | - Windows: 28 | * For doubles: `%LOCALAPPDATA%\csound\${APIVERSION}\plugins64` 29 | * For floats: `%LOCALAPPDATA%\csound\${APIVERSION}\plugins` 30 | 31 | 32 | Build Instructions for Linux and MacOS 33 | --- 34 | 35 | The build requires Csound to be installed, as well as CMake. With this 36 | in place, you can do : 37 | 38 | ``` 39 | $ git clone https://github.com/csound/plugins.git 40 | $ cd plugins 41 | $ mkdir build 42 | $ cd build 43 | $ cmake ../ 44 | $ make 45 | ``` 46 | 47 | By default, all the plugins are built. If one wants to exclude a 48 | plugin from the build process, one can pass an option to the cmake command. 49 | For example, to exclude the XXX plugin, the `cmake` command would be: 50 | 51 | ``` 52 | $ cmake -DXXX_OPCODES=OFF ../ 53 | ``` 54 | 55 | 56 | To install the opcodes you have built 57 | 58 | ``` 59 | $ make install 60 | ``` 61 | 62 | Depending on your permissions, you might need to prepend `sudo` to 63 | these commands. After the first build the plugins can be updated with 64 | 65 | ``` 66 | $ git pull 67 | $ make 68 | $ make install 69 | ``` 70 | 71 | using `sudo` in the last step if raised permissions are needed. On 72 | Linux, the installation location can be set with the relevant CMake 73 | variables as indicated above. 74 | 75 | Csound Location 76 | ------------ 77 | CMake will normally find the installed Csound headers (and library) 78 | automatically. However, if your Csound headers and library are not 79 | placed in the usual locations, you can use the following CMake option variables 80 | to tell CMake where they are: 81 | 82 | ``` 83 | CSOUND_INCLUDE_DIR_HINT 84 | ``` 85 | and 86 | 87 | ``` 88 | CSOUND_LIBRARY_DIR_HINT 89 | -------------------------------------------------------------------------------- /6.x/src/fluidOpcodes/fluidOpcodes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | fluidOpcodes 4 | 5 | 6 | 7 |

fluidOpcodes

8 |
fluidEngine - creates a fluid engine
9 | fluidLoad - loads a soundfont into a fluid engine
10 | fluidProgramSelect - assign a bank and preset of a soundFont to a midi channel 11 | as well as select
12 | fluidCC - send midi controller data to fluid
13 | fluidPlay - plays a note on a channel
14 | fluidOut - outputs sound from a fluid engine
15 |
16 |

Description

17 |

This family of opcodes are meant to be used together to load and play SoundFonts 18 | using Peter Hannape's Fluidsynth. Use global engines, soundFonts, and outputs.
19 |
20 | Based on work by Michael Gogins.

21 | 22 |
23 |
24 |

Syntax

25 |

iEngineNumber fluidEngine
26 |
27 | iInstrumentNumber fluidLoad sfilename, iEngineNumber
28 |
29 | fluidProgramSelect iEngineNumber, iChannelNumber, iInstrumentNumber, 30 | iBankNumber, iPresetNumber
31 |
32 | fluidCC iEngineNumber, iChannelNumber, iControllerNumber, 33 | kValue
34 |
35 | fluidNote iEngineNumber, iInstrumentNumber, iMidiKeyNumber, 36 | iVelocity
37 |
38 | aLeft, aRight fluidOut iEngineNum

39 |

 

40 |
41 |

Initialization

42 |

iEngineNumber - engine number assigned from fluid_engine
43 |
44 | iInstrumentNumber - instrument number assigned from fluid_load
45 |
46 | sfilename - String specifying a SoundFont filename
47 |
48 | aLeft - left channel audio output.

49 |

aRight - right channel audio output.
50 |
51 | iMidiKeyNumber - midi key number to play (0-127)
52 |
53 | iVelocity - midi velocity to play at (0-127)
54 |
55 | iBankNum - bank number on soundfont to play
56 |
57 | iPresetNum - preset number on soundfont to play
58 |
59 | iprogram - Number of the fluidsynth program to be assigned to a MIDI channel.

60 |
61 |

Performance

62 |

In this implementation, SoundFont effects such as chorus or reverb are used 63 | if and only if they are defaults for the preset. There is no means of turning 64 | such effects on or off, or of changing their parameters, from Csound.

65 | 66 |

 

67 |
68 |

Examples

69 |
70 |

 

71 |
72 |
73 |
74 |

Credits

75 |

Opcode library created by Steven Yi, based on fluid opcode 76 | plugin by Michael Gogins.

77 |

 

78 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /6.x/src/jackops/jackTransport.c: -------------------------------------------------------------------------------- 1 | /** 2 | * jack_transport.c 3 | * 4 | * Copyright (c) 2008 by Cesare Marilungo. All rights reserved. 5 | * 6 | * L I C E N S E 7 | * 8 | * This software is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2.1 of the License, or (at your option) any later version. 12 | * 13 | * This software is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this software; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | * U S A G E 23 | * 24 | * jack_transport 1 - to start jack transport 25 | * 26 | * jack_transport 0 - to stop 27 | * 28 | * the second optional parameter tells where the transport should be located 29 | * 30 | */ 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | #include "cs_jack.h" 37 | 38 | enum { STOP, START }; 39 | 40 | typedef struct 41 | { 42 | OPDS h; 43 | MYFLT *command; 44 | MYFLT *location; 45 | } JACKTRANSPORT; 46 | 47 | static int32_t jack_transport (CSOUND *csound, JACKTRANSPORT * p) 48 | { 49 | RtJackGlobals *rtjack; 50 | jack_client_t *client; 51 | 52 | rtjack = (RtJackGlobals*) 53 | csound->QueryGlobalVariableNoCheck(csound, 54 | "_rtjackGlobals"); 55 | client = rtjack->client; 56 | 57 | if (UNLIKELY(client == NULL)) { 58 | return csound->InitError(csound, "%s", Str("Cannot find Jack client.\n")); 59 | } 60 | else { 61 | //move to specified location (in seconds) 62 | if ((int32_t)(*p->location)>=0) { 63 | MYFLT loc_sec = *p->location; 64 | MYFLT loc_sec_per_sr = loc_sec*csound->GetSr(csound); 65 | jack_transport_locate(client, loc_sec_per_sr); 66 | csound->Warning(csound, 67 | Str("jacktransport: playback head moved " 68 | "at %f seconds\n"), loc_sec); 69 | } 70 | //start or stop 71 | switch ((int32_t 72 | )(*p->command)) { 73 | case START: 74 | csound->Warning(csound, "%s", Str("jacktransport: playing.\n")); 75 | jack_transport_start(client); 76 | break; 77 | case STOP: 78 | csound->Warning(csound, "%s", Str("jacktransport: stopped.\n")); 79 | jack_transport_stop(client); 80 | break; 81 | default: 82 | csound->Warning(csound, "%s", Str("jacktransport: invalid parameter.\n")); 83 | break; 84 | } 85 | } 86 | 87 | return OK; 88 | } 89 | 90 | #define S(x) sizeof(x) 91 | 92 | static OENTRY jackTransport_localops[] = { 93 | 94 | { "jacktransport", S(JACKTRANSPORT), 0, 1, "", "ij", 95 | (SUBR)jack_transport, NULL, NULL }, 96 | }; 97 | 98 | LINKAGE_BUILTIN(jackTransport_localops) 99 | -------------------------------------------------------------------------------- /6.x/src/fluidOpcodes/fluidOpcodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FLUID SYNTH OPCODES 3 | * 4 | * Adapts Fluidsynth to use global engines, soundFonts, and outputs 5 | * 6 | * Based on work by Michael Gogins. License is identical to 7 | * SOUNDFONTS VST License (listed below) 8 | * 9 | * Copyright (c) 2003 by Steven Yi. All rights reserved. 10 | * 11 | * [ORIGINAL INFORMATION BELOW] 12 | * 13 | * S O U N D F O N T S V S T 14 | * 15 | * Adapts Fluidsynth to be both a VST plugin instrument 16 | * and a Csound plugin opcode. 17 | * Copyright (c) 2001-2003 by Michael Gogins. All rights reserved. 18 | * 19 | * L I C E N S E 20 | * 21 | * This software is free software; you can redistribute it and/or 22 | * modify it under the terms of the GNU Lesser General Public 23 | * License as published by the Free Software Foundation; either 24 | * version 2.1 of the License, or (at your option) any later version. 25 | * 26 | * This software is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 29 | * Lesser General Public License for more details. 30 | * 31 | * You should have received a copy of the GNU Lesser General Public 32 | * License along with this software; if not, write to the Free Software 33 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 34 | */ 35 | 36 | #ifndef FLUIDOPCODE_H 37 | #define FLUIDOPCODE_H 38 | 39 | #include "csdl.h" 40 | #include 41 | 42 | typedef struct { 43 | OPDS h; 44 | /* OUTPUTS */ 45 | MYFLT *iEngineNum; 46 | MYFLT *iReverbEnabled; 47 | MYFLT *iChorusEnabled; 48 | MYFLT *iNumChannels; 49 | MYFLT *iPolyphony; 50 | } FLUIDENGINE; 51 | 52 | typedef struct { 53 | OPDS h; 54 | /* INPUTS */ 55 | MYFLT *iEngineNumber, *iChannelNumber, *iInterpMethod; 56 | } FLUID_SET_INTERP_METHOD; 57 | 58 | typedef struct { 59 | OPDS h; 60 | /* OUTPUTS */ 61 | MYFLT *iInstrumentNumber; 62 | /* INPUTS */ 63 | MYFLT *filename, *iEngineNum, *iListPresets; 64 | } FLUIDLOAD; 65 | 66 | typedef struct { 67 | OPDS h; 68 | /* INPUTS */ 69 | MYFLT *iEngineNumber, *iChannelNumber, *iInstrumentNumber, *iBankNumber; 70 | MYFLT *iPresetNumber; 71 | } FLUID_PROGRAM_SELECT; 72 | 73 | typedef struct { 74 | OPDS h; 75 | /* INPUTS */ 76 | MYFLT *iEngineNumber, *iChannelNumber, *iControllerNumber, *kVal; 77 | int32_t priorMidiValue; 78 | fluid_synth_t *fluidEngine; 79 | } FLUID_CC; 80 | 81 | typedef struct { 82 | OPDS h; 83 | /* INPUTS */ 84 | MYFLT *iEngineNumber, *iChannelNumber, *iMidiKeyNumber, *iVelocity; 85 | int32_t initDone, iChn, iKey; 86 | fluid_synth_t *fluidEngine; 87 | } FLUID_NOTE; 88 | 89 | typedef struct { 90 | OPDS h; 91 | MYFLT *aLeftOut, *aRightOut; 92 | MYFLT *iEngineNum; 93 | fluid_synth_t *fluidEngine; 94 | } FLUIDOUT; 95 | 96 | typedef struct { 97 | OPDS h; 98 | MYFLT *aLeftOut, *aRightOut; 99 | void *fluidGlobals; 100 | } FLUIDALLOUT; 101 | 102 | typedef struct { 103 | OPDS h; 104 | /* Inputs. */ 105 | MYFLT *iFluidEngine; 106 | MYFLT *kMidiStatus; 107 | MYFLT *kMidiChannel; 108 | MYFLT *kMidiData1; 109 | MYFLT *kMidiData2; 110 | /* No outputs. */ 111 | /* Internal state. */ 112 | int32_t priorMidiStatus; 113 | int32_t priorMidiChannel; 114 | int32_t priorMidiData1; 115 | int32_t priorMidiData2; 116 | fluid_synth_t *fluidEngine; 117 | } FLUIDCONTROL; 118 | 119 | #endif 120 | 121 | -------------------------------------------------------------------------------- /.github/workflows/plugins_build.yml: -------------------------------------------------------------------------------- 1 | name: Csound plugins build 2 | 3 | env: 4 | VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite" 5 | 6 | on: 7 | push: 8 | branches: 9 | - develop 10 | - master 11 | pull_request: 12 | branches: 13 | - develop 14 | 15 | jobs: 16 | build_package: 17 | runs-on: ${{ matrix.os }} 18 | 19 | env: 20 | CSOUND_VERSION: 6.17.2 21 | 22 | strategy: 23 | matrix: 24 | os: [windows-latest] 25 | version: ["6.17.0"] 26 | include: 27 | - os: "windows-latest" 28 | mono: "" 29 | # - os: "ubuntu-latest" 30 | # mono: "mono" 31 | # - os: "macos-latest" 32 | # mono: "mono" 33 | 34 | steps: 35 | - name: Checkout Source Code 36 | uses: actions/checkout@v1 37 | with: 38 | fetch-depth: 1 39 | submodules: true 40 | 41 | - name: Setup platform (windows) 42 | if: startsWith(matrix.os, 'windows') 43 | env: 44 | FAUST_URL: https://github.com/grame-cncm/faust/releases/download/2.60.3/Faust-2.60.3-win64.exe 45 | run: | 46 | Invoke-WebRequest $env:FAUST_URL -OutFile faustInstaller.exe 47 | ./faustInstaller.exe /S 48 | echo "C:/Program Files/csound/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 49 | echo "OPCODE6DIR64=C:/Program Files/csound/plugins64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 50 | echo "PYTHONPATH=C:/Program Files/csound/bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 51 | echo "RAWWAVE_PATH=C:/Program Files/csound/samples" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append 52 | .\6.x\vcpkg\bootstrap-vcpkg.bat 53 | choco install csound --version=6.17.0 54 | echo $GITHUB_ENV 55 | ls 'C:\Program Files\Faust\' 56 | echo "C:\Program Files\Faust\;C:\Program Files\Faust\lib" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 57 | 58 | # - name: Setup platform (linux) 59 | # if: startsWith(matrix.os, 'ubuntu') 60 | # run: | 61 | # ./vcpkg/bootstrap-vcpkg.sh 62 | # sudo apt-get update 63 | # sudo apt-get install libcsound64-dev 64 | 65 | # - name: Setup platform (macos) 66 | # if: startsWith(matrix.os, 'macos') 67 | # run: | 68 | # ./vcpkg/bootstrap-vcpkg.sh 69 | # brew install csound 70 | 71 | - name: Setup VCPKG cache 72 | shell: bash 73 | run: | 74 | ${{ matrix.mono }} `./6.x/vcpkg/vcpkg fetch nuget | tail -n 1` \ 75 | sources add \ 76 | -source "https://nuget.pkg.github.com/csound/index.json" \ 77 | -storepasswordincleartext \ 78 | -name "GitHub" \ 79 | -username "csound" \ 80 | -password "${{ secrets.GITHUB_TOKEN }}" 81 | ${{ matrix.mono }} `./6.x/vcpkg/vcpkg fetch nuget | tail -n 1` \ 82 | setapikey "${{ secrets.GITHUB_TOKEN }}" \ 83 | -source "https://nuget.pkg.github.com/csound/index.json" 84 | 85 | - name: Generate CMake build 86 | run: cmake 6.x/. -B build -DUSE_VCPKG=1 87 | 88 | - name: Build plugins 89 | run: cmake --build build --config Release 90 | 91 | - name: Build installer 92 | run: iscc /o. .\installer\win64\Installer.iss 93 | 94 | - name: Upload installer 95 | uses: actions/upload-artifact@v2 96 | with: 97 | name: Csound_win_x64-${{env.CSOUND_VERSION}}.${{github.run_number}}-plugins-installer 98 | path: ./csound6-plugins-win_x86_64-*.exe 99 | if-no-files-found: error 100 | -------------------------------------------------------------------------------- /6.x/src/stk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | option(BUILD_STK_OPCODES "Build the stk opcodes" ON) 2 | 3 | if(BUILD_STK_OPCODES) 4 | if(DEFAULT_STK_RAWWAVE_PATH) 5 | set(rawwave_path "-DDEFAULT_RAWWAVE_PATH=\"${DEFAULT_STK_RAWWAVE_PATH}\"") 6 | endif() 7 | 8 | if(USE_VCPKG) 9 | make_plugin(stkops stkOpcodes.cpp) 10 | find_package(unofficial-libstk CONFIG REQUIRED) 11 | target_link_libraries(stkops PRIVATE unofficial::libstk::libstk) 12 | target_include_directories(stkops PRIVATE ${CSOUND_INCLUDE_DIRS}) 13 | message(STATUS "Building STK opcodes for MSVC") 14 | else() 15 | find_package(STK) 16 | 17 | if(STK_LIBRARY) 18 | find_path(STK_INCLUDE_DIR Stk.h 19 | /usr/include/stk 20 | /usr/local/include/stk) 21 | 22 | check_deps(BUILD_STK_OPCODES STK_INCLUDE_DIR) 23 | 24 | if(STK_INCLUDE_DIR) 25 | make_plugin(stkops stkOpcodes.cpp) 26 | target_include_directories(stkops PRIVATE ${CSOUND_INCLUDE_DIRS} ${STK_INCLUDE_DIR}) 27 | message(STATUS "Building STK opcodes.") 28 | 29 | if(BUILD_STATIC_LIBRARY) 30 | if(WIN32) 31 | add_library(stk STATIC IMPORTED) 32 | set_target_properties(stk PROPERTIES IMPORTED_LOCATION ${STK_LIBRARY}) 33 | target_link_libraries(stkops stk) 34 | else() 35 | target_link_libraries(stkops ${STK_LIBRARY}) 36 | endif() 37 | else() 38 | target_link_libraries(stkops ${STK_LIBRARIES} ${PTHREAD_LIBRARY}) 39 | endif() 40 | 41 | target_compile_definitions(stkops PRIVATE ${rawwave_path}) 42 | endif() 43 | else() 44 | set(stk_remove_srcs 45 | src/InetWvIn.cpp src/InetWvOut.cpp 46 | src/Mutex.cpp src/RtAudio.cpp 47 | src/RtMidi.cpp src/Messager.cpp 48 | src/RtWvIn.cpp src/RtWvOut.cpp 49 | src/Socket.cpp src/TcpClient.cpp 50 | src/TcpServer.cpp src/Thread.cpp 51 | src/UdpSocket.cpp 52 | ) 53 | 54 | file(GLOB stk_srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*) 55 | list(REMOVE_ITEM stk_srcs ${stk_remove_srcs}) 56 | list(APPEND stk_srcs stkOpcodes.cpp) 57 | 58 | # Assume that if this file exists, then we have the sources 59 | find_file(STK_FOUND 60 | NAMES src/InetWvIn.cpp 61 | HINTS ${CMAKE_CURRENT_SOURCE_DIR} 62 | ) 63 | 64 | find_path(STK_INCLUDE_DIR Stk.h ./include) 65 | check_deps(BUILD_STK_OPCODES STK_FOUND STK_INCLUDE_DIR) 66 | 67 | make_plugin(stkops "${stk_srcs}") 68 | target_include_directories(stkops PRIVATE 69 | ${CSOUND_INCLUDE_DIRS} 70 | ${CMAKE_CURRENT_SOURCE_DIR}/include 71 | ${CMAKE_CURRENT_SOURCE_DIR}/include/stk 72 | ${CMAKE_CURRENT_SOURCE_DIR}/src 73 | ) 74 | set(stkdefs "-D__STK_REALTIME__") 75 | 76 | if(APPLE) 77 | list(APPEND stkdefs "-D__OS_MACOSX__") 78 | list(REMOVE_ITEM stkdefs "-D__STK_REALTIME__") 79 | elseif(LINUX) 80 | list(APPEND stkdefs "-D__OS_LINUX__") 81 | list(APPEND stkdefs "-D__LINUX_ALSA__") 82 | elseif(WIN32) 83 | list(APPEND stkdefs "-D__OS_WINDOWS__") 84 | endif() 85 | 86 | if(BIG_ENDIAN) 87 | list(APPEND stkdefs "-D__BIG_ENDIAN__") 88 | else() 89 | list(APPEND stkdefs "-D__LITTLE_ENDIAN__") 90 | endif() 91 | 92 | target_compile_definitions(stkops PRIVATE ${stkdefs} ${rawwave_path}) 93 | endif() 94 | endif() 95 | endif() 96 | 97 | -------------------------------------------------------------------------------- /6.x/src/jackops/cs_jack.h: -------------------------------------------------------------------------------- 1 | /* 2 | .h: 3 | 4 | Copyright (C) 2008 by Cesare Marilungo 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #define MAX_NAME_LEN 32 /* for client and port name */ 25 | 26 | typedef struct RtJackBuffer_ { 27 | #ifdef LINUX 28 | pthread_mutex_t csndLock; /* signaled by process callback */ 29 | pthread_mutex_t jackLock; /* signaled by audio thread */ 30 | #else 31 | void *csndLock; /* signaled by process callback */ 32 | void *jackLock; /* signaled by audio thread */ 33 | #endif 34 | jack_default_audio_sample_t **inBufs; /* 'nChannels' capture buffers */ 35 | jack_default_audio_sample_t **outBufs; /* 'nChannels' playback buffers */ 36 | } RtJackBuffer; 37 | 38 | typedef struct RtJackGlobals_ { 39 | CSOUND *csound; /* Csound instance pointer */ 40 | int jackState; /* 0: OK, 1: sr changed, 2: quit */ 41 | char clientName[MAX_NAME_LEN + 1]; /* client name */ 42 | char inputPortName[MAX_NAME_LEN + 1]; /* input port name prefix */ 43 | char outputPortName[MAX_NAME_LEN + 1]; /* output port name prefix */ 44 | int sleepTime; /* sleep time in us (deprecated) */ 45 | char *inDevName; /* device name for -i adc */ 46 | char *outDevName; /* device name for -o dac */ 47 | int sampleRate; /* sample rate in Hz */ 48 | int nChannels; /* number of channels */ 49 | int nChannels_i; /* number of in channels */ 50 | int bufSize; /* buffer size in sample frames */ 51 | int nBuffers; /* number of buffers (>= 2) */ 52 | int inputEnabled; /* non-zero if capture (adc) is on */ 53 | int outputEnabled; /* non-zero if playback (dac) is on */ 54 | int csndBufCnt; /* current buffer in Csound thread */ 55 | int csndBufPos; /* buffer position in Csound thread */ 56 | int jackBufCnt; /* current buffer in JACK callback */ 57 | int jackBufPos; /* buffer position in JACK callback */ 58 | jack_client_t *client; /* JACK client pointer */ 59 | jack_port_t **inPorts; /* 'nChannels' ports for capture */ 60 | jack_default_audio_sample_t **inPortBufs; 61 | jack_port_t **outPorts; /* 'nChannels' ports for playback */ 62 | jack_default_audio_sample_t **outPortBufs; 63 | RtJackBuffer **bufs; /* 'nBuffers' I/O buffers */ 64 | int xrunFlag; /* non-zero if an xrun has occured */ 65 | jack_client_t *listclient; 66 | int outDevNum, inDevNum; /* select devs by number */ 67 | } RtJackGlobals; 68 | -------------------------------------------------------------------------------- /6.x/README.md: -------------------------------------------------------------------------------- 1 | Plugins for Csound 6.x 2 | ======= 3 | 4 | Currently, the plugins available in this tree are 5 | 6 | - AbletonLive Link (requires Ableton link) 7 | **link_create link_enable link_is_enabled link_tempo_set link_tempo_get link_beat_get link_metro link_beat_request link_beat_force** 8 | 9 | - chua (requires Eigen library, header-only) 10 | **chuap** 11 | 12 | - Faust (requires libfaust) 13 | **faustgen faustcompile faustaudio faustdsp faustplay faustctl** 14 | 15 | - image (requires libpng) 16 | **imageload imagesave imagecreate imagesize imagegetpixel imagesetpixel imagefree** 17 | 18 | - py (requires a Python 3.x installation with dev libs) 19 | **Many opcodes to call Python code** 20 | 21 | - widgets (requires the FLTK LIB) 22 | **FLTK-based widgets.** 23 | NB: These opcodes do not work correctly on MacOS due 24 | to incompatibilities with the operating system. 25 | 26 | - virtual keyboard (requires the FLTK LIB) 27 | **Virtual MIDI keyboard midi backend** 28 | 29 | - STK opcodes (requires STK library) 30 | **Physical model opcodes using the STK library** 31 | 32 | 33 | Install location 34 | -------------- 35 | The CMake scripts in this repository use the default CS_USER_PLUGIN 36 | location on MacOS and Windows as defined in the Csound build, or a 37 | library instalation directory (customisable) on LINUX. These are: 38 | 39 | - LINUX: depends on both `CMAKE_INSTALL_PREFIX` and `USE_LIB64`. It is then installed in: 40 | * if `USE_LIB64=1` then to 41 | * for doubles: `${CSOUND_INSTALL_PREFIX}/lib64/csound/plugins64-${APIVERSION}` 42 | * for floats: `${CSOUND_INSTALL_PREFIX}/lib64/csound/plugins-${APIVERSION}` (floats)` 43 | * if `USE_LIB64=0` then to 44 | * for doubles: `${CSOUND_INSTALL_PREFIX}/lib/csound/plugins64-${APIVERSION}` 45 | * for floats: `${CSOUND_INSTALL_PREFIX}/lib/csound/plugins-${APIVERSION}` 46 | 47 | - MACOS: 48 | * For doubles: `$HOME/Library/csound/${APIVERSION}/plugins64` 49 | * For floats: `$HOME/Library/csound/${APIVERSION}/plugins` 50 | - Windows: 51 | * For doubles: `%LOCALAPPDATA%\csound\${APIVERSION}\plugins64` 52 | * For floats: `%LOCALAPPDATA%\csound\${APIVERSION}\plugins` 53 | 54 | 55 | Build Instructions for Linux and MacOS 56 | --- 57 | 58 | The build requires Csound to be installed, as well as CMake. With this 59 | in place, you can do : 60 | 61 | ``` 62 | $ git clone https://github.com/csound/plugins.git 63 | $ cd plugins 64 | $ mkdir build 65 | $ cd build 66 | $ cmake ../ 67 | $ make 68 | ``` 69 | 70 | By default, all the plugins are built. If one wants to exclude a 71 | plugin from the build process, one can pass an option to the cmake command. 72 | For example, to exclude the chua plugin, the `cmake` command would be: 73 | 74 | ``` 75 | $ cmake -DBUILD_CHUA_OPCODES=OFF ../ 76 | ``` 77 | 78 | For the FLTK dependent plugins, the configuration variable used is 79 | `USE_FLTK`. 80 | 81 | To install the opcodes you have built 82 | 83 | ``` 84 | $ make install 85 | ``` 86 | 87 | Depending on your permissions, you might need to prepend `sudo` to 88 | these commands. After the first build the plugins can be updated with 89 | 90 | ``` 91 | $ git pull 92 | $ make 93 | $ make install 94 | ``` 95 | 96 | using `sudo` in the last step if raised permissions are needed. On 97 | Linux, the installation location can be set with the relevant CMake 98 | variables as indicated above. 99 | 100 | Csound Location 101 | ------------ 102 | CMake will normally find the installed Csound headers (and library) 103 | automatically. However, if your Csound headers and library are not 104 | placed in the usual locations, you can use the following CMake option variables 105 | to tell CMake where they are: 106 | 107 | ``` 108 | CSOUND_INCLUDE_DIR_HINT 109 | ``` 110 | and 111 | 112 | ``` 113 | CSOUND_LIBRARY_DIR_HINT 114 | ``` 115 | -------------------------------------------------------------------------------- /6.x/cmake/Modules/FindEIGEN3.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find Eigen3 lib 2 | # 3 | # This module supports requiring a minimum version, e.g. you can do 4 | # find_package(Eigen3 3.1.2) 5 | # to require version 3.1.2 or newer of Eigen3. 6 | # 7 | # Once done this will define 8 | # 9 | # EIGEN3_FOUND - system has eigen lib with correct version 10 | # EIGEN3_INCLUDE_DIR - the eigen include directory 11 | # EIGEN3_VERSION - eigen version 12 | # 13 | # This module reads hints about search locations from 14 | # the following enviroment variables: 15 | # 16 | # EIGEN3_ROOT 17 | # EIGEN3_ROOT_DIR 18 | 19 | # Copyright (c) 2006, 2007 Montel Laurent, 20 | # Copyright (c) 2008, 2009 Gael Guennebaud, 21 | # Copyright (c) 2009 Benoit Jacob 22 | # Redistribution and use is allowed according to the terms of the 2-clause BSD license. 23 | 24 | if(NOT Eigen3_FIND_VERSION) 25 | if(NOT Eigen3_FIND_VERSION_MAJOR) 26 | set(Eigen3_FIND_VERSION_MAJOR 2) 27 | endif(NOT Eigen3_FIND_VERSION_MAJOR) 28 | if(NOT Eigen3_FIND_VERSION_MINOR) 29 | set(Eigen3_FIND_VERSION_MINOR 91) 30 | endif(NOT Eigen3_FIND_VERSION_MINOR) 31 | if(NOT Eigen3_FIND_VERSION_PATCH) 32 | set(Eigen3_FIND_VERSION_PATCH 0) 33 | endif(NOT Eigen3_FIND_VERSION_PATCH) 34 | 35 | set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") 36 | endif(NOT Eigen3_FIND_VERSION) 37 | 38 | macro(_eigen3_check_version) 39 | file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) 40 | 41 | string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") 42 | set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") 43 | string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") 44 | set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") 45 | string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") 46 | set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") 47 | 48 | set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) 49 | if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) 50 | set(EIGEN3_VERSION_OK FALSE) 51 | else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) 52 | set(EIGEN3_VERSION_OK TRUE) 53 | endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) 54 | 55 | if(NOT EIGEN3_VERSION_OK) 56 | 57 | message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " 58 | "but at least version ${Eigen3_FIND_VERSION} is required") 59 | endif(NOT EIGEN3_VERSION_OK) 60 | endmacro(_eigen3_check_version) 61 | 62 | if (EIGEN3_INCLUDE_DIR) 63 | 64 | # in cache already 65 | _eigen3_check_version() 66 | set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) 67 | 68 | else (EIGEN3_INCLUDE_DIR) 69 | 70 | # search first if an Eigen3Config.cmake is available in the system, 71 | # if successful this would set EIGEN3_INCLUDE_DIR and the rest of 72 | # the script will work as usual 73 | find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET) 74 | 75 | 76 | if(NOT EIGEN3_INCLUDE_DIR) 77 | find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library 78 | HINTS 79 | ENV EIGEN3_ROOT 80 | ENV EIGEN3_ROOT_DIR 81 | PATHS 82 | ${CMAKE_INSTALL_PREFIX}/include 83 | /usr/local/include 84 | ${CMAKE_INSTALL_PREFIX} 85 | $ENV{HOME}/include/ 86 | PATH_SUFFIXES eigen3 eigen Eigen 87 | ) 88 | endif(NOT EIGEN3_INCLUDE_DIR) 89 | 90 | if(EIGEN3_INCLUDE_DIR) 91 | _eigen3_check_version() 92 | endif(EIGEN3_INCLUDE_DIR) 93 | 94 | include(FindPackageHandleStandardArgs) 95 | find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) 96 | 97 | mark_as_advanced(EIGEN3_INCLUDE_DIR) 98 | 99 | endif(EIGEN3_INCLUDE_DIR) 100 | 101 | -------------------------------------------------------------------------------- /7.x/cmake/Modules/FindEIGEN3.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find Eigen3 lib 2 | # 3 | # This module supports requiring a minimum version, e.g. you can do 4 | # find_package(Eigen3 3.1.2) 5 | # to require version 3.1.2 or newer of Eigen3. 6 | # 7 | # Once done this will define 8 | # 9 | # EIGEN3_FOUND - system has eigen lib with correct version 10 | # EIGEN3_INCLUDE_DIR - the eigen include directory 11 | # EIGEN3_VERSION - eigen version 12 | # 13 | # This module reads hints about search locations from 14 | # the following enviroment variables: 15 | # 16 | # EIGEN3_ROOT 17 | # EIGEN3_ROOT_DIR 18 | 19 | # Copyright (c) 2006, 2007 Montel Laurent, 20 | # Copyright (c) 2008, 2009 Gael Guennebaud, 21 | # Copyright (c) 2009 Benoit Jacob 22 | # Redistribution and use is allowed according to the terms of the 2-clause BSD license. 23 | 24 | if(NOT Eigen3_FIND_VERSION) 25 | if(NOT Eigen3_FIND_VERSION_MAJOR) 26 | set(Eigen3_FIND_VERSION_MAJOR 2) 27 | endif(NOT Eigen3_FIND_VERSION_MAJOR) 28 | if(NOT Eigen3_FIND_VERSION_MINOR) 29 | set(Eigen3_FIND_VERSION_MINOR 91) 30 | endif(NOT Eigen3_FIND_VERSION_MINOR) 31 | if(NOT Eigen3_FIND_VERSION_PATCH) 32 | set(Eigen3_FIND_VERSION_PATCH 0) 33 | endif(NOT Eigen3_FIND_VERSION_PATCH) 34 | 35 | set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") 36 | endif(NOT Eigen3_FIND_VERSION) 37 | 38 | macro(_eigen3_check_version) 39 | file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) 40 | 41 | string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") 42 | set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") 43 | string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") 44 | set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") 45 | string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") 46 | set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") 47 | 48 | set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) 49 | if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) 50 | set(EIGEN3_VERSION_OK FALSE) 51 | else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) 52 | set(EIGEN3_VERSION_OK TRUE) 53 | endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) 54 | 55 | if(NOT EIGEN3_VERSION_OK) 56 | 57 | message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, " 58 | "but at least version ${Eigen3_FIND_VERSION} is required") 59 | endif(NOT EIGEN3_VERSION_OK) 60 | endmacro(_eigen3_check_version) 61 | 62 | if (EIGEN3_INCLUDE_DIR) 63 | 64 | # in cache already 65 | _eigen3_check_version() 66 | set(EIGEN3_FOUND ${EIGEN3_VERSION_OK}) 67 | 68 | else (EIGEN3_INCLUDE_DIR) 69 | 70 | # search first if an Eigen3Config.cmake is available in the system, 71 | # if successful this would set EIGEN3_INCLUDE_DIR and the rest of 72 | # the script will work as usual 73 | find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET) 74 | 75 | 76 | if(NOT EIGEN3_INCLUDE_DIR) 77 | find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library 78 | HINTS 79 | ENV EIGEN3_ROOT 80 | ENV EIGEN3_ROOT_DIR 81 | PATHS 82 | ${CMAKE_INSTALL_PREFIX}/include 83 | /usr/local/include 84 | ${CMAKE_INSTALL_PREFIX} 85 | $ENV{HOME}/include/ 86 | PATH_SUFFIXES eigen3 eigen Eigen 87 | ) 88 | endif(NOT EIGEN3_INCLUDE_DIR) 89 | 90 | if(EIGEN3_INCLUDE_DIR) 91 | _eigen3_check_version() 92 | endif(EIGEN3_INCLUDE_DIR) 93 | 94 | include(FindPackageHandleStandardArgs) 95 | find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK) 96 | 97 | mark_as_advanced(EIGEN3_INCLUDE_DIR) 98 | 99 | endif(EIGEN3_INCLUDE_DIR) 100 | 101 | -------------------------------------------------------------------------------- /6.x/src/hdf5/HDF5IO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Edward Costello 3 | * 4 | * This software is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This software is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this software; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | 20 | #include "csdl.h" 21 | #include "hdf5.h" 22 | #include 23 | 24 | typedef enum ArgumentType 25 | { 26 | STRING_VAR, 27 | ARATE_VAR, 28 | KRATE_VAR, 29 | IRATE_VAR, 30 | ARATE_ARRAY, 31 | KRATE_ARRAY, 32 | IRATE_ARRAY, 33 | UNKNOWN 34 | } ArgumentType; 35 | 36 | typedef struct _fft { 37 | OPDS h; 38 | ARRAYDAT *out; 39 | ARRAYDAT *in, *in2; 40 | MYFLT *f; 41 | MYFLT b; 42 | int32_t n; 43 | void *setup; 44 | AUXCH mem; 45 | } nFFT; 46 | 47 | 48 | 49 | typedef struct HDF5Dataset 50 | { 51 | char *datasetName; 52 | AUXCH datasetNameMemory; 53 | void *argumentPointer; 54 | ArgumentType writeType; 55 | ArgumentType readType; 56 | int32_t rank; 57 | hsize_t *chunkDimensions; 58 | AUXCH chunkDimensionsMemory; 59 | hsize_t *maxDimensions; 60 | AUXCH maxDimensionsMemory; 61 | hsize_t *offset; 62 | AUXCH offsetMemory; 63 | hsize_t *datasetSize; 64 | AUXCH datasetSizeMemory; 65 | 66 | hid_t datasetID; 67 | 68 | size_t elementCount; 69 | MYFLT *sampleBuffer; 70 | AUXCH sampleBufferMemory; 71 | 72 | bool readAll; 73 | 74 | } HDF5Dataset; 75 | 76 | typedef struct HDF5File 77 | { 78 | hid_t fileHandle; 79 | char *fileName; 80 | hid_t floatSize; 81 | 82 | } HDF5File; 83 | 84 | 85 | HDF5File *HDF5IO_newHDF5File(CSOUND *csound, AUXCH *hdf5FileMemory, 86 | STRINGDAT *path, bool openForWriting); 87 | 88 | void HDF5IO_deleteHDF5File(CSOUND *csound, HDF5File *hdf5File); 89 | 90 | typedef struct HDF5Write 91 | { 92 | OPDS h; 93 | MYFLT *arguments[20]; 94 | int32_t inputArgumentCount; 95 | size_t ksmps; 96 | HDF5File *hdf5File; 97 | AUXCH hdf5FileMemory; 98 | HDF5Dataset *datasets; 99 | AUXCH datasetsMemory; 100 | 101 | } HDF5Write; 102 | 103 | int32_t HDF5Write_initialise(CSOUND *csound, HDF5Write *self); 104 | 105 | int32_t HDF5Write_process(CSOUND *csound, HDF5Write *self); 106 | 107 | int32_t HDF5Write_finish(CSOUND *csound, void *inReference); 108 | 109 | void HDF5Write_checkArgumentSanity(CSOUND *csound, const HDF5Write *self); 110 | 111 | void HDF5Write_createDatasets(CSOUND *csound, HDF5Write *self); 112 | 113 | void HDF5Write_newArrayDataset(CSOUND *csound, HDF5Write *self, 114 | HDF5Dataset *dataset); 115 | 116 | void HDF5Write_deleteArrayDataset(CSOUND *csound, HDF5Dataset *dataset); 117 | 118 | 119 | typedef struct HDF5Read 120 | { 121 | OPDS h; 122 | MYFLT *arguments[20]; 123 | STRINGDAT *path; 124 | STRINGDAT *names[20]; 125 | int32_t inputArgumentCount; 126 | int32_t outputArgumentCount; 127 | size_t ksmps; 128 | HDF5File *hdf5File; 129 | AUXCH hdf5FileMemory; 130 | HDF5Dataset *datasets; 131 | AUXCH datasetsMemory; 132 | bool isSampleAccurate; 133 | 134 | } HDF5Read; 135 | 136 | int32_t HDF5Read_initialise(CSOUND *csound, HDF5Read *self); 137 | 138 | int32_t HDF5Read_process(CSOUND *csound, HDF5Read *self); 139 | 140 | int32_t HDF5Read_finish(CSOUND *csound, void *inReference); 141 | 142 | void HDF5Read_checkArgumentSanity(CSOUND *csound, const HDF5Read *self); 143 | 144 | void HDF5Read_openDatasets(CSOUND *csound, HDF5Read *self); 145 | -------------------------------------------------------------------------------- /6.x/src/stk/Android/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | CSOUND_SRC_ROOT := ../../../.. 6 | 7 | LOCAL_MODULE := libstk 8 | 9 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../stk/include $(LOCAL_PATH)/../../stk/src $(LOCAL_PATH)/../../../../Engine $(LOCAL_PATH)/../../../../H $(LOCAL_PATH)/../../../../include $(LOCAL_PATH)/../../../.. $(LOCAL_PATH)/../../../ $(NDK_MODULE_PATH)/libsndfile-android/jni $(LOCAL_PATH)/../../../CsoundAndroid/jni 10 | LOCAL_CFLAGS := -O3 -D__BUILDING_LIBCSOUND -DENABLE_NEW_PARSER -DLINUX -DHAVE_DIRENT_H -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H 11 | # Might need this: -DDEFAULT_RAWWAVE_PATH=${DEFAULT_STK_RAWWAVE_PATH} 12 | LOCAL_CPPFLAGS :=$(LOCAL_CFLAGS) 13 | LOCAL_CPPFLAGS += -std=c++11 -pthread -frtti -fexceptions 14 | LOCAL_LDFLAGS += -Wl,--export-dynamic 15 | ### 16 | 17 | # OMIT: 18 | # src/InetWvIn.cpp src/InetWvOut.cpp 19 | # src/Mutex.cpp src/RtAudio.cpp 20 | # src/RtMidi.cpp 21 | # src/RtWvIn.cpp src/RtWvOut.cpp 22 | # src/Socket.cpp src/TcpClient.cpp 23 | # src/TcpServer.cpp src/Thread.cpp 24 | # src/UdpSocket.cpp) 25 | 26 | LOCAL_SRC_FILES := $(CSOUND_SRC_ROOT)/Opcodes/stk/stkOpcodes.cpp \ 27 | ../../stk/src/ADSR.cpp \ 28 | ../../stk/src/Asymp.cpp \ 29 | ../../stk/src/BandedWG.cpp \ 30 | ../../stk/src/BeeThree.cpp \ 31 | ../../stk/src/BiQuad.cpp \ 32 | ../../stk/src/Blit.cpp \ 33 | ../../stk/src/BlitSaw.cpp \ 34 | ../../stk/src/BlitSquare.cpp \ 35 | ../../stk/src/BlowBotl.cpp \ 36 | ../../stk/src/BlowHole.cpp \ 37 | ../../stk/src/Bowed.cpp \ 38 | ../../stk/src/Brass.cpp \ 39 | ../../stk/src/Chorus.cpp \ 40 | ../../stk/src/Clarinet.cpp \ 41 | ../../stk/src/DelayA.cpp \ 42 | ../../stk/src/Delay.cpp \ 43 | ../../stk/src/DelayL.cpp \ 44 | ../../stk/src/Drummer.cpp \ 45 | ../../stk/src/Echo.cpp \ 46 | ../../stk/src/Envelope.cpp \ 47 | ../../stk/src/FileLoop.cpp \ 48 | ../../stk/src/FileRead.cpp \ 49 | ../../stk/src/FileWrite.cpp \ 50 | ../../stk/src/FileWvIn.cpp \ 51 | ../../stk/src/FileWvOut.cpp \ 52 | ../../stk/src/Fir.cpp \ 53 | ../../stk/src/Flute.cpp \ 54 | ../../stk/src/FM.cpp \ 55 | ../../stk/src/FMVoices.cpp \ 56 | ../../stk/src/FormSwep.cpp \ 57 | ../../stk/src/FreeVerb.cpp \ 58 | ../../stk/src/Granulate.cpp \ 59 | ../../stk/src/Guitar.cpp \ 60 | ../../stk/src/HevyMetl.cpp \ 61 | ../../stk/src/Iir.cpp \ 62 | ../../stk/src/JCRev.cpp \ 63 | ../../stk/src/LentPitShift.cpp \ 64 | ../../stk/src/Mandolin.cpp \ 65 | ../../stk/src/Mesh2D.cpp \ 66 | ../../stk/src/Messager.cpp \ 67 | ../../stk/src/MidiFileIn.cpp \ 68 | ../../stk/src/ModalBar.cpp \ 69 | ../../stk/src/Modal.cpp \ 70 | ../../stk/src/Modulate.cpp \ 71 | ../../stk/src/Moog.cpp \ 72 | ../../stk/src/Noise.cpp \ 73 | ../../stk/src/NRev.cpp \ 74 | ../../stk/src/OnePole.cpp \ 75 | ../../stk/src/OneZero.cpp \ 76 | ../../stk/src/PercFlut.cpp \ 77 | ../../stk/src/Phonemes.cpp \ 78 | ../../stk/src/PitShift.cpp \ 79 | ../../stk/src/Plucked.cpp \ 80 | ../../stk/src/PoleZero.cpp \ 81 | ../../stk/src/PRCRev.cpp \ 82 | ../../stk/src/Resonate.cpp \ 83 | ../../stk/src/Rhodey.cpp \ 84 | ../../stk/src/Sampler.cpp \ 85 | ../../stk/src/Saxofony.cpp \ 86 | ../../stk/src/Shakers.cpp \ 87 | ../../stk/src/Simple.cpp \ 88 | ../../stk/src/SineWave.cpp \ 89 | ../../stk/src/SingWave.cpp \ 90 | ../../stk/src/Sitar.cpp \ 91 | ../../stk/src/Skini.cpp \ 92 | ../../stk/src/Sphere.cpp \ 93 | ../../stk/src/StifKarp.cpp \ 94 | ../../stk/src/Stk.cpp \ 95 | ../../stk/src/TapDelay.cpp \ 96 | ../../stk/src/TubeBell.cpp \ 97 | ../../stk/src/Twang.cpp \ 98 | ../../stk/src/TwoPole.cpp \ 99 | ../../stk/src/TwoZero.cpp \ 100 | ../../stk/src/Voicer.cpp \ 101 | ../../stk/src/VoicForm.cpp \ 102 | ../../stk/src/Whistle.cpp \ 103 | ../../stk/src/Wurley.cpp 104 | 105 | include $(BUILD_SHARED_LIBRARY) 106 | 107 | -------------------------------------------------------------------------------- /6.x/src/widgets/winFLTK.h: -------------------------------------------------------------------------------- 1 | /* 2 | winFLTK.h: 3 | 4 | Copyright (C) 2006 Istvan Varga 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #ifndef CSOUND_WINFLTK_H 25 | #define CSOUND_WINFLTK_H 26 | 27 | #include "csdl.h" 28 | #ifdef __cplusplus 29 | #include 30 | #endif 31 | 32 | /** 33 | * FLTK flags is the sum of any of the following values: 34 | * 1 (input): disable widget opcodes by setting up dummy opcodes instead 35 | * 2 (input): disable FLTK graphs 36 | * 4 (input): disable the use of a separate thread for widget opcodes 37 | * 8 (input): disable the use of Fl::lock() and Fl::unlock() 38 | * 16 (input): disable the use of Fl::awake() 39 | * 32 (output): widget opcodes are used 40 | * 64 (output): FLTK graphs are used 41 | * 128 (input): disable widget opcodes by not registering any opcodes 42 | * 256 (input): disable the use of Fl::wait() (implies no widget thread) 43 | */ 44 | 45 | static inline int getFLTKFlags(CSOUND *csound) 46 | { 47 | return (*((int*) csound->QueryGlobalVariableNoCheck(csound, "FLTK_Flags"))); 48 | } 49 | 50 | static inline int *getFLTKFlagsPtr(CSOUND *csound) 51 | { 52 | return ((int*) csound->QueryGlobalVariableNoCheck(csound, "FLTK_Flags")); 53 | } 54 | 55 | #ifdef __cplusplus 56 | 57 | static inline void Fl_lock(CSOUND *csound) 58 | { 59 | #ifdef NO_FLTK_THREADS 60 | (void) csound; 61 | #else 62 | if (!(getFLTKFlags(csound) & 8)) { 63 | Fl::lock(); 64 | } 65 | #endif 66 | } 67 | 68 | static inline void Fl_unlock(CSOUND *csound) 69 | { 70 | #ifdef NO_FLTK_THREADS 71 | (void) csound; 72 | #else 73 | if (!(getFLTKFlags(csound) & 8)) { 74 | Fl::unlock(); 75 | } 76 | #endif 77 | } 78 | 79 | static inline void Fl_awake(CSOUND *csound) 80 | { 81 | #ifdef NO_FLTK_THREADS 82 | (void) csound; 83 | #else 84 | if (!(getFLTKFlags(csound) & 16)) { 85 | Fl::awake(); 86 | } 87 | #endif 88 | } 89 | 90 | static inline void Fl_wait(CSOUND *csound, double seconds) 91 | { 92 | if (!(getFLTKFlags(csound) & 256)) 93 | Fl::wait(seconds); 94 | } 95 | 96 | static inline void Fl_wait_locked(CSOUND *csound, double seconds) 97 | { 98 | int fltkFlags; 99 | 100 | fltkFlags = getFLTKFlags(csound); 101 | if (!(fltkFlags & 256)) { 102 | #ifndef NO_FLTK_THREADS 103 | if (!(fltkFlags & 8)) 104 | Fl::lock(); 105 | #endif 106 | Fl::wait(seconds); 107 | #ifndef NO_FLTK_THREADS 108 | if (!(fltkFlags & 8)) 109 | Fl::unlock(); 110 | #endif 111 | } 112 | } 113 | 114 | #endif /* __cplusplus */ 115 | 116 | #ifdef __cplusplus 117 | extern "C" { 118 | #endif 119 | 120 | extern int CsoundYield_FLTK(CSOUND *); 121 | extern void DrawGraph_FLTK(CSOUND *, WINDAT *); 122 | extern int ExitGraph_FLTK(CSOUND *); 123 | extern void kill_graph(CSOUND *, uintptr_t); 124 | extern void KillXYin_FLTK(CSOUND *, XYINDAT *); 125 | extern uintptr_t MakeWindow_FLTK(CSOUND *, char *); 126 | extern void MakeXYin_FLTK(CSOUND *, XYINDAT *, MYFLT, MYFLT); 127 | extern int myFLwait(void); 128 | extern void ReadXYin_FLTK(CSOUND *, XYINDAT *); 129 | extern void flgraph_init(CSOUND *csound); 130 | extern void widget_init(CSOUND *); 131 | extern int widget_reset(CSOUND *, void *); 132 | 133 | extern const OENTRY widgetOpcodes_[]; 134 | 135 | #ifdef __cplusplus 136 | } /* extern "C" */ 137 | #endif 138 | 139 | #endif /* CSOUND_WINFLTK_H */ 140 | 141 | -------------------------------------------------------------------------------- /6.x/src/widgets/virtual_keyboard/SliderBank.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | SliderBank.cpp: 3 | 4 | Copyright (C) 2006 Steven Yi 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #include "SliderBank.hpp" 25 | 26 | #include 27 | #include 28 | 29 | int WheelSlider::handle(int event) { 30 | int res = Fl_Value_Slider::handle(event); 31 | if (event == FL_MOUSEWHEEL) { 32 | int dy = Fl::event_dy(); 33 | value(clamp(round(increment(value(), -dy)))); 34 | return 1; 35 | } 36 | return res; 37 | } 38 | 39 | static void spinnerCallback(Fl_Widget *widget, void *v) { 40 | Fl_Spinner *spinner = (Fl_Spinner *)widget; 41 | SliderBank *sliderBank = (SliderBank *)v; 42 | 43 | for(int i = 0; i < 10; i++) { 44 | if(sliderBank->spinners[i] == spinner) { 45 | sliderBank->lock(); 46 | SliderData* data = sliderBank->getSliderData(); 47 | data->controllerNumber[i] = (int)spinner->value(); 48 | sliderBank->unlock(); 49 | } 50 | } 51 | } 52 | 53 | static void sliderCallback(Fl_Widget *widget, void *v) { 54 | Fl_Slider *slider = (Fl_Slider *)widget; 55 | SliderBank *sliderBank = (SliderBank *)v; 56 | 57 | for(int i = 0; i < 10; i++) { 58 | if(sliderBank->sliders[i] == slider) { 59 | sliderBank->lock(); 60 | SliderData* data = sliderBank->getSliderData(); 61 | data->controllerValue[i] = (int)slider->value(); 62 | sliderBank->unlock(); 63 | } 64 | } 65 | } 66 | 67 | SliderBank::SliderBank(CSOUND *csound, 68 | int X, int Y, int W, int H) 69 | : Fl_Group(X, Y, W, H) 70 | { 71 | 72 | this->csound = csound; 73 | this->mutex = csound->Create_Mutex(0); 74 | 75 | this->channel = 0; 76 | 77 | this->begin(); 78 | 79 | for(int i = 0; i < 10; i++) { 80 | int x, y; 81 | 82 | if(i < 5) { 83 | x = 10; 84 | y = 10 + (i * 25); 85 | } else { 86 | x = 382; 87 | y = 10 + ((i - 5) * 25); 88 | } 89 | 90 | Fl_Spinner *spinner = new Fl_Spinner(x, y, 60, 20); 91 | spinners[i] = spinner; 92 | spinner->maximum(127); 93 | spinner->minimum(0); 94 | spinner->step(1); 95 | spinner->value(i + 1); 96 | spinner->callback((Fl_Callback*)spinnerCallback, this); 97 | 98 | 99 | WheelSlider *slider = new WheelSlider(x + 70, y, 292, 20); 100 | sliders[i] = slider; 101 | slider->type(FL_HOR_SLIDER); 102 | slider->maximum(127); 103 | slider->minimum(0); 104 | slider->step(1); 105 | slider->value(0); 106 | slider->callback((Fl_Callback*)sliderCallback, this); 107 | } 108 | 109 | 110 | this->end(); 111 | 112 | } 113 | 114 | SliderBank::~SliderBank() 115 | { 116 | if (mutex) { 117 | csound->DestroyMutex(mutex); 118 | mutex = (void*) 0; 119 | } 120 | } 121 | 122 | void SliderBank::setChannel(int channel) { 123 | this->channel = channel; 124 | 125 | SliderData data = sliderData[channel]; 126 | 127 | lock(); 128 | for(int i = 0; i < 10; i++) { 129 | spinners[i]->value(data.controllerNumber[i]); 130 | sliders[i]->value(data.controllerValue[i]); 131 | } 132 | unlock(); 133 | } 134 | 135 | SliderData * SliderBank::getSliderData() { 136 | return &sliderData[channel]; 137 | } 138 | 139 | void SliderBank::incrementSlider(int index, int n) { 140 | Fl_Slider* slider = sliders[index]; 141 | slider->value(slider->clamp(slider->round(slider->increment(slider->value(), n)))); 142 | } 143 | 144 | void SliderBank::lock() { 145 | if(mutex) { 146 | csound->LockMutex(mutex); 147 | } 148 | } 149 | 150 | void SliderBank::unlock() { 151 | if(mutex) { 152 | csound->UnlockMutex(mutex); 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /6.x/src/mp3/mp3out.c: -------------------------------------------------------------------------------- 1 | /* 2 | mp3out.c: 3 | 4 | Copyright (C) 2019 by John ffitch 5 | 6 | This file is part of Csound. 7 | 8 | The Csound Library is free software; you can redistribute it 9 | and/or modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | Csound is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General Public 19 | License along with Csound; if not, write to the Free Software 20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 21 | 02110-1301 USA 22 | */ 23 | 24 | #include "csdl.h" 25 | #include 26 | 27 | typedef struct _mp3out { 28 | OPDS h; 29 | MYFLT *al; 30 | MYFLT *ar; 31 | STRINGDAT *filename; 32 | MYFLT *bitrate; 33 | MYFLT *quality; 34 | MYFLT *mode; 35 | lame_global_flags *gfp; 36 | FILE *fout; 37 | AUXCH auxch; 38 | void *mp3buffer; 39 | int mp3buffer_size; 40 | MYFLT *leftpcm; 41 | MYFLT *rightpcm; 42 | } MP3OUT; 43 | 44 | #define DEFAULT_RATE (256) 45 | 46 | #ifdef USE_DOUBLE 47 | #define lame_encode_buffer_ieee_MYFLT lame_encode_buffer_ieee_double 48 | #else 49 | #define lame_encode_buffer_ieee_MYFLT lame_encode_buffer_ieee_float 50 | #endif 51 | 52 | int mp3out_cleanup(CSOUND *csound, MP3OUT *p) 53 | { 54 | IGN(csound); 55 | int bytes = lame_encode_flush(p->gfp,p->mp3buffer, p->mp3buffer_size); 56 | if (bytes>0) fwrite(p->mp3buffer, 1, bytes, p->fout); 57 | lame_mp3_tags_fid(p->gfp, p->fout); 58 | lame_close(p->gfp); 59 | 60 | p->gfp = NULL; 61 | fclose(p->fout); 62 | return OK; 63 | } 64 | 65 | 66 | int mp3out_init(CSOUND *csound, MP3OUT* p) 67 | { 68 | int ret_code; 69 | int bitrate, quality, mode; 70 | unsigned int nsmps = csound->GetKsmps(csound); 71 | lame_global_flags *gfp; 72 | gfp = lame_init(); 73 | p->gfp = gfp; 74 | 75 | bitrate = (*p->bitrate<0) ? DEFAULT_RATE : (int)MYFLT2LRND(*p->bitrate); 76 | quality = (*p->quality<0) ? 2 : (int)MYFLT2LRND(*p->quality); 77 | if (quality>9) quality = 9; 78 | mode = MYFLT2LRND(*p->mode); 79 | if (mode>3||mode<0) mode = 1; 80 | lame_set_num_channels(gfp,2); 81 | lame_set_in_samplerate(gfp,csound->GetSr(csound)); 82 | lame_set_brate(gfp,bitrate); 83 | lame_set_mode(gfp,mode); 84 | lame_set_quality(gfp,quality); /* 2=high 5 = medium 7=low */ 85 | 86 | if (UNLIKELY(ret_code = lame_init_params(gfp)) < 0) { 87 | return csound->InitError(csound, 88 | Str("Failed to initialise LAME %d\n"), ret_code); 89 | } 90 | 91 | p->fout = fopen(p->filename->data, "w+b"); 92 | if (p->fout == NULL) { 93 | return csound->InitError(csound, Str("mp3out %s: failed to open file"), p->filename->data); 94 | } 95 | 96 | csound->AuxAlloc(csound, 97 | 2*nsmps*sizeof(MYFLT)+(p->mp3buffer_size=3*nsmps/2+7200), 98 | &p->auxch); 99 | 100 | p->mp3buffer = p->auxch.auxp; 101 | p->leftpcm = (char*)p->auxch.auxp + p->mp3buffer_size; 102 | p->rightpcm = p->leftpcm + nsmps; 103 | 104 | csound->RegisterDeinitCallback(csound, p, 105 | (int32_t (*)(CSOUND*, void*)) mp3out_cleanup); 106 | return OK; 107 | } 108 | 109 | int mp3out_perf(CSOUND *csound, MP3OUT *p) 110 | { 111 | int bytes; 112 | unsigned int i, nsmps = csound->GetKsmps(csound); 113 | MYFLT zdbfs = csound->Get0dBFS(csound); 114 | 115 | for (i = 0; ileftpcm[i] = p->al[i]/zdbfs; 117 | p->rightpcm[i] = p->ar[i]/zdbfs; 118 | } 119 | 120 | bytes = lame_encode_buffer_ieee_MYFLT(p->gfp, 121 | p->leftpcm, p->rightpcm, 122 | nsmps, p->mp3buffer, p->mp3buffer_size); 123 | 124 | if (bytes >= 0) { 125 | fwrite(p->mp3buffer, 1, bytes, p->fout); 126 | } 127 | else if (bytes < 0) { 128 | return csound->PerfError(csound, &(p->h), 129 | Str("mp3out: write error %d\n"), bytes); 130 | } 131 | 132 | return OK; 133 | } 134 | 135 | #define S(x) sizeof(x) 136 | 137 | static OENTRY localops[] = { 138 | { "mp3out", S(MP3OUT), 0, 3, "", "aaSjjp", (SUBR)mp3out_init, (SUBR)mp3out_perf} 139 | }; 140 | 141 | LINKAGE 142 | -------------------------------------------------------------------------------- /6.x/src/CUDA/convf.cu: -------------------------------------------------------------------------------- 1 | // -*- c++ -*- 2 | /* convf.cu 3 | (c) Victor Lazzarini, 2013 4 | 5 | based on M Puckette's pitch tracking algorithm. 6 | 7 | This file is part of Csound. 8 | 9 | The Csound Library is free software; you can redistribute it 10 | and/or modify it under the terms of the GNU Lesser General Public 11 | License as published by the Free Software Foundation; either 12 | version 2.1 of the License, or (at your option) any later version. 13 | 14 | Csound is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Lesser General Public License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public 20 | License along with Csound; if not, write to the Free Software 21 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 22 | 02110-1301 USA 23 | */ 24 | 25 | #include 26 | 27 | __global__ void convol(float *out, float *del, float *coefs, int irsize, int rp, int vsize) { 28 | int t = (threadIdx.x + blockIdx.x*blockDim.x); 29 | if(t >= irsize*vsize) return; 30 | int n = t%vsize; /* sample index */ 31 | int h = t/vsize; /* coeff index */ 32 | int end = irsize+vsize; 33 | rp += n + h; /* read point, oldest -> newest */ 34 | out[t] = del[rp < end ? rp : rp%end]*coefs[irsize-1-h]; /* single tap */ 35 | if(t >= vsize) return; 36 | __syncthreads(); 37 | float a = 0.0; 38 | for(int i=1, j=vsize; i < irsize; i++, j+=vsize) 39 | a += out[n + j]; /* mix all taps */ 40 | out[n] += a; 41 | } 42 | 43 | typedef struct _CONV { 44 | OPDS h; 45 | MYFLT *aout, *asig, *ifn; 46 | float *coeffs, *out, *del; 47 | int wp, irsize; 48 | AUXCH buf; 49 | int blocks, threads; 50 | } CONV; 51 | 52 | 53 | static int destroy_conv(CSOUND *csound, void *pp){ 54 | CONV *p = (CONV *) pp; 55 | cudaFree(p->coeffs); 56 | cudaFree(p->del); 57 | cudaFree(p->out); 58 | return OK; 59 | } 60 | 61 | static int conv_init(CSOUND *csound, CONV *p){ 62 | 63 | FUNC *ftab = csound->FTnp2Find(csound, p->ifn); 64 | int irsize = ftab->flen; 65 | int nsmps = CS_KSMPS,i; 66 | int threads = irsize*nsmps; 67 | float *tmp; 68 | 69 | cudaMalloc(&p->coeffs, sizeof(float)*irsize); 70 | 71 | tmp = (float*) malloc(sizeof(float)*irsize); 72 | for(i=0; i< irsize; i++) 73 | tmp[i] = (float) ftab->ftable[i]; 74 | cudaMemcpy(p->coeffs,tmp, sizeof(float)*irsize, 75 | cudaMemcpyHostToDevice); 76 | free(tmp); 77 | 78 | cudaMalloc(&p->del, sizeof(float)*(irsize+nsmps)); 79 | cudaMalloc(&p->out, sizeof(float)*threads); 80 | cudaMemset(p->del,0,sizeof(float)*(irsize+nsmps)); 81 | cudaMemset(p->out, 0, sizeof(float)*threads); 82 | 83 | p->wp = 0; 84 | p->irsize = irsize; 85 | 86 | cudaDeviceProp deviceProp; 87 | cudaGetDeviceProperties(&deviceProp, 0); 88 | int blockspt = deviceProp.maxThreadsPerBlock; 89 | csound->Message(csound, "CUDAconv: using device %s (capability %d.%d)\n", 90 | deviceProp.name,deviceProp.major, deviceProp.minor); 91 | 92 | p->blocks = threads > blockspt ? ceil(threads/blockspt) : 1; 93 | p->threads = threads > blockspt ? blockspt : threads; 94 | 95 | csound->RegisterDeinitCallback(csound, p, destroy_conv); 96 | OPARMS parms; 97 | csound->GetOParms(csound, &parms); 98 | if(parms.odebug) 99 | csound->Message(csound, "blocks %d, threads %d - %d\n", p->blocks, p->threads, threads); 100 | if(p->buf.auxp == NULL) 101 | csound->AuxAlloc(csound, sizeof(float)*CS_KSMPS, &p->buf); 102 | 103 | return OK; 104 | 105 | } 106 | /* the delay size is irsize + vsize so that 107 | we can shift in a whole block of samples */ 108 | int conv_perf(CSOUND *csound, CONV *p){ 109 | 110 | int nsmps = CS_KSMPS; 111 | MYFLT *sig = p->asig, *aout = p->aout; 112 | float *del = p->del, *out = p->out, *coefs = p->coeffs, *buf = (float *)p->buf.auxp; 113 | int irsize = p->irsize; 114 | int wp = p->wp, i; 115 | 116 | for(i=0; i < nsmps; i++) buf[i] = (float) sig[i]; 117 | if(wp > irsize) { 118 | int front = wp - irsize; 119 | cudaMemcpy(&del[wp], buf, sizeof(float)*(nsmps-front), cudaMemcpyHostToDevice); 120 | cudaMemcpy(del, &buf[nsmps-front], sizeof(float)*front, cudaMemcpyHostToDevice); 121 | } 122 | else cudaMemcpy(&del[wp], buf, sizeof(float)*nsmps, cudaMemcpyHostToDevice); 123 | 124 | wp = (wp+nsmps)%(irsize+nsmps); /* wp is now the oldest sample in the delay */ 125 | convol<<blocks,p->threads>>>(out, del, coefs, irsize, wp, nsmps); 126 | 127 | cudaMemcpy(buf, out, sizeof(float)*nsmps, cudaMemcpyDeviceToHost); 128 | 129 | for(i=0; i < nsmps; i++) aout[i] = (float) buf[i]; 130 | p->wp = wp; 131 | return OK; 132 | } 133 | 134 | static OENTRY localops[] = { 135 | {"cudaconv", sizeof(CONV),0, 5, "a", "ai", (SUBR) conv_init, NULL, 136 | (SUBR) conv_perf}, 137 | }; 138 | 139 | extern "C" { 140 | LINKAGE 141 | } 142 | --------------------------------------------------------------------------------