Git Product home page Git Product logo

ysfx's Introduction

ysfx

Hosting library and audio plugin for JSFX

capture

Description

This package provides support for audio and MIDI effects developed with the JSFX language. These effects exist in source code form, and they are compiled and ran natively by hosting software.

This contains a hosting library, providing a JSFX compiler and runtime. In addition, there is an audio plugin which can act as a JSFX host in a digital audio workstation.

Remarks

Despite what the name might suggest, JSFX is not JavaScript. These technologies are unrelated to each other.

This project is not the work of Cockos, Inc; however, it is based on several free and open source components from the WDL. Originally, this project was based on jsusfx by Pascal Gauthier, but then it became an entire rewrite made from scratch.

Some time after the realization of this project, Cockos announced the release of JSFX as open source under the LGPL. This does not affect the development of this project, which remains a custom implementation based on the liberally licensed bits of the WDL.

Usage notes

The audio plugin will initially present the JSFX effects available in the REAPER user folders, if these exist.

The effects are source code files which end with the extension .jsfx, or with no extension at all.

Note that, unlike REAPER, ysfx will let you install JSFX wherever you want. If you use effects from a custom folder, ysfx will usually figure things out, but not always.

The ideal hierarchy is one where there exists at least a pair of folders named "Effects" and "Data" side-by-side, which receive the code files and resource files respectively.

Example:

  • My JSFX/Effects/guitar/amp-model
  • My JSFX/Data/amp_models/Marshall JCM800 - Marshall Stock 70.wav

Download development builds

Building

To build the project, one must first set up a C++ development environment equipped with Git and CMake. One can then build the library and the audio plugin, by entering commands as follows:

git clone https://github.com/jpcima/ysfx.git
cd ysfx
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
cmake --build .

JSFX resources

Great free and open-source effects:

ysfx's People

Contributors

jpcima avatar yurivict avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ysfx's Issues

PluginParameterChanged event not raised for many paramters

I've noticed that for many parameters on different plugins that there is no change event which is raised when the parameter is modified by the user. I've been reviewing the code trying to understand if this is intentional or a bug but I'm still not sure - I believe it has to do with slider type. This is important for my use of the YSFX library so that I can react to the user changes as the plugin host

Examples:

I'd be happy to make the changes on my side if you could advise and point me in the right direction.

Thanks!

Atomic slider change bits

The slider functions are valid to call from @gfx.

  • make the operation atomic.
  • handle the reset of change bits properly
  • change API as necessary

API checklist

Simple math functions

  • sin(angle)
  • cos(angle)
  • tan(angle)
  • asin(x)
  • acos(x)
  • atan(x)
  • atan2(x,y)
  • sqr(x)
  • sqrt(x)
  • pow(x,y)
  • exp(x)
  • log(x)
  • log10(x)
  • abs(x)
  • min(x,y)
  • max(x,y)
  • sign(x)
  • rand(x)
  • floor(x)
  • ceil(x)
  • invsqrt(x)

Time functions

  • time([v])
  • time_precise([v])

Special variables

  • spl0, spl1 ... spl63
  • spl(channelindex)
  • slider1, slider2, ... slider64
  • slider(sliderindex)
  • slider_next_chg(sliderindex,nextval)
  • trigger
  • srate
  • num_ch
  • samplesblock
  • tempo
  • play_state
  • play_position
  • beat_position
  • ts_num
  • ts_denom
  • ext_noinit
  • ext_nodenorm
  • reg00-reg99
  • _global.*
  • pdc_delay
  • pdc_bot_ch, pdc_top_ch
  • pdc_midi

MIDI functions

  • midisend(offset,msg1,msg2)
  • midisend(offset,msg1,msg2 + (msg3 * 256))
  • midisend(offset,msg1,msg2,msg3)
  • midisend_buf(offset,buf, len)
  • midisend_str(offset,string)
  • midirecv(offset,msg1,msg23)
  • midirecv(offset,msg1,msg2,msg3)
  • midirecv_buf(offset,buf, maxlen)
  • midirecv_str(offset, string)
  • midisyx(offset,msgptr,len)
  • ext_midi_bus
  • midi_bus

File I/O and Serialization

  • file_open(index or slider)
  • file_close(handle)
  • file_rewind(handle)
  • file_var(handle,variable)
  • file_mem(handle,offset, length)
  • file_avail(handle)
  • file_riff(handle,nch,samplrate)
  • file_text(handle,istext)
  • file_string(handle,str)

Memory/Slider/FFT/MDCT Functions

  • mdct(start_index, size), imdct(start_index, size)
  • fft(start_index, size), ifft(start_index, size)
  • fft_real(start_index, size), ifft_real(start_index, size)
  • fft_permute(index,size), fft_ipermute(index,size)
  • convolve_c(dest,src,size)

Memory Utility

  • freembuf(top)
  • memcpy(dest,source,length)
  • memset(dest,value,length)
  • __memtop()

Stack

  • stack_push(value)
  • stack_pop(value)
  • stack_peek(index)
  • stack_exch(value)

Slider Functions

  • sliderchange(mask or sliderX)
  • slider_automate(mask or sliderX)
  • slider_show(mask or sliderX[, value])

Atomic Variable Access

  • atomic_setifequal(dest,value,newvalue)
  • atomic_exch(val1,val2)
  • atomic_add(dest_val1,val2)
  • atomic_set(dest_val1,val2)
  • atomic_get(val)

Pin Mapper Functions

  • get_host_numchan()
  • set_host_numchan(numchan)
  • get_pin_mapping(inout,pin,startchan,chanmask)
  • set_pin_mapping(inout,pin,startchan,chanmask,mapping)
  • get_pinmapper_flags(no parameters)
  • set_pinmapper_flags(flags)

String functions

  • strlen(str)
  • strcpy(str, srcstr)
  • strcat(str, srcstr)
  • strcmp(str, str2)
  • stricmp(str, str2)
  • strncmp(str, str2, maxlen)
  • strnicmp(str, str2, maxlen)
  • strncpy(str, srcstr, maxlen)
  • strncat(str, srcstr, maxlen)
  • strcpy_from(str,srcstr, offset)
  • strcpy_substr(str,srcstr, offset, maxlen)
  • str_getchar(str, offset[, type])
  • str_setchar(str, offset, value[, type])
  • strcpy_fromslider(str, slider)
  • sprintf(str,format, ...)
  • match(needle, haystack, ...)
  • matchi(needle, haystack, ...)

Graphics

  • gfx_set(r[g,b,a,mode,dest])
  • gfx_lineto(x,y,aa)
  • gfx_line(x,y,x2,y2[,aa])
  • gfx_rectto(x,y)
  • gfx_rect(x,y,w,h)
  • gfx_setpixel(r,g,b)
  • gfx_getpixel(r,g,b)
  • gfx_drawnumber(n,ndigits)
  • gfx_drawchar($'c')
  • gfx_drawstr(str[,flags,right,bottom])
  • gfx_measurestr(str,w,h)
  • gfx_setfont(idx[,fontface, sz, flags])
  • gfx_getfont()
  • gfx_printf(str, ...)
  • gfx_blurto(x,y)
  • gfx_blit(source, scale, rotation)
  • gfx_blit(source, scale, rotation[, srcx, srcy, srcw, srch, destx, desty, destw, desth, rotxoffs, rotyoffs])
  • gfx_blitext(source, coordinatelist, rotation)
  • gfx_getimgdim(image, w, h)
  • gfx_setimgdim(image, w,h)
  • gfx_loadimg(image, filename)
  • gfx_gradrect(x,y,w,h, r,g,b,a[, drdx, dgdx, dbdx, dadx, drdy, dgdy, dbdy, dady])
  • gfx_muladdrect(x,y,w,h, mul_r, mul_g, mul_b[, mul_a, add_r, add_g, add_b, add_a])
  • gfx_deltablit(srcimg,srcx,srcy,srcw,srch, destx, desty, destw, desth, dsdx, dtdx, dsdy, dtdy, dsdxdy, dtdxdy[, usecliprect=1] )
  • gfx_transformblit(srcimg, destx, desty, destw, desth, div_w, div_h, table)
  • gfx_circle(x,y,r[,fill,antialias])
  • gfx_roundrect(x,y,w,h,radius[,antialias])
  • gfx_arc(x,y,r, ang1, ang2[,antialias])
  • gfx_triangle(x1,y1,x2,y2,x3,y3[,x4,y4,...])
  • gfx_getchar([char])
  • gfx_showmenu("str")
  • gfx_setcursor(resource_id[,"custom cursor name"])
  • gfx_getdropfile(idx[,#str]) (not documented in JSFX)
  • gfx_r, gfx_g, gfx_b, gfx_a
  • gfx_w, gfx_h
  • gfx_x, gfx_y
  • gfx_mode
  • gfx_clear
  • gfx_dest
  • gfx_texth
  • gfx_ext_retina (lib OK, plugin needs work)
  • mouse_x
  • mouse_y
  • mouse_cap
  • mouse_wheel
  • mouse_hwheel

Plugin is with executable stack.

Hi,

I'm not sure is it a real problem or not, but openSUSE build server complains on building that .so has a executable stack. I think it was started after b1921b6

The build log: https://build.opensuse.org/package/live_build_log/home:kill_it:JUCE/ysfx/openSUSE_Tumbleweed/x86_64
The error message:

[  165s] lv2-ysfx.x86_64: E: executable-stack (Badness: 10000) /usr/lib64/lv2/ysfx.lv2/ysfx.so
[  165s] vst-ysfx.x86_64: E: executable-stack (Badness: 10000) /usr/lib64/vst/libysfx.so
[  165s] vst3-ysfx.x86_64: E: executable-stack (Badness: 10000) /usr/lib64/vst3/ysfx.vst3/Contents/x86_64-linux/ysfx.so
[  165s] The binary declares the stack as executable. Executable stack is usually an
[  165s] error as it is only needed if the code contains GCC trampolines or similar
[  165s] constructs which uses code on the stack. One common source for needlessly
[  165s] executable stack cases are object files built from assembler files which don't
[  165s] define a proper .note.GNU-stack section.

Distro packages

Hi,

not really an issue but I made a package for archlinux: https://aur.archlinux.org/packages/ysfx-git ; maybe it can be useful to others who come across here and go in the readme or something.

cheers ! (and if you see anything that needs fixing / improving in the package, please tell me :-))

Windows, MinGW GCC: `WDL/win32_utf8.c:803:5: error: conflicting types for 'statUTF8'; have 'int(const char *, struct stat *)'`

Not your problem, but documenting just in case others run into this
The duct-tape fix is to change the definition in win32_utf8.c to use struct _stat64 instead of struct stat

====================[ Build | eel2 | RelWithDebInfo-MinGW ]=====================
C:\Users\rayga\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe --build C:\Users\rayga\Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw --target eel2
[0/2] C:\Users\rayga\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -P C:\Users\rayga\Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw\CMakeFiles\VerifyGlobs.cmake
[1/2] C:\msys64\ucrt64\bin\cc.exe -DEELSCRIPT_NO_LICE -DEELSCRIPT_NO_NET -DNSEEL_ATOF=nseel_atof -DWDL_FFT_REALSIZE=8 -D_FILE_OFFSET_BITS=64 -IC:/Users/rayga/Projects/tmp/ysfx/thirdparty/WDL/source -O2 -g -DNDEBUG -fvisibility=hidden -Wall -MD -MT CMakeFiles/eel2.dir/thirdparty/WDL/source/WDL/win32_utf8.c.obj -MF CMakeFiles\eel2.dir\thirdparty\WDL\source\WDL\win32_utf8.c.obj.d -o CMakeFiles/eel2.dir/thirdparty/WDL/source/WDL/win32_utf8.c.obj -c C:/Users/rayga/Projects/tmp/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c
FAILED: CMakeFiles/eel2.dir/thirdparty/WDL/source/WDL/win32_utf8.c.obj 
C:\msys64\ucrt64\bin\cc.exe -DEELSCRIPT_NO_LICE -DEELSCRIPT_NO_NET -DNSEEL_ATOF=nseel_atof -DWDL_FFT_REALSIZE=8 -D_FILE_OFFSET_BITS=64 -IC:/Users/rayga/Projects/tmp/ysfx/thirdparty/WDL/source -O2 -g -DNDEBUG -fvisibility=hidden -Wall -MD -MT CMakeFiles/eel2.dir/thirdparty/WDL/source/WDL/win32_utf8.c.obj -MF CMakeFiles\eel2.dir\thirdparty\WDL\source\WDL\win32_utf8.c.obj.d -o CMakeFiles/eel2.dir/thirdparty/WDL/source/WDL/win32_utf8.c.obj -c C:/Users/rayga/Projects/tmp/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c

C:/Users/rayga/Projects/tmp/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c: At top level:
C:/Users/rayga/Projects/tmp/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c:803:5: error: conflicting types for 'statUTF8'; have 'int(const char *, struct stat *)'
  803 | int statUTF8(const char *filename, struct stat *buffer)
      |     ^~~~~~~~

In file included from C:/Users/rayga/Projects/tmp/ysfx/thirdparty/WDL/source/WDL/win32_utf8.c:6:
C:/Users/rayga/Projects/tmp/ysfx/thirdparty/WDL/source/WDL/win32_utf8.h:64:25: note: previous declaration of 'statUTF8' with type 'int(const char *, struct _stat64 *)'
   64 | WDL_WIN32_UTF8_IMPL int statUTF8(const char *filename, struct stat *buffer);
      |                         ^~~~~~~~

ninja: build stopped: subcommand failed.

How to use external VST and JUCE packages?

Bundled VST3 breaks:

In file included from /disk-samsung/freebsd-ports/audio/ysfx/work/.build/_deps/juce-src/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp:42:
/disk-samsung/freebsd-ports/audio/ysfx/work/.build/_deps/juce-src/modules/juce_audio_processors/format_types/juce_VST3Headers.h:29:3: error: To build JUCE VST3 plug-ins on BSD you must use an external BSD-compatible VST3 SDK with JUCE_CUSTOM_VST3_SDK=1
 #error To build JUCE VST3 plug-ins on BSD you must use an external BSD-compatible VST3 SDK with JUCE_CUSTOM_VST3_SDK=1
  ^

This problem is definitely solved in the VST3 port.

How to use external packages?
vst3sdk-3.7.4.b.25
juce-6.0.8_4

FreeBSD 13.1

Unable to build: error C3646: 'effect': unknown override specifier

I receive several "Unable to build: error C3646: 'effect': unknown override specifier" when attempting to build after a fresh clone on my win 10 machine. This happens right after cmake --build .

D:\BeatConnect\Plugin\ysfx\plugin\info.h(23,18): error C3646: 'effect': unknown override specifier (compiling source fi
le D:\BeatConnect\Plugin\ysfx\plugin\editor.cpp) [D:\BeatConnect\Plugin\ysfx\build\ysfx_plugin.vcxproj]
D:\BeatConnect\Plugin\ysfx\plugin\info.h(23,18): error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int (compiling source file D:\BeatConnect\Plugin\ysfx\plugin\editor.cpp) [D:\BeatConnect\Plugin\ysfx\bu
ild\ysfx_plugin.vcxproj]
D:\BeatConnect\Plugin\ysfx\plugin\editor.cpp(130,30): error C2039: 'effect': is not a member of 'YsfxInfo' [D:\BeatConn
ect\Plugin\ysfx\build\ysfx_plugin.vcxproj]

Slider syntax

Instead of waiting for more typos in other peoples code,
I tried to do it all wrong myself and share the results here
hoping it is somewhat helpful.

All the following examples compile and show in reaper.

These are 10 identical sliders:

slider1:official=0<-150,12,1>official
slider2:0<-150,12,1>official no var.name
slider3:=0<-150,12,1>=value
slider4:<-150,12,1>no default
slider5:0<-150,12,1,,,>toomanycommas
slider6:0<-150,12,1,2,3,4>toomanyvalues
slider7:0time<-150kilo,12uhr,1euro>strings
slider8:0*2<-150-151,12=13,1+3>math?
slider9:+/-0a0<-150<<-149<,12...13,1 3><v<<al..u e>
slider10:a1?+!%&<-150%&=/?+!,12!%/&?+=,1=/?+!%&>?+!%&=/

What (i think) i see is

  • default_value: Falls back to zero if value is nonsense ,empty var.
    or non existant (=value is allowed here).
  • <min,max,increment> : If field starts with valid value,
    reaper takes that and ignores the rest.
  • " and ' are a problem if not closed.
    You can < multiple times but > only once.
    You can't open with <<.
  • Additional subsequent fields are ignored.

If fields are empty:

//(if either min or max >=10 then increment=0.1 (for following 3 examples))

slider11:<-6>   //-> 0<-6,0,0.01>
slider12:<,6>   //-> 0<0,6,0.01>
slider13:<6,>   //-> 0<6,0,0.01>

slider14:<3,,>   //-> 0<3,0,0>
slider15:<,3,>   //-> 0<0,3,0>
slider16:<3,,1>  //-> 0<3,0,1>
slider17:<,3,1>  //-> 0<0,3,1>

//all nonsense -> all zero:
slider18:a1<b2,c3,d4>  //-> 0<0,0,0> (without string here, its not accessible)

Similar for menu slider:

  • increment is always 1 as long as there are 2 commas.
  • min/max values don't matter, the number is defined by the {L,I,S,T}
slider20:0<0,5,1{0,1,2,3,4,5}>official menu
slider21:<,,{0,1,2,3,4,5}>empty fields
slider22:0<0.2,64,12{0,1,2,3,4,5}>wrong values
slider23:0<0?,<5a<,b1c<{0,1,2,3,4,5}><?abc

That's what I found so far.

Support 32-bit float

This would speed up signal processing on ARM machines (by @falkTX's request)
This needs to write the ASM equivalents and possibly it's not difficult at all.

(currently I don't have a machine at hand that lets me test this)

Fails to build on arm64

Due to some WDL things, build error being:

thirdparty/WDL/source/WDL/wdltypes.h:203:69: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing]
  203 | typedef char wdl_assert_failed_unsigned_char[((char)-1) > 0 ? -1 : 1];
      |                                                                     ^
thirdparty/WDL/source/WDL/wdltypes.h:203:61: error: size '-1' of array 'wdl_assert_failed_unsigned_char' is negative
  203 | typedef char wdl_assert_failed_unsigned_char[((char)-1) > 0 ? -1 : 1];
      |                                              ~~~~~~~~~~~~~~~^~~~~~~~

Compatibility with older linuces

On CentOS 7 I'm facing:

target_compile_definitions(ysfx-private
    PRIVATE
        "_FILE_OFFSET_BITS=64")

which makes the build fail with:

[ 98%] Building CXX object CMakeFiles/ysfx-private.dir/sources/ysfx_eel_utils.cpp.o
In file included from /image/ysfx/sources/ysfx_utils.cpp:31:
/usr/include/fts.h:41:3: error: "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
# error "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64"
  ^

Do you think I can safely comment that on that platform ? Or I should just update to a system with a more recent fts.h ? (if so, if you know what would be the minimal requirement..)

Buffer overflow in ysfx_preset

When testing on Win32 MSVC 2022 x64 build in Debug mode (and thus with std::vector assertions, etc):

image

As you can see, it tries to access data[pos] for pos == 482 when data.size() == 482, which is definitely not ok.

I'm not sure what should happen in that case though : from the comment it seems that it's expected than data would contain additional data.

CMake build fails with: `Checksum invalid: asm-nseel-x64-sse.asm`

I suppose maybe I am supposed to regenerate the SHA or something?
Unsure why this would happen on first build, as I haven't touched anything though.

Compiled with MinGW GCC 11 on Windows 11

====================[ Build | eel2 | RelWithDebInfo-MinGW ]=====================
CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe --build Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw --target eel2
[0/2] CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -P Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw\CMakeFiles\VerifyGlobs.cmake
[1/12] cmd.exe /C "cd /D Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw && CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -DSOURCE_FILE=Projects/tmp/ysfx/thirdparty/WDL/source/WDL/eel2/asm-nseel-x64-sse.asm -DCHECKSUM_FILE=Projects/tmp/ysfx/sources/eel2-gas/sources/ref-hash-sha512.txt -P Projects/tmp/ysfx/cmake/ValidateSHA512.cmake && CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -E touch Projects/tmp/ysfx/cmake-build-relwithdebinfo-mingw/eel2-gas-validate-stamp.txt"
FAILED: eel2-gas-validate-stamp.txt Projects/tmp/ysfx/cmake-build-relwithdebinfo-mingw/eel2-gas-validate-stamp.txt 
cmd.exe /C "cd /D Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw && CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -DSOURCE_FILE=Projects/tmp/ysfx/thirdparty/WDL/source/WDL/eel2/asm-nseel-x64-sse.asm -DCHECKSUM_FILE=Projects/tmp/ysfx/sources/eel2-gas/sources/ref-hash-sha512.txt -P Projects/tmp/ysfx/cmake/ValidateSHA512.cmake && CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -E touch Projects/tmp/ysfx/cmake-build-relwithdebinfo-mingw/eel2-gas-validate-stamp.txt"
CMake Error at Projects/tmp/ysfx/cmake/ValidateSHA512.cmake:31 (message):
  Checksum invalid: asm-nseel-x64-sse.asm
  ('aa5896ad4860cba62ec3450b55221f4985db4f79d83fc14dadd2f2aceae87cdfd8645f35160bf47bb7700046e3ecdd892aa74639130b910598ddb70515787ed8'
  !=
  'd4a4d8bf4d906f6a6cdbe54bc8a2699e01a11e1109a716c696fc3df96046422a71aea29ff643db4b23cf2b29a3ccd8dbb309a14bab327f13d7f2be461463bc02')


ninja: build stopped: subcommand failed.

Keyboard input

Notes on how to process keyboard input.

ysfx_gfx_input(uint32_t mod, uint32_t key)

  • mod is the modifiers bits ; it recognizes Ctrl and Alt
  • key is unicode, and also can be a special key from an enumeration, whose values are in the unicode private use area (note: check pugl keys)

The values are pushed to a queue in the gfx state.
The internal mapping is like this:

  • if it's a special key, it's converted to one of JSFX's multichar equivalents ('up', 'down' etc)
  • if it's a regular key "a-z"/"A-Z" and it has mods, convert that value into another range
    (Alt: 321-346, Ctrl: 1-26, Ctrl+Alt: 257-282)
  • if it's a regular key otherwise, and it's >=1 and <256, push the value as is

Other

  • Ctrl/Alt presses aren't reported, they are modifier only

Hi, this is really amazing!

I just built the vst3 which worked fine (linux)
the only step i found missing was the submodules which i got with
git submodule update --init --recursive
if you want to add it to the readme.

As probably expected some jsfx load and work, some don't.
Are you interested in testing feedback already or is it too early in the process?
Anyway very exciting!

Plugin crashes in Bitwig on linux

I downloaded the VST3 development build but it is crashing inside Bitwig 4.2 as soon as it is loaded. Bitwig's log says this:

About to start the following process:  /opt/bitwig-studio/bin/BitwigPluginHost-X64-SSE41 host Jean-Pierre-Cimalando-ysfx-17 48000 256 2015549-17 16 not-dpi-aware 8 jack jack 8814603
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Successfully set thread realtime priority to 50
Creating plugin audio thread proxy 0
PluginHost: Starting new audio thread for processing plugin 0
Successfully set thread realtime priority to 50
X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  20 (X_GetProperty)
  Resource id in failed request:  0x0
  Serial number of failed request:  54
  Current serial number in output stream:  54
Could not read async reply: End of stream
Sending a shutdown request to the plugin host
Error sending request to plug-in host: Error writing to named pipe: Broken pipe
Waiting for plugin host process to exit
Child process with PID 2020446 exited with error code: 1
Plugin host process exited with code: 256
Waiting for plugin host process to exit
Plugin host process exited with code: 256

I'm using Arch linux.

I/O pins

More on "everything is optional in jsfx"

  • If Input/Output pins are not mentioned at all, reaper will read and show this as js in/out,
    as long as there is @sample with something in it (and something can be anything)

jsio

example fx:
https://bitbucket.org/kawaCat/reascript-m2bpack/src/master/JSFX%20effects/kawa_Simple_Mid_Side.jsfx
https://github.com/JoepVanlier/JSFX/blob/master/SatanVerb/SatanVerb.jsfx
also a file with nothing in it but

@sample
hello

will have these I/O's

  • If only input pins are mentioned reaper reads output as "unmapped" (which you would have to explicitly "zero out" in reaper)

unmapped
example fx: almost all in /Reaper/Effects/analysis/

  • If only output pins are mentioned reaper will display this correctly
    but the effect still works...
    (no example for this one, I just commented out the in pins of an EQ)

  • And a completely empty file shows no I/O
    but still compiles and passes audio (as long as it has a filename and sits in the Effects folder)

All above examples currently don't output sound when loaded in the YSFX-plugin.

Slider visibility

The sliders which start with - are hidden by default.
This should not appear in the display name.
Also implement the slider_show API, and the change notification for slider visibility.

Gigperformer4 stalls when loading a 'gig' with ysfx

In Gigperformer a project is called a gig. When I load a gig with ysfx included as a plugin Gigperformer is stuck telling me it is trying to load ysfx. Loading a gig without ysxf and then adding it works normal. (But then, I want to save the gig, that succeeds, but loading does fail).

It does not matter whether ysxf has a script loaded or not.

This is on Windows 11, no cpu load from Gigperformer. Maybe some event, semaphore or deadlock?

FYI: Reaper exhibits the same behavior

srate is not in sync with the VST host

The sample rate of e.g. Reaper is not reflected in the system variable 'srate' in jsxf. When the sample rate is altered srate does also not reflect this change (not surprisingly).

Tested with GigPerformer 4.0 and Reaper 6.43. ysfx Plugin build was the developer build of Jan 5th, 2022.

BTW, amazing plugin. Is knew jsfx for use within Reaper and ReaJS for other VST host. The environment is Reaper is very nice, but proprietary, ReaJS is useful with other VST hosts, but rather limited (maximum of 2 audio channels, at least with GigPerformer) and kind of deprecated. All this is solved Ysfx. Thank you.

channel strip

Is there any possibility in the future to load fx by (slot, rack or channelstrip), to save chain presets in a single instance?..thanks in advance..

Build: dr_wav.h is missing

Linux Mint 20.2: followed yor build commands step by step
On the step:"cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .."
compilation terminates with:
ysfx_audio_wav.cpp:31:10: fatal error: dr_wav.h: File not found
i guess, it is the dr_libs; right?
https://github.com/mackron/dr_libs
So, what to do?

Options

  • gmem
  • want_all_kb
  • maxmem
  • no_meter

Breaks on FreeBSD: no matching function for call to 'fts_open'

sources/ysfx_utils_fts.cpp:43:16: error: no matching function for call to 'fts_open'
    FTS *fts = fts_open(argv, FTS_NOCHDIR|FTS_PHYSICAL, +compar);
               ^~~~~~~~
/usr/include/fts.h:131:6: note: candidate function not viable: no known conversion from 'auto (*)(const FTSENT **, const FTSENT **) -> int' (aka 'auto (*)(const _ftsent **, const _ftsent **) -> int') to 'int (*)(const FTSENT *const *, const FTSENT *const *)' (aka 'int (*)(const _ftsent *const *, const _ftsent *const *)') for 3rd argument
FTS     *fts_open(char * const *, int,
         ^
1 error generated.

From the fts_open manpage:

FTS(3)                 FreeBSD Library Functions Manual                 FTS(3)

NAME
     fts – traverse a file hierarchy

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <fts.h>

     FTS *
     fts_open(char * const *path_argv, int options,
         int (*compar)(const FTSENT * const *, const FTSENT * const *));

...

cmake.deps creates a dl target

This conflicts with the CMAKE_DL_LIBS variable: https://cmake.org/cmake/help/latest/variable/CMAKE_DL_LIBS.html

if another project uses CMAKE_DL_LIBS and includes ysfx, things may go awry due to dl now being a target:

CMake Error in 3rdparty/libossia/3rdparty/Servus/servus/CMakeLists.txt:
  export called with target "Servus_iface" which requires target "dl" that is
  not in any export set.


-- Generating done
CMake Error in 3rdparty/libossia/3rdparty/wiiuse/src/CMakeLists.txt:
  export called with target "wiiuse" which requires target "dl" that is not
  in any export set.

Doing no graphics in `@gfx`, stalls processing the full @gfx section

This is probably not a big issue and should not keep you from going to sleep sometimes (as far as I'm concerned):

When you have for example the following code in the @gfx section, processing of all code in that section stops. In this example gfx.debug will not increase:

@sample
gfx.debug_sample += 1;

@gfx
gfx.debug += 1;
 
// Uncomment this for letting things run 'normal'
/*
gfx_x=10;
gfx_y=10;
tmp=#;
sprintf(tmp,"Just to do something %d", gfx.debug);
gfx_drawstr(tmp);
*/

You can see in the editor whether gfx.debug and gfx.debug_sample (the last one will keep increasing) are increasing or not:
image

BTW: I'm not trying to find as many bugs as I can find and I'm also not implying they al must be fixed at once, but you people seem really determined to make this plugin a good plugin and therefore I will report what I run into. Maybe at some time I find the strength to set up an environment that I can compile this plugin myself and be a little more constructive. One can always hope...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.