asb2m10 / jsusfx Goto Github PK
View Code? Open in Web Editor NEWOpensource Jesusonic FX implementation
License: Other
Opensource Jesusonic FX implementation
License: Other
it would be great if jsfx scripts could be used to implement Pd-objects.
e.g. [tubeharmonics~]
could really be implemented as tubeharmonics.jsfx
.
there are subtle differences to using the [jsusfx~]
object; e.g. one could provide an abstraction fallback that can be used on platforms that lack jsusfx.
Pd's mechanism to implement that is called "loaders".
toggling "bypass" on/off doesn't do anything (the effect is always applied).
This is with Pd-0.47-0(test) on Debian GNU/linux (amd64).
This is not an issue, just a heads up that I added a csound interface to jsusfx, based on the pd implementation. I included it in the csound-plugins project so that it gets built and installed together with many other plugins. It lacks midi support at the moment and gfx make little sense in the context of csound, but everything else works. Performance seems to be ok, for comparison I implemented two plugins in c and the jsfx code runs around 2.5x slower than the c version.
Thanks for the great work!
https://github.com/csound-plugins/csound-plugins/tree/master/src/jsusfx
Eduardo Moguillansky
jsusfx/scripts/liteon/sonic_enhancer.jsfx
Line 35 in bcc9cd7
To keep the same envelope following on all samplerates this constant has to be sample rate normalized. rc0_k0 has to become:
rc0_k0 = 0.0003 * 48000 / srate;
After doing that the FX sounds alike on all sample rates.
I'm not on a dev machine, so I can't provide the fix myself.
i don't know whether this is really an issue (or by intention), but:
the file WDL/eel2/asm-nseel-x64.obj
seems to be a build-artefact (what's that...W32/64bit?) that was accidentally checked in and should be removed.
as of Pd-0.52 (about to be released today), the error()
function has been removed from the public API (it's still available in the ABI for binary compat with older externals).
Please switch to using pd_error
instead (which is much nicer anyhow, as it allows the user to find the source of the error by Ctrl-clicking the error message)
jsusfx~
currently only allows for stereo i/o.
however, the underlying JSFX allows for (currently) up to 64 channels in either direction.
it would be great if this could be supported.
there's some fishy code going on in the Pd-backend, where the selector midi
is assigned to multiple callbacks:
Lines 591 to 592 in aa6da16
This is not supported by Pd: a selector can only be bound to a single classmethod
.
Since an A_GIMME
is a superset of an A_FLOAT
, you could simply dispatch a 1-floatatom-list to jsusfx_midi
from jsusfx_list
. However, since jsusfx_list
is already doing that, you can simply remove the jsusfx_midi
callback altogether.
Furthermore the midi-methods for [jsfx~]
seem to be setup wrongly altogether:
Lines 602 to 605 in aa6da16
jsusfx_class
is just a typo and should read jsfx_class
instead. (and again the callback for jsusfx_midi
should be removed)would it be possible to detect the usability of native x86 instructions on the stack at runtime (to prevent segfaults)?
hey found another error i cant seem to get past this time, found my solution for the other error again but i get this
/Users/shree/Documents/Pd/jsusfx/pd/jsusfx_pd.cpp:153:34: error: read-only variable is not assignable
midi[midiSize++] = midiPreStream[i];
Any ideas?
Currently any script which uses the "spl(channelindex)" syntax fails to compile. This makes many jsfx fail to work.
Reaper documentation, http://reaper.fm/sdk/js/vars.php#js_specialvars
spl(channelindex) -- REAPER 2.018+
Context: @sample only
If you wish to programmatically choose which sample to access, use this function (rather than splX). This is slightly slower than splX, however has the advantage that you can do spl(variable) (enabling easily configurable channel mappings). Valid syntaxes include:spl(channelindex)=somevalue;
spl(5)+=spl(3);
using either [describe(
or [dumpvars(
gives an error on the Pd-console:
Bad arguments for message 'describe' to object 'jsusfx~'
this is because the methods are declared to have A_CANT
arguments (which marks the methods for internal-use only)
compilation of the Pd-externals fails with:
jsusfx_pd.cpp:43:21: error: format not a string literal and no format arguments [-Werror=format-security]
error(output);
as error(const char*fmt, ...)
should really be called as
error("%s", output);
Hey,
For some files to compile I need proper import statement support. I'd like to know your thoughts on this. :-)
Specifically, I'm trying to get some of the ATK for Reaper plugins to work,
https://github.com/ambisonictoolkit/atk-reaper
With the changes I already made, some of them are already working. But most of them will actually need the import statement to work. What are your thoughts on this? I can imagine there's a potential security risk with letting scripts access arbitrary files (how does Reaper deal with this.. ?). Other than this I think it should be feasible to add support with not a whole lot of changes. So perhaps an opt-in system where the user of the library specifies whether he/she wants import behavior to work or not could be a possible solution?
Cheers,
Marcel
running the example patch, this crashes immediately if click on the [compile octaveup(
button while dsp is on.
system:
it does work however, if i compile the everything with gcc (Debian 5.3.1-9).
Are there any instructions on how to get this building properly on windows? What tools are needed, the workflow, etc.
Also, is there anyway of getting the resulting library to link with a mingw binary?
Hi,
I'm trying to compile the Pd objects for windows 64 bit. No hurries :)
I do and get:
Lucarda@T410 MINGW64 /d/00-volatil/jsusfx/pd
$ cmake -G "MSYS Makefiles" -D CMAKE_C_COMPILER=D:/msys64/mingw64/bin/gcc.exe -D CMAKE_CXX_COMPILER=D:/msys64/mingw64/bin/g++.exe .
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: D:/msys64/mingw64/bin/gcc.exe
-- Check for working C compiler: D:/msys64/mingw64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: D:/msys64/mingw64/bin/g++.exe
-- Check for working CXX compiler: D:/msys64/mingw64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: D:/00-volatil/jsusfx/pd
Lucarda@T410 MINGW64 /d/00-volatil/jsusfx/pd
$ make install
Scanning dependencies of target jsusfx
[ 7%] Building CXX object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/jsusfx.cpp.obj
In file included from D:/00-volatil/jsusfx/src/jsusfx.cpp:19:
D:/00-volatil/jsusfx/src/jsusfx_file.h:128:19: warning: ignoring attributes on template argument 'EEL_F' {aka 'double'} [-Wignored-attributes]
128 | std::vector<EEL_F> vars;
| ^
[ 14%] Building CXX object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/jsusfx_file.cpp.obj
In file included from D:/00-volatil/jsusfx/src/jsusfx_file.cpp:18:
D:/00-volatil/jsusfx/src/jsusfx_file.h:128:19: warning: ignoring attributes on template argument 'EEL_F' {aka 'double'} [-Wignored-attributes]
128 | std::vector<EEL_F> vars;
| ^
[ 21%] Building CXX object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/jsusfx_gfx.cpp.obj
[ 28%] Building CXX object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/jsusfx_serialize.cpp.obj
[ 35%] Building CXX object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/riff.cpp.obj
[ 42%] Building C object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/WDL/eel2/nseel-compiler.c.obj
[ 50%] Building C object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/WDL/eel2/nseel-eval.c.obj
[ 57%] Building C object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/WDL/eel2/nseel-ram.c.obj
[ 64%] Building C object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/WDL/eel2/nseel-yylex.c.obj
[ 71%] Building C object D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/WDL/eel2/nseel-cfunc.c.obj
D:\msys64\tmp\ccQYJwpg.s: Assembler messages:
D:\msys64\tmp\ccQYJwpg.s:263: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:304: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:344: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:345: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:346: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:431: Error: operand type mismatch for `fmul'
D:\msys64\tmp\ccQYJwpg.s:438: Error: operand type mismatch for `fadd'
D:\msys64\tmp\ccQYJwpg.s:475: Warning: translating to `fstp %st(0)'
D:\msys64\tmp\ccQYJwpg.s:978: Warning: translating to `faddp'
D:\msys64\tmp\ccQYJwpg.s:1099: Warning: translating to `fsubrp'
D:\msys64\tmp\ccQYJwpg.s:1220: Warning: translating to `fmulp'
D:\msys64\tmp\ccQYJwpg.s:1341: Warning: translating to `fdivrp'
D:\msys64\tmp\ccQYJwpg.s:1378: Warning: translating to `fdivp'
D:\msys64\tmp\ccQYJwpg.s:1426: Warning: translating to `fdivp'
D:\msys64\tmp\ccQYJwpg.s:2105: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:2146: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:2188: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:2226: Warning: translating to `fsubp'
D:\msys64\tmp\ccQYJwpg.s:2351: Warning: translating to `fsubp'
D:\msys64\tmp\ccQYJwpg.s:2763: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2764: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2766: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2767: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2768: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:2812: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:2852: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2853: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2854: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2855: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:2898: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:2938: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2939: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:2940: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:2982: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:3033: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:3034: Error: invalid instruction suffix for `push'
D:\msys64\tmp\ccQYJwpg.s:3035: Error: operand type mismatch for `call'
D:\msys64\tmp\ccQYJwpg.s:3082: Error: operand type mismatch for `call'
make[2]: *** [/D/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/build.make:180: D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/WDL/eel2/nseel-cfunc.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:127: D:/00-volatil/jsusfx/src/CMakeFiles/jsusfx.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
?
since jsusfx switched to CMake, the builds fail for 64bit architectures that happen to not be x86_64.
e.g. see the recent upload to Debian: https://buildd.debian.org/status/package.php?p=jsusfx, that fails on arm64
, mips64el
, ppc64el
...
the reason for the Debian build failures is primarily a missing php
installation, but since php
is only used to compile assembler the underlying reason is that the CMake buildsystem has dropped support for PORTABLE
builds (that don't require assembly code, at the expense of being much slower).
please bring back an option to build PORTABLE
binaries.
oggread is an external not available everywhere (esp, since Pd-extended is rather dead).
Also there is no test.ogg file.
Since the example works fine without any file-playback, i suggest to change the audio source to some vanilla objects ([osc~]
and/or [noise~]
)
afaict (not having REAPER at hand), the specs allow a plugin to write to a slider
variable, and the host is supposed to display this value.
probably the [jsusf~]
could be given an extra outlet that would output the slider-values? (either when triggered manually, when a value has changed or for each block).
Ubuntu 16LTS
i built first on 32bit and it built perfectly on 64 bit though i get
maybe i am using wrong compiler
[shree@shree-linux2:$ gcc -v16.04.10' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) ]
Error i get when running make install in pd =
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp: In member function ‘void JsusFxPathLibrary_Basic::addSearchPath(const string&)’:
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp:337:12: error: ‘const string {aka const class std::__cxx11::basic_string}’ has no member named ‘back’
if ( path.back() == '/' || path.back() == '\' )
^
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp:337:34: error: ‘const string {aka const class std::__cxx11::basic_string}’ has no member named ‘back’
if ( path.back() == '/' || path.back() == '\' )
^
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp: In static member function ‘static bool JsusFxPathLibrary_Basic::fileExists(const string&)’:
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp:344:27: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(const string&)’
std::ifstream is(filename);
^
In file included from /home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp:46:0:
/usr/include/c++/5/fstream:495:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/5/fstream:495:7: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const char*’
/usr/include/c++/5/fstream:481:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/5/fstream:481:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/5/fstream:455:11: note: candidate: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/5/fstream:455:11: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const std::basic_ifstream&’
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp: In member function ‘virtual bool JsusFxPathLibrary_Basic::resolveImportPath(const string&, const string&, std::__cxx11::string&)’:
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp:358:35: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11
for ( std::string & searchPath : searchPaths ) {
^
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp: In member function ‘virtual std::istream* JsusFxPathLibrary_Basic::open(const string&)’:
/home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp:377:48: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(const string&)’
std::ifstream stream = new std::ifstream(path);
^
In file included from /home/shree/Documents/Pd/jsusfx/src/jsusfx.cpp:46:0:
/usr/include/c++/5/fstream:495:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/5/fstream:495:7: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const char*’
/usr/include/c++/5/fstream:481:7: note: candidate: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/5/fstream:481:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/5/fstream:455:11: note: candidate: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/5/fstream:455:11: note: no known conversion for argument 1 from ‘const string {aka const std::__cxx11::basic_string}’ to ‘const std::basic_ifstream&’
/home/shree/Documents/Pd/jsusfx/src/CMakeFiles/jsusfx.dir/build.make:66: recipe for target '/home/shree/Documents/Pd/jsusfx/src/CMakeFiles/jsusfx.dir/jsusfx.cpp.o' failed
make[2]: *** [/home/shree/Documents/Pd/jsusfx/src/CMakeFiles/jsusfx.dir/jsusfx.cpp.o] Error 1
CMakeFiles/Makefile2:122: recipe for target '/home/shree/Documents/Pd/jsusfx/src/CMakeFiles/jsusfx.dir/all' failed
make[1]: *** [/home/shree/Documents/Pd/jsusfx/src/CMakeFiles/jsusfx.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
While going through documentation and trying to get some filters to work, I notices 'samplesblock' was missing. I do see a similar variable, 'blockPerSample', but this name doesn't appear in the documentation.
See https://www.reaper.fm/sdk/js/vars.php
I wonder.. shouldn't 'blockPerSample' just be renamed 'samplesblock'?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.