hey, i've made a small update yesterday. (0.4.0 out of beta now btw)
converting a fx into module is quite easy since the original code is already there. just use an empty module as a template... you can also use the jesusonic ide to develop modules, which will ensure that a module is jesusonic compatible (and debugged properly).
** there are only two important things here:
- declaring *all* used variables. to see a complete list of variables you can look at the list in the debugger in jesusonic's ide.
- linking all input/output variables to directives (@slider, @sample etc).
this means that if the modules has audio input then perhaps you should declare the input variable as 'input[sample]'
check the example below ('3band splitter' by LOSER / included as 'bandsplitter3way.jsmod') for a quick before/after comparison. i think i've spend around 10 minutes converting this one.
original:
Code:
// (C) 2006, Michael Gruhn.
// NO WARRANTY IS GRANTED. THIS PLUG-IN IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
// WARRANTY OF ANY KIND. NO LIABILITY IS GRANTED, INCLUDING, BUT NOT LIMITED TO,
// ANY DIRECT OR INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGE ARISING
// OUT OF THE USE OR INABILITY TO USE THIS PLUG-IN, COMPUTER FAILTURE OF
// MALFUNCTION INCLUDED. THE USE OF THE SOURCE CODE, EITHER PARTIALLY OR IN
// TOTAL, IS ONLY GRANTED, IF USED IN THE SENSE OF THE AUTHOR'S INTENTION, AND
// USED WITH ACKNOWLEDGEMENT OF THE AUTHOR. FURTHERMORE IS THIS PLUG-IN A THIRD
// PARTY CONTRIBUTION, EVEN IF INCLUDED IN REAPER(TM), COCKOS INCORPORATED OR
// ITS AFFILIATES HAVE NOTHING TO DO WITH IT. LAST BUT NOT LEAST, BY USING THIS
// PLUG-IN YOU RELINQUISH YOUR CLAIM TO SUE IT'S AUTHOR, AS WELL AS THE CLAIM TO
// ENTRUST SOMEBODY ELSE WITH DOING SO.
desc:3-Band Splitter (Splits In Low:CH1+2,Mid:CH3+4,High:CH5+6)
slider1:200<0,22000,1>Frequency (Hz)
slider2:2000<0,22000,1>Frequency (Hz)
@init
cDenorm=10^-30;
@slider
freqHP = max(min(slider2,srate),slider4);
xHP = exp(-2.0*$pi*freqHP/srate);
a0HP = 1.0-xHP;
b1HP = -xHP;
freqLP = min(min(slider1,srate),slider2);
xLP = exp(-2.0*$pi*freqLP/srate);
a0LP = 1.0-xLP;
b1LP = -xLP;
@sample
s0 = spl0;
s1 = spl1;
spl0 = (tmplLP = a0LP*s0 - b1LP*tmplLP + cDenorm);
spl1 = (tmprLP = a0LP*s1 - b1LP*tmprLP + cDenorm);
spl4 = s0 - (tmplHP = a0HP*s0 - b1HP*tmplHP + cDenorm);
spl5 = s1 - (tmprHP = a0HP*s1 - b1HP*tmprHP + cDenorm);
spl2 = s0 - spl0 - spl4;
spl3 = s1 - spl1 - spl5;
module:
Code:
// --------------------------
// from 3-Band Splitter
// by Michael Gruhn (c) 2006
//
// NO WARRANTY IS GRANTED. THIS PLUG-IN IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
// WARRANTY OF ANY KIND. NO LIABILITY IS GRANTED, INCLUDING, BUT NOT LIMITED TO,
// ANY DIRECT OR INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGE ARISING
// OUT OF THE USE OR INABILITY TO USE THIS PLUG-IN, COMPUTER FAILTURE OF
// MALFUNCTION INCLUDED. THE USE OF THE SOURCE CODE, EITHER PARTIALLY OR IN
// TOTAL, IS ONLY GRANTED, IF USED IN THE SENSE OF THE AUTHOR'S INTENTION, AND
// USED WITH ACKNOWLEDGEMENT OF THE AUTHOR. FURTHERMORE IS THIS PLUG-IN A THIRD
// PARTY CONTRIBUTION, EVEN IF INCLUDED IN REAPER(TM), COCKOS INCORPORATED OR
// ITS AFFILIATES HAVE NOTHING TO DO WITH IT. LAST BUT NOT LEAST, BY USING THIS
// PLUG-IN YOU RELINQUISH YOUR CLAIM TO SUE IT'S AUTHOR, AS WELL AS THE CLAIM TO
// ENTRUST SOMEBODY ELSE WITH DOING SO.
// --------------------------
//#mspr
//#inputs: in[sample], f0[block], f1[block]
//#outputs: out0[sample],out1[sample],out2[sample]
//#declare: xHP, a0HP, b1HP, xLP, a0LP, b1LP
//#declare: f0old, f1old, s0, tmplLP, tmplHP
//#mspr
//#mspr
@init
// 3-Band Splitter
f0 = 200;
f1 = 2000;
//#mspr
@slider
//#mspr
@sample
// 3-Band Splitter
out0 = (tmplLP = a0LP*in - b1LP*tmplLP);
out2 = in - (tmplHP = a0HP*in - b1HP*tmplHP);
out1 = in - out0 - out2;
//#mspr
@block
// 3-Band Splitter
(f0old != f0) ? (
xHP = exp(-2.0*$pi*f0/srate);
a0HP = 1.0-xHP;
b1HP = -xHP;
f0old = f0;
);
(f1old != f1) ? (
xLP = exp(-2.0*$pi*f1/srate);
a0LP = 1.0-xLP;
b1LP = -xLP;
f1old = f1;
);
//#mspr
@gfx
//#mspr
@serialize
Wow this is cool! I've not checked exactly what modules there are, but I'll look forward to when it's possible to port over some Pluggos! That would be a fun project.
* fixed a bug in the drag & drop connections
+ added support for the new js function slider_automate(x) in the parser
+ added the slider_automate(x) function in gfx slider modules
+ separate 'Version.as' and 'Copyright.as' classes to describe both online and
AIR version
I've testing jsfxgen and I have problems with the generated source. The problem is the order.
hi pylorca,
this particular bit is not very well documented, but:
the "slider" module outputs values between 0 and 1
and the module "die_lp6" that you are using as a modification, accepts frequency values in hertz...
so basically the filter is fed with a frequency of less than 1 hz or equal.
you need some sort of a mapping for the filter to work correctly, so between the slider control and the filter insert the module called "float_to_freq"
it will basically map the range of 0-1 as a float to 20-20000 hz.
[slider 0-1] -> [float_to_freq] -> [lp filter frequency control]
yes, you are right, but I was referring to something else.
The order of the modules in generated source. The order in "generated source" follows the ID of the module.
If I add _input(id=0), then _output(id=1), then _lp6(id=2) the code generated looks in this order:
Code:
mod 0 INPUT code
mod 1 OUPUT code
mod 2 LP code
when it should be
Code:
mod 0 INPUT code
mod 2 LP code
mod 1 OUPUT code
PS: sorry for my bad english
i see,
this is more of a missing feature than a bug, as the routing order simply follows the module id list.
i have no plans of adding this improvement since the current trade off is just an one sample delay and considering that all variables in modules are unique the delay itself cannot get to more than one sample...
there are various ways to write such a rearrange algorithm, but without the
user interaction of manually entering an exact order, it will be more or less a guessing game and the eventual one sample delay may still pop out for more complex routings.
I have some trouble with JSfxGEN (AIR Version) under Mac OSX 10.6.5 64bit :
When I try to save a project, the programm say "saving" and nothin happens. The progamm don't crashs but I have no possibility to use it ... and there is no save-file.
Similiar thing : When I generate a JS and try to export, the programm don't create a output-file (no crash, I see the dialog closing and everything seems to be normal).
I think it's a user-error but maybe you have a hint for me
I have some trouble with JSfxGEN (AIR Version) under Mac OSX 10.6.5 64bit :
When I try to save a project, the programm say "saving" and nothin happens. The progamm don't crashs but I have no possibility to use it ... and there is no save-file.
Similiar thing : When I generate a JS and try to export, the programm don't create a output-file (no crash, I see the dialog closing and everything seems to be normal).
I think it's a user-error but maybe you have a hint for me
Thanks,
Tom
hi duke64,
there is some sort of a security issue with linux as well.
try downloading the latest .air build.
the save/load/export dialog will still open to ask for a filename but on osx, linux or unix it will be only possible to work in the application storage folder (even if another location is chosen):
OSX: /Users/USERNAME/Library/Preferences/APP_NAME
Linux (ubuntu): /users/USERNAME/.appdata/APP_NAME
note: the new flash player 10 api now supports direct local file access from a swift (.swf) which was pretty much the _only_ reason i've used air packages.
I downloaded the last air release (0.4.3 I guess).
But I don't find a jsfxgen-folder in the preferecnces folder (I try the username library and the system library).
For a test, I try to save a project within the .app file (where you can find the testproject).
On my PC everything works fine and I can say : nice work, thanks!
the latest build should be 0.4.7.
the storage folder should be created when you run the program and try to save or export.
also the save/open/export dialog should always by default navigate to the storage folder.
i don't have a mac/osx to test this update, but with 0.4.7 its now working ok on linux.
Don't ask ... yesterday I downloaded and used the 0.4.6 version (not 4.3).
After a new download it's version 0.4.7 and save/export works within the preferences folder.
Independent of the selected folder, the tool saves projects in "generatedfx" and export-js or modules in "modules".
Anyway, it works
__________________ Soundemote - Home of the chaosfly and pretty oscilloscope. MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
__________________ Soundemote - Home of the chaosfly and pretty oscilloscope. MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template