Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xpressive plugin #3259

Merged
merged 32 commits into from
Jun 26, 2017
Merged

Xpressive plugin #3259

merged 32 commits into from
Jun 26, 2017

Conversation

gnudles
Copy link
Contributor

@gnudles gnudles commented Jan 14, 2017

xpressive
tresf added screenshot Feb 5 '17

Xpressive plugin allows you to write your own expressions for sound creation.

@AndiEcker
Copy link

AndiEcker commented Jan 17, 2017 via email

@zonkmachine
Copy link
Member

xpressive

😮 Totally tripping right now. It's so cool. Like if Bit Invader grew up and took classes in engineering.

@gnudles
Copy link
Contributor Author

gnudles commented Jan 18, 2017

What should be done with this error? :
/tmp/cc62tQLz.s: Fatal error: can't write CMakeFiles/xpressive.dir/exprfront.cpp.obj: File too big

@ArashPartow
Copy link
Contributor

ArashPartow commented Jan 18, 2017

What should be done with this error? :

The version of ld shipped with mingw64 is Literally Broken - last good version was circa GCC4.3. In short to get rid of the build error you need to do the following two things:

Step 1.
Add the following only to the mingw64 build options in CMake:

-Wa,-mbig-obj

Step 2.
In order to make the ExprTk TU section size smaller add the following defines either in the mingw64 CMake build line

-Dexprtk_disable_break_continue
-Dexprtk_disable_sc_andor
-Dexprtk_disable_enhanced_features
-Dexprtk_disable_string_capabilities
-Dexprtk_disable_rtl_io_file

Or #ifdef on mingw64 just prior to the #include "exprtk.hpp" and define

#define exprtk_disable_break_continue
#define exprtk_disable_sc_andor
#define exprtk_disable_enhanced_features
#define exprtk_disable_string_capabilities
#define exprtk_disable_rtl_io_file

I'd also review [Section 19 - Enabling & Disabling Features] of the documentation - specifically 19.2 Disabling Control-Flow Structures such as for-loop, while-loop etc. I'm guessing you don't want users invoking such functionality in their expressions.

Copy link
Contributor

@ArashPartow ArashPartow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've applied the defines to all compiler settings which is not what I suggested. It should only be applied to the mingw64 build

Furthermore you've applied the -Wa,-mbig-obj option to all mingw compilers it should only be the mingw64 compiler.

@gnudles
Copy link
Contributor Author

gnudles commented Jan 18, 2017

oops, I'll replace
IF(MINGW_PREFIX)
with
IF(WIN64)
I invoke the parser with:

	parser_t::settings_store sstore;
	sstore.disable_all_logic_ops();
	sstore.disable_all_assignment_ops();
	sstore.disable_all_control_structures();
	parser_t parser(sstore);

So I don't understand why these defines should be used only in a certain build. Furthermore, I added them to reduce build time.
I do want all the users to be able to use
(t>0)&(t<1)
I saw that using the flag exprtk_disable_sc_andor changes the implementation of the "&" and "|" signs.
I hope it's OK.

@tresf
Copy link
Member

tresf commented Jan 18, 2017

@ArashPartow Thanks for such specific insight into this issue. From what I'm reading, we can set Step 1 globally, right?

https:/LMMS/lmms/blob/master/cmake/modules/MinGWCrossCompile.cmake#L17-L22

, and

https:/LMMS/lmms/blob/master/cmake/modules/MinGWCrossCompile.cmake#L61-L67

@ArashPartow
Copy link
Contributor

ArashPartow commented Jan 18, 2017

I think it should be something like:

IF(MINGW_PREFIX and WIN64)

As WIN64 probably implies ALL windows 64 builds, perhaps including MSVC


Perhaps only assignment and loop control_structures as you might want if-statements/ternary-statements with logical operators to be made available:

parser_t::settings_store sstore;
sstore.disable_all_assignment_ops();
sstore.disable_control_structure(settings_t::e_ctrl_for_loop   );
sstore.disable_control_structure(settings_t::e_ctrl_while_loop );
sstore.disable_control_structure(settings_t::e_ctrl_repeat_loop);
parser_t parser(sstore);

So I don't understand why these defines should be used only in a certain build.

It's explained in my post above.


I do want all the users to be able to use
(t>0)&(t<1)
I saw that using the flag exprtk_disable_sc_andor changes the implementation of the "&" and "|" signs.

Yeah get rid of it from the build line. It wont save much for section size issues and it is probably better off to have it available/present.

@ArashPartow
Copy link
Contributor

ArashPartow commented Jan 18, 2017

@tresf Nothing should be global. All of this is related to a broken version of mingw64 - So all the changes must only be specific to 64-bit builds using mingw64 and no other compilers or architectures.

The build changes presented are a hack/kludge to reduce the section size of the TU so as to allow the broken ld that is shipped with mingw64 to build the final executable binary.

In short the defines disable certain features such as expression optimizations so as to reduce the section size, hence it is not an option one would want to add to all builds as it drastically retards the performance of the expression engine.

@tresf
Copy link
Member

tresf commented Jan 18, 2017

@tresf Nothing should be global. All of this is related to a broken version of mingw64 - So all the changes must only be specific to 64-bit builds using mingw64 and no other compilers or architectures.

Please look at the lines that are linked. #3259 (comment)

@ArashPartow
Copy link
Contributor

ArashPartow commented Jan 18, 2017

@tresf ooh yeah I missed this line:

https:/LMMS/lmms/blob/master/cmake/modules/MinGWCrossCompile.cmake#L10

Should be all good if it is only within that IF(LMMS_BUILD_MSYS) scope.

@tresf
Copy link
Member

tresf commented Jan 18, 2017

Should be all good if it is only within that IF(LMMS_BUILD_MSYS) scope.

Great but to be precise, I believe it needs to be for both scopes linked or moved into a separate conditional.

@ArashPartow
Copy link
Contributor

@tresf Now I'm confused. According to the build artifacts the 32-bit mingw build was successful however the 64-bit mingw build failed.

On line:

https:/LMMS/lmms/blob/master/cmake/modules/MinGWCrossCompile.cmake#L18

The "IF(WIN64)" seems to suggest 64-bit but the comments around and in the scope and the "COMPILER32" stuff seem to suggest 32-bit.

I'll let you guys figure it out. However you end up doing it my recommendation is that it should only apply to 64-bit builds using mingw64.

@tresf
Copy link
Member

tresf commented Jan 18, 2017

Correct, we explicitly build the 32-bit host wrapper on 64-bit. Naturally, the description would have to change if this were added.

@softrabbit
Copy link
Member

Actually, this shouldn't be (just) a plugin. @gnudles, could you get the expression evalution worked into the standard oscillator class(es)? That way it could be used in at least TripleOscillator or Organic as well, maybe some other plugin too.

(I haven't tried this plugin yet, but I like the idea.)

@gnudles
Copy link
Contributor Author

gnudles commented Jan 20, 2017

@softrabbit , I think that the next step is to create a sound scripting language, compile it with llvm (or some other jit engine) on runtime, and make a generic plug-in infrastructure... But then you need to add llvm to the dependency list...
@tresf what's the bottom line?
@zonkmachine - it's better to use integrate(f) instead of t*f because it stays stable with frequency change (with base detuning). integrate(f) holds internal counter that counts f and return the sum divided by sample_rate.

{
// store values in temporary array
QVector<float> temp = m_samples;
int graph_length = length();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const int graph_length = length();

}
int m_rseed;
};
}*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment to explain why this is commented would be better I guess.

const int data_size=sizeof(random_data)/sizeof(int);
int xi=(int)index;
int si=m_rseed%data_size;
int sa=m_rseed/data_size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const int xi = [...];
const int si = [...];
const int sa = [...];

{
return vec[ix];
}
int ixnext=(ix+1)%size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const int ixnext=(ix+1)%size;

//to disable interpolation uncomment:
//return static_cast<WaveSample*>(w)->samples[ix];

float xfrc=fraction(x);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const float xfrc=fraction(x);

ExprFront expr(text.constData());
float t,f=10,key=2,rel=0,v=0.5;
unsigned int i;
unsigned int sample_rate=m_raw_graph->length();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

float t;
const float f=10,key=2,rel=0,v=0.5;
unsigned int i;
const unsigned int sample_rate=m_raw_graph->length();

float t,f=10,key=2,rel=0,v=0.5;
unsigned int i;
unsigned int sample_rate=m_raw_graph->length();
expr.add_variable("t", t);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t not initialized ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works, but I'll initialize it for clarity.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, the value is set before it's evaluated...


static void clearGraph(graphModel * g)
{
int length = g->length();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const int length = g->length();

m_panning2.loadSettings(_this,"PAN2");
m_relTransition.loadSettings(_this,"RELTRANS");

int size = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure for this one, as I don't know the effect of the next function calls, but:

const int size = 0;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it that way...


float o1,o2,pn1,pn2;
float new_freq=nph->frequency();
float freq_inc=(new_freq-frequency)/_frames;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const float new_freq=nph->frequency();
const float freq_inc=(new_freq-frequency)/_frames;

@tresf
Copy link
Member

tresf commented Feb 5, 2017

Is this ready for merge?

@zonkmachine
Copy link
Member

Is this ready for merge?

I think it is.

I've seen a very minor issue. The presets are not saved with unique names. It's not obvious when you save a preset that the file name and the preset name isn't necessarily the same. One could argue that this is something we could change actually.

Copy link
Member

@zonkmachine zonkmachine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please re-save the pre-sets with their chosen names and not the default name="X-Pressive"

<!DOCTYPE lmms-project>
<lmms-project version="1.0" creator="LMMS" creatorversion="1.2.0-rc2.6" type="instrumenttracksettings">
<head/>
<instrumenttracksettings muted="0" type="0" name="X-Pressive" solo="0">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name="X-Pressive"

The preset name that shows up when you load an instrument isn't the name of the .xpf but this setting. You need to edit the name in the rename dialogue on the top of the plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tell you the truth, I'm not sure that those presets should be merge. And even if they do, I think they should have more meaningful naming... I'm not so good at naming sounds so... if someone volunteers...
Also if someone made nice presets which he wants them to be merged...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user will want to have some good presets to look at for this one. In any case I don't think this should hold back a merge. You or someone else can tweak the names later and it's easier for people to try it out and make presets if it's merged anyway.

@zonkmachine zonkmachine dismissed their stale review February 8, 2017 14:20

Can be fixed later

@gnudles
Copy link
Contributor Author

gnudles commented Feb 8, 2017

Oh BTW, what's the best way for a plugin to deallocate memory on shut-down? Because I need to deallocate the help window.

Copy link
Member

@jasp00 jasp00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although this is work in progress, you should start following the coding conventions.

It is required to include the Boost Software License.

{
Q_OBJECT
public:
static expressiveHelpView *getInstance()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the best way for a plugin to deallocate memory on shut-down?

We should add some construction and destruction methods for plug-ins. In the meantime, you may try implementing __attribute__((destructor)) static void module_destroy() in your class.

include/Graph.h Outdated
@@ -145,6 +145,8 @@ class EXPORT graphModel : public Model
return( m_samples.data() );
}

void convolve(const float *_convolution, const int _conv_length, const int _center_offset);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding conventions: Parameters are not prefixed with underscore.

@@ -79,6 +79,7 @@ IF("${PLUGIN_LIST}" STREQUAL "")
waveshaper
vibed
zynaddsubfx
xpressive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should sort by name. I know it is not sorted.

@@ -0,0 +1,7 @@
INCLUDE(BuildPlugin)

SET(CMAKE_CXX_FLAGS "-Dexprtk_disable_sc_andor -Dexprtk_disable_enhanced_features -Dexprtk_disable_break_continue -Dexprtk_disable_comments -Dexprtk_disable_string_capabilities -Dexprtk_disable_rtl_io_file -Dexprtk_disable_rtl_vecops ${WERROR_FLAGS}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include previous value of CMAKE_CXX_FLAGS. You should apply all these definitions only for the MinGW-w64 build, as recommended at #3259 (comment).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I want to disable those features on any platform...

Copy link
Contributor Author

@gnudles gnudles Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh... now it's not compiling because exprtk.hpp still throws exception in line 2733
@ArashPartow, do you have any idea?
@tresf do I have to follow that -fno-exception flag?
????

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnudles which plaform are you building where you see that exception being thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exception is not being thrown. But I can't compile it with the flag -fno-exceptions

/*
* expressive_plugin.cpp - instrument which uses a mathematical formula parser
*
* Copyright (c) 2016-2017 Orr Dvori
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention is to add an email address, but it is not strictly necessary.


BoolModel m_exprValid;

friend class expressiveView;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be aware this is not a clean model/view separation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw it in bitInvader (I started by copying bitInvader)...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have some spare time, please use inline getters and setters instead of friend.

static QString HelpText;

};
class SubWindow;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move these declarations to the top.

delete exprO2;
}
float saw_wave(float);
float sin_wave(float);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are these functions used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftovers...

{
static inline float process()
{
return 1.0f - rand() * 2.0f / RAND_MAX;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rand is not thread-safe. It should be replaced later.

size_t last_pos=0;
size_t count = 0;
size_t len=strlen(needle);
while (1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use the standard true constant.

@gnudles
Copy link
Contributor Author

gnudles commented Feb 23, 2017

I fixed everything that @jasp00 noted,

Please include previous value of CMAKE_CXX_FLAGS

but unfortunately when I added the previous value, it couldn't be compiled, because there is still another throw statement in exprTk that slipped through all those disabling defines.
When it will be fixed, I think we are ready for merge...

@simonvanderveldt
Copy link
Contributor

Cool stuff!
Small question: Shouldn't new plugins use the new styling? See #2831
Or will this be done after this PR is merged?

@zonkmachine
Copy link
Member

I fixed everything that @jasp00 noted,

@gnudles Awesome! Push the changes.

Please include previous value of CMAKE_CXX_FLAGS

but unfortunately when I added the previous value, it couldn't be compiled, because there is still another throw statement in exprTk that slipped through all those disabling defines.
When it will be fixed, I think we are ready for merge...

Is there an upstream issue about this we can keep track of?

Small question: Shouldn't new plugins use the new styling? See #2831
Or will this be done after this PR is merged?

#2831 Is concerning the native effect plugins specifically.

@simonvanderveldt
Copy link
Contributor

#2831 Is concerning the native effect plugins specifically.

@zonkmachine yeah, I always forget there's a distinction between instruments and effects :x

@gnudles
Copy link
Contributor Author

gnudles commented Feb 28, 2017

@gnudles Awesome! Push the changes.

But if I do, it won't compile

Is there an upstream issue about this we can keep track of?

What do you mean?

@zonkmachine
Copy link
Member

The second (+) line above is indeed in exprtk.hpp upstream but neither of the lines is anywhere in the versions I have.

Edit: apart from the backed up original...

@gnudles
Copy link
Contributor Author

gnudles commented Jun 20, 2017

@zonkmachine, you can always get the newest exprtk.hpp from upstream. Thanks for the fixes BTW.
The exprtk.hpp in the plugin is the original file without any change, so it should be OK to take the newest.

@zonkmachine
Copy link
Member

zonkmachine commented Jun 20, 2017

Aight, upated! 😉

@zonkmachine
Copy link
Member

Not good to merge. Due to the rebasing to stable-1.2 this includes some commits from master that are not present in stable-1.2, such as de3b344 and 9f905bc.

I believe this is fixed now. Merge?

@lukas-w
Copy link
Member

lukas-w commented Jun 25, 2017

Merge?

👍

@zonkmachine
Copy link
Member

@tresf This is a big one. Does anything get squashed or just merge it as it is?

@tresf
Copy link
Member

tresf commented Jun 26, 2017

@zonkmachine if we wanted we could isolate the Graph additions and plugin cmake cleanup, but they're actually relatively small, I vote squash 'em all.

@zonkmachine
Copy link
Member

I vote squash 'em all.

I'm fine with that but how about keeping the two main contributors apart and squashing the exprtk.hpp commits by Arash (amended by my update) separately so it gets recognized on the contributors list. I'm a bit sentimental that way. I tested it in a separate branch and the rebase comes out with no bugs and there is no diff against gnudles:xpressive_plugin.

It would look something like:

commit fa59472eed44f5e40d011bf3366874949720be89
Author: Orr Dvori <[email protected]>
Date:   Wed May 17 22:43:31 2017 +0300

    X-Pressive plugin - added graph drawing feature

commit acee8d3c6aefdcb7eaa047ce83881e3852ee2701
Author: ArashPartow <[email protected]>
Date:   Sat Jan 14 05:21:23 2017 +1100

    Update ExprTk to tip of branch

commit 9b646c5c01266ef9229a6ff3f49c4ba32fcdb356
Author: Orr Dvori <[email protected]>
Date:   Sun Jan 8 14:31:01 2017 +0200

    X-Pressive Plugin
    
    Synthesizer plugin based on Bitinvader and 'The C++ Mathematical
    Expression Toolkit Library (ExprTk)'
    
    Some initial functions.
    
    available keys:
    f- note's frequency. available only in the output expressions
    t- time in seconds. in the Waves (W1,W2,W3) it's in the range [0,1)
    key- the note's keyboard key. available only in the output expressions.
    v- the note's velocity (divided by 255.0 so it is in the range [0,

...

@tresf
Copy link
Member

tresf commented Jun 26, 2017

In my experience squash maintains the contributors.

@zonkmachine
Copy link
Member

Ah, OK! Then just a Squash and merge.

@zonkmachine zonkmachine merged commit dff76b2 into LMMS:master Jun 26, 2017
@zonkmachine
Copy link
Member

In my experience squash maintains the contributors.

It doesn't look like it.

@tresf
Copy link
Member

tresf commented Jun 26, 2017

What is the concern? It gives him credit?

(Edit: If you're concerned about @ArashPartow I understand. I would have expected him to be in there as well.)

image

@zonkmachine
Copy link
Member

What is the concern? It gives him credit?

Yes, gnudles but not Arash. It's not a big concern though, I'm more trying to get to grips with git and github.

@ArashPartow
Copy link
Contributor

ArashPartow commented Jun 28, 2017

@zonkmachine - Gnudles did all the heavy lifting, so I'm all good with that. :D

@gnudles
Copy link
Contributor Author

gnudles commented Jun 30, 2017

Maybe we should credit Arash in the plugin itself in the help window.
BTW, shouldn't it be merged to stable1.2?

PhysSong pushed a commit to PhysSong/lmms that referenced this pull request Jul 7, 2017
* First Preview of the X-Pressive Plugin
(exprtk.hpp is not included, get it from my exprtk fork in the branch
internal_data_functions)
available keys:
f- note's frequency. available only in the output expressions
t- time in seconds. in the Waves (W1,W2,W3) it's in the range [0,1)
key- the note's keyboard key. available only in the output expressions.
v- the note's velocity (divided by 255.0 so it is in the range [0,1]).
available only in the output expressions.
rel- gives 0 while the key is holded, and 1 after the key release.
available only in the output expressions.
A1,A2,A3- general purpose knobs (you can control them with the
automations). available only in the output expressions.
W1,W2,W3- precalculated wave forms. can be also load from file. you can
use them only in the output expressions
available functions:
cent(x)- gives pow(2,x/1200)
rand()- random number generator. in range [-1,1). each call gives other
value.
randv(i)- random vector (with pseudo infinite integer cells). the values
are in range [-1,1). it's stays consistent only across the note
playback. so each note playback will get other vector (even on the same
key).
sinew- sine wave with period of 1.
saww- saw wave with period of 1.
squarew- square wave with period of 1.
trianglew- triangle wave with period of 1.
expw- exponent wave with period of 1.
expnw- another exponent wave with period of 1.
moogw- moog wave with period of 1.
moogsaww- moog-saw wave with period of 1.
you can use * % ^ / + - pow sin log pi etc.

* Xpressive Plug-In:
Added Release transition knob that control the "rel" variable. (the
duration of transit from 0 to 1)
Fixed some problems in the displays. (update display when changing
A1,A2,A3, clear display with invalid expression.

* X-Pressive Plug-In: Few more fixes
Changed the callbacks in exprfront.cpp to be templated.
Added help.
Added ExprTk.hpp.
some bug fixes (inf issues).
Added integrate function.

* Special version of ExprTk with modified license (BSL) for the LMMS project https:/LMMS/lmms

* Xpressive Plug-In- fixed some building errors.
Added the "e" euler's constant.

* Xpressive Plug-In - fix mingw64 issues

* X-Pressive Plug-in:
Added "trel" (time since release) variable.
The integrate function can now have unlimited usage.
Added selective interpolation per wave.
Improved a little the random vector function.
Some other improvements, code cleaning, etc...

* Xpressive Plug-In:
move clearGraph definition into Graph.cpp.
fixed compilation errors. (oops..)

* X-Pressive plug-in: updated presets names

* X-Pressive plug-in
added semitone function, added sample-rate variable

* X-Pressive plug-in, code cleaning, changed the rendering function to
achieve performace gain.

* X-Pressive plug-in - fix the string counting function

* X-Pressive plug-in - until somebody will find a better solution,
exprtk.hpp is patched under the name exprtk.patched.hpp ...

* X-Pressive plug-in - fix compiling errors.

* X-Pressive plug-in - added patch file for exprtk.hpp,
added last function that gives last calculated samples.
moved ExprSynth to be with ExprFront for performance reasons.

* X-Pressive plugin - moved the patched file back to the source tree, added .gitignore file..

* X-Pressive plugin - fix compilation error. (isnan isinf)

* X-Pressive plugin - tried to fix embed.cpp problem,
added new variable to the parser (tempo)

* X-Pressive plugin - fixed cmake script

* X-Pressive plugin - updated the license and the diff file.

* Updates to ExprTk

* Added return statement enable/disable via parser settings

Added exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plugin - updated CMakeLists.txt to use the correct flags on each platform.
also added exprtk.hpp as a dependency for the patch command.
Updated the exprtk diff file.

* X-Pressive plugin - moved the enhanced features flag to the WIN64 installation.

* X-Pressive plugin - another fix for CMakeLists.txt

* Minor updates to ExprTk

Updated multi-sub expression operator to return final sub-expression type.
Updates to exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plug-in - added try-block around exprtk calls and enabled the
-fexceptions flag, so patch file is no longer needed.

* X-Pressive plug-in - small fix in CMakeLists.txt

* Update ExprTk to tip of branch.

* X-Pressive plugin - added graph drawing feature..

* Updating exprtk.hpp to the latest upstream version
PhysSong pushed a commit to PhysSong/lmms that referenced this pull request Jul 7, 2017
* First Preview of the X-Pressive Plugin
(exprtk.hpp is not included, get it from my exprtk fork in the branch
internal_data_functions)
available keys:
f- note's frequency. available only in the output expressions
t- time in seconds. in the Waves (W1,W2,W3) it's in the range [0,1)
key- the note's keyboard key. available only in the output expressions.
v- the note's velocity (divided by 255.0 so it is in the range [0,1]).
available only in the output expressions.
rel- gives 0 while the key is holded, and 1 after the key release.
available only in the output expressions.
A1,A2,A3- general purpose knobs (you can control them with the
automations). available only in the output expressions.
W1,W2,W3- precalculated wave forms. can be also load from file. you can
use them only in the output expressions
available functions:
cent(x)- gives pow(2,x/1200)
rand()- random number generator. in range [-1,1). each call gives other
value.
randv(i)- random vector (with pseudo infinite integer cells). the values
are in range [-1,1). it's stays consistent only across the note
playback. so each note playback will get other vector (even on the same
key).
sinew- sine wave with period of 1.
saww- saw wave with period of 1.
squarew- square wave with period of 1.
trianglew- triangle wave with period of 1.
expw- exponent wave with period of 1.
expnw- another exponent wave with period of 1.
moogw- moog wave with period of 1.
moogsaww- moog-saw wave with period of 1.
you can use * % ^ / + - pow sin log pi etc.

* Xpressive Plug-In:
Added Release transition knob that control the "rel" variable. (the
duration of transit from 0 to 1)
Fixed some problems in the displays. (update display when changing
A1,A2,A3, clear display with invalid expression.

* X-Pressive Plug-In: Few more fixes
Changed the callbacks in exprfront.cpp to be templated.
Added help.
Added ExprTk.hpp.
some bug fixes (inf issues).
Added integrate function.

* Special version of ExprTk with modified license (BSL) for the LMMS project https:/LMMS/lmms

* Xpressive Plug-In- fixed some building errors.
Added the "e" euler's constant.

* Xpressive Plug-In - fix mingw64 issues

* X-Pressive Plug-in:
Added "trel" (time since release) variable.
The integrate function can now have unlimited usage.
Added selective interpolation per wave.
Improved a little the random vector function.
Some other improvements, code cleaning, etc...

* Xpressive Plug-In:
move clearGraph definition into Graph.cpp.
fixed compilation errors. (oops..)

* X-Pressive plug-in: updated presets names

* X-Pressive plug-in
added semitone function, added sample-rate variable

* X-Pressive plug-in, code cleaning, changed the rendering function to
achieve performace gain.

* X-Pressive plug-in - fix the string counting function

* X-Pressive plug-in - until somebody will find a better solution,
exprtk.hpp is patched under the name exprtk.patched.hpp ...

* X-Pressive plug-in - fix compiling errors.

* X-Pressive plug-in - added patch file for exprtk.hpp,
added last function that gives last calculated samples.
moved ExprSynth to be with ExprFront for performance reasons.

* X-Pressive plugin - moved the patched file back to the source tree, added .gitignore file..

* X-Pressive plugin - fix compilation error. (isnan isinf)

* X-Pressive plugin - tried to fix embed.cpp problem,
added new variable to the parser (tempo)

* X-Pressive plugin - fixed cmake script

* X-Pressive plugin - updated the license and the diff file.

* Updates to ExprTk

* Added return statement enable/disable via parser settings

Added exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plugin - updated CMakeLists.txt to use the correct flags on each platform.
also added exprtk.hpp as a dependency for the patch command.
Updated the exprtk diff file.

* X-Pressive plugin - moved the enhanced features flag to the WIN64 installation.

* X-Pressive plugin - another fix for CMakeLists.txt

* Minor updates to ExprTk

Updated multi-sub expression operator to return final sub-expression type.
Updates to exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plug-in - added try-block around exprtk calls and enabled the
-fexceptions flag, so patch file is no longer needed.

* X-Pressive plug-in - small fix in CMakeLists.txt

* Update ExprTk to tip of branch.

* X-Pressive plugin - added graph drawing feature..

* Updating exprtk.hpp to the latest upstream version
PhysSong pushed a commit to PhysSong/lmms that referenced this pull request Jul 7, 2017
* First Preview of the X-Pressive Plugin
(exprtk.hpp is not included, get it from my exprtk fork in the branch
internal_data_functions)
available keys:
f- note's frequency. available only in the output expressions
t- time in seconds. in the Waves (W1,W2,W3) it's in the range [0,1)
key- the note's keyboard key. available only in the output expressions.
v- the note's velocity (divided by 255.0 so it is in the range [0,1]).
available only in the output expressions.
rel- gives 0 while the key is holded, and 1 after the key release.
available only in the output expressions.
A1,A2,A3- general purpose knobs (you can control them with the
automations). available only in the output expressions.
W1,W2,W3- precalculated wave forms. can be also load from file. you can
use them only in the output expressions
available functions:
cent(x)- gives pow(2,x/1200)
rand()- random number generator. in range [-1,1). each call gives other
value.
randv(i)- random vector (with pseudo infinite integer cells). the values
are in range [-1,1). it's stays consistent only across the note
playback. so each note playback will get other vector (even on the same
key).
sinew- sine wave with period of 1.
saww- saw wave with period of 1.
squarew- square wave with period of 1.
trianglew- triangle wave with period of 1.
expw- exponent wave with period of 1.
expnw- another exponent wave with period of 1.
moogw- moog wave with period of 1.
moogsaww- moog-saw wave with period of 1.
you can use * % ^ / + - pow sin log pi etc.

* Xpressive Plug-In:
Added Release transition knob that control the "rel" variable. (the
duration of transit from 0 to 1)
Fixed some problems in the displays. (update display when changing
A1,A2,A3, clear display with invalid expression.

* X-Pressive Plug-In: Few more fixes
Changed the callbacks in exprfront.cpp to be templated.
Added help.
Added ExprTk.hpp.
some bug fixes (inf issues).
Added integrate function.

* Special version of ExprTk with modified license (BSL) for the LMMS project https:/LMMS/lmms

* Xpressive Plug-In- fixed some building errors.
Added the "e" euler's constant.

* Xpressive Plug-In - fix mingw64 issues

* X-Pressive Plug-in:
Added "trel" (time since release) variable.
The integrate function can now have unlimited usage.
Added selective interpolation per wave.
Improved a little the random vector function.
Some other improvements, code cleaning, etc...

* Xpressive Plug-In:
move clearGraph definition into Graph.cpp.
fixed compilation errors. (oops..)

* X-Pressive plug-in: updated presets names

* X-Pressive plug-in
added semitone function, added sample-rate variable

* X-Pressive plug-in, code cleaning, changed the rendering function to
achieve performace gain.

* X-Pressive plug-in - fix the string counting function

* X-Pressive plug-in - until somebody will find a better solution,
exprtk.hpp is patched under the name exprtk.patched.hpp ...

* X-Pressive plug-in - fix compiling errors.

* X-Pressive plug-in - added patch file for exprtk.hpp,
added last function that gives last calculated samples.
moved ExprSynth to be with ExprFront for performance reasons.

* X-Pressive plugin - moved the patched file back to the source tree, added .gitignore file..

* X-Pressive plugin - fix compilation error. (isnan isinf)

* X-Pressive plugin - tried to fix embed.cpp problem,
added new variable to the parser (tempo)

* X-Pressive plugin - fixed cmake script

* X-Pressive plugin - updated the license and the diff file.

* Updates to ExprTk

* Added return statement enable/disable via parser settings

Added exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plugin - updated CMakeLists.txt to use the correct flags on each platform.
also added exprtk.hpp as a dependency for the patch command.
Updated the exprtk diff file.

* X-Pressive plugin - moved the enhanced features flag to the WIN64 installation.

* X-Pressive plugin - another fix for CMakeLists.txt

* Minor updates to ExprTk

Updated multi-sub expression operator to return final sub-expression type.
Updates to exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plug-in - added try-block around exprtk calls and enabled the
-fexceptions flag, so patch file is no longer needed.

* X-Pressive plug-in - small fix in CMakeLists.txt

* Update ExprTk to tip of branch.

* X-Pressive plugin - added graph drawing feature..

* Updating exprtk.hpp to the latest upstream version
PhysSong pushed a commit to PhysSong/lmms that referenced this pull request Jul 7, 2017
* First Preview of the X-Pressive Plugin
(exprtk.hpp is not included, get it from my exprtk fork in the branch
internal_data_functions)
available keys:
f- note's frequency. available only in the output expressions
t- time in seconds. in the Waves (W1,W2,W3) it's in the range [0,1)
key- the note's keyboard key. available only in the output expressions.
v- the note's velocity (divided by 255.0 so it is in the range [0,1]).
available only in the output expressions.
rel- gives 0 while the key is holded, and 1 after the key release.
available only in the output expressions.
A1,A2,A3- general purpose knobs (you can control them with the
automations). available only in the output expressions.
W1,W2,W3- precalculated wave forms. can be also load from file. you can
use them only in the output expressions
available functions:
cent(x)- gives pow(2,x/1200)
rand()- random number generator. in range [-1,1). each call gives other
value.
randv(i)- random vector (with pseudo infinite integer cells). the values
are in range [-1,1). it's stays consistent only across the note
playback. so each note playback will get other vector (even on the same
key).
sinew- sine wave with period of 1.
saww- saw wave with period of 1.
squarew- square wave with period of 1.
trianglew- triangle wave with period of 1.
expw- exponent wave with period of 1.
expnw- another exponent wave with period of 1.
moogw- moog wave with period of 1.
moogsaww- moog-saw wave with period of 1.
you can use * % ^ / + - pow sin log pi etc.

* Xpressive Plug-In:
Added Release transition knob that control the "rel" variable. (the
duration of transit from 0 to 1)
Fixed some problems in the displays. (update display when changing
A1,A2,A3, clear display with invalid expression.

* X-Pressive Plug-In: Few more fixes
Changed the callbacks in exprfront.cpp to be templated.
Added help.
Added ExprTk.hpp.
some bug fixes (inf issues).
Added integrate function.

* Special version of ExprTk with modified license (BSL) for the LMMS project https:/LMMS/lmms

* Xpressive Plug-In- fixed some building errors.
Added the "e" euler's constant.

* Xpressive Plug-In - fix mingw64 issues

* X-Pressive Plug-in:
Added "trel" (time since release) variable.
The integrate function can now have unlimited usage.
Added selective interpolation per wave.
Improved a little the random vector function.
Some other improvements, code cleaning, etc...

* Xpressive Plug-In:
move clearGraph definition into Graph.cpp.
fixed compilation errors. (oops..)

* X-Pressive plug-in: updated presets names

* X-Pressive plug-in
added semitone function, added sample-rate variable

* X-Pressive plug-in, code cleaning, changed the rendering function to
achieve performace gain.

* X-Pressive plug-in - fix the string counting function

* X-Pressive plug-in - until somebody will find a better solution,
exprtk.hpp is patched under the name exprtk.patched.hpp ...

* X-Pressive plug-in - fix compiling errors.

* X-Pressive plug-in - added patch file for exprtk.hpp,
added last function that gives last calculated samples.
moved ExprSynth to be with ExprFront for performance reasons.

* X-Pressive plugin - moved the patched file back to the source tree, added .gitignore file..

* X-Pressive plugin - fix compilation error. (isnan isinf)

* X-Pressive plugin - tried to fix embed.cpp problem,
added new variable to the parser (tempo)

* X-Pressive plugin - fixed cmake script

* X-Pressive plugin - updated the license and the diff file.

* Updates to ExprTk

* Added return statement enable/disable via parser settings

Added exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plugin - updated CMakeLists.txt to use the correct flags on each platform.
also added exprtk.hpp as a dependency for the patch command.
Updated the exprtk diff file.

* X-Pressive plugin - moved the enhanced features flag to the WIN64 installation.

* X-Pressive plugin - another fix for CMakeLists.txt

* Minor updates to ExprTk

Updated multi-sub expression operator to return final sub-expression type.
Updates to exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plug-in - added try-block around exprtk calls and enabled the
-fexceptions flag, so patch file is no longer needed.

* X-Pressive plug-in - small fix in CMakeLists.txt

* Update ExprTk to tip of branch.

* X-Pressive plugin - added graph drawing feature..

* Updating exprtk.hpp to the latest upstream version
zonkmachine pushed a commit to zonkmachine/lmms that referenced this pull request Oct 1, 2017
* First Preview of the X-Pressive Plugin
(exprtk.hpp is not included, get it from my exprtk fork in the branch
internal_data_functions)
available keys:
f- note's frequency. available only in the output expressions
t- time in seconds. in the Waves (W1,W2,W3) it's in the range [0,1)
key- the note's keyboard key. available only in the output expressions.
v- the note's velocity (divided by 255.0 so it is in the range [0,1]).
available only in the output expressions.
rel- gives 0 while the key is holded, and 1 after the key release.
available only in the output expressions.
A1,A2,A3- general purpose knobs (you can control them with the
automations). available only in the output expressions.
W1,W2,W3- precalculated wave forms. can be also load from file. you can
use them only in the output expressions
available functions:
cent(x)- gives pow(2,x/1200)
rand()- random number generator. in range [-1,1). each call gives other
value.
randv(i)- random vector (with pseudo infinite integer cells). the values
are in range [-1,1). it's stays consistent only across the note
playback. so each note playback will get other vector (even on the same
key).
sinew- sine wave with period of 1.
saww- saw wave with period of 1.
squarew- square wave with period of 1.
trianglew- triangle wave with period of 1.
expw- exponent wave with period of 1.
expnw- another exponent wave with period of 1.
moogw- moog wave with period of 1.
moogsaww- moog-saw wave with period of 1.
you can use * % ^ / + - pow sin log pi etc.

* Xpressive Plug-In:
Added Release transition knob that control the "rel" variable. (the
duration of transit from 0 to 1)
Fixed some problems in the displays. (update display when changing
A1,A2,A3, clear display with invalid expression.

* X-Pressive Plug-In: Few more fixes
Changed the callbacks in exprfront.cpp to be templated.
Added help.
Added ExprTk.hpp.
some bug fixes (inf issues).
Added integrate function.

* Special version of ExprTk with modified license (BSL) for the LMMS project https:/LMMS/lmms

* Xpressive Plug-In- fixed some building errors.
Added the "e" euler's constant.

* Xpressive Plug-In - fix mingw64 issues

* X-Pressive Plug-in:
Added "trel" (time since release) variable.
The integrate function can now have unlimited usage.
Added selective interpolation per wave.
Improved a little the random vector function.
Some other improvements, code cleaning, etc...

* Xpressive Plug-In:
move clearGraph definition into Graph.cpp.
fixed compilation errors. (oops..)

* X-Pressive plug-in: updated presets names

* X-Pressive plug-in
added semitone function, added sample-rate variable

* X-Pressive plug-in, code cleaning, changed the rendering function to
achieve performace gain.

* X-Pressive plug-in - fix the string counting function

* X-Pressive plug-in - until somebody will find a better solution,
exprtk.hpp is patched under the name exprtk.patched.hpp ...

* X-Pressive plug-in - fix compiling errors.

* X-Pressive plug-in - added patch file for exprtk.hpp,
added last function that gives last calculated samples.
moved ExprSynth to be with ExprFront for performance reasons.

* X-Pressive plugin - moved the patched file back to the source tree, added .gitignore file..

* X-Pressive plugin - fix compilation error. (isnan isinf)

* X-Pressive plugin - tried to fix embed.cpp problem,
added new variable to the parser (tempo)

* X-Pressive plugin - fixed cmake script

* X-Pressive plugin - updated the license and the diff file.

* Updates to ExprTk

* Added return statement enable/disable via parser settings

Added exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plugin - updated CMakeLists.txt to use the correct flags on each platform.
also added exprtk.hpp as a dependency for the patch command.
Updated the exprtk diff file.

* X-Pressive plugin - moved the enhanced features flag to the WIN64 installation.

* X-Pressive plugin - another fix for CMakeLists.txt

* Minor updates to ExprTk

Updated multi-sub expression operator to return final sub-expression type.
Updates to exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plug-in - added try-block around exprtk calls and enabled the
-fexceptions flag, so patch file is no longer needed.

* X-Pressive plug-in - small fix in CMakeLists.txt

* Update ExprTk to tip of branch.

* X-Pressive plugin - added graph drawing feature..

* Updating exprtk.hpp to the latest upstream version
@zonkmachine
Copy link
Member

zonkmachine commented Oct 1, 2017

BTW, shouldn't it be merged to stable1.2?

I agree. In the works here: #3845

@gnudles
Copy link
Contributor Author

gnudles commented Sep 22, 2018

You know, I think it can be nice to have a JavaScript version of this plugin. It can use the built-in JS support in Qt via QtScript. The performance issue should be considered, but it seems a very nice idea.
Recently, I did a demo with Qt outside of LMMS to play a note with QtScript (JS), and it responded well.
What do you think?

@Unesty
Copy link

Unesty commented Sep 1, 2019

How to add external sample to W?

@gnudles
Copy link
Contributor Author

gnudles commented Sep 3, 2019

you have the load button

@Unesty
Copy link

Unesty commented Sep 9, 2019

I tried to load sample and it became distorted. Is that how supposed to be?

@gnudles
Copy link
Contributor Author

gnudles commented Sep 9, 2019

the wave is loaded to a buffer with 4096 samples or so (4096 floats or shorts, can't recall). 4096 is a huge buffer compared to other plugins in lmms. but if you load a long sample it will become distorted (resampled). it is not a bug, it's a feature :)

sdasda7777 pushed a commit to sdasda7777/lmms that referenced this pull request Jun 28, 2022
* First Preview of the X-Pressive Plugin
(exprtk.hpp is not included, get it from my exprtk fork in the branch
internal_data_functions)
available keys:
f- note's frequency. available only in the output expressions
t- time in seconds. in the Waves (W1,W2,W3) it's in the range [0,1)
key- the note's keyboard key. available only in the output expressions.
v- the note's velocity (divided by 255.0 so it is in the range [0,1]).
available only in the output expressions.
rel- gives 0 while the key is holded, and 1 after the key release.
available only in the output expressions.
A1,A2,A3- general purpose knobs (you can control them with the
automations). available only in the output expressions.
W1,W2,W3- precalculated wave forms. can be also load from file. you can
use them only in the output expressions
available functions:
cent(x)- gives pow(2,x/1200)
rand()- random number generator. in range [-1,1). each call gives other
value.
randv(i)- random vector (with pseudo infinite integer cells). the values
are in range [-1,1). it's stays consistent only across the note
playback. so each note playback will get other vector (even on the same
key).
sinew- sine wave with period of 1.
saww- saw wave with period of 1.
squarew- square wave with period of 1.
trianglew- triangle wave with period of 1.
expw- exponent wave with period of 1.
expnw- another exponent wave with period of 1.
moogw- moog wave with period of 1.
moogsaww- moog-saw wave with period of 1.
you can use * % ^ / + - pow sin log pi etc.

* Xpressive Plug-In:
Added Release transition knob that control the "rel" variable. (the
duration of transit from 0 to 1)
Fixed some problems in the displays. (update display when changing
A1,A2,A3, clear display with invalid expression.

* X-Pressive Plug-In: Few more fixes
Changed the callbacks in exprfront.cpp to be templated.
Added help.
Added ExprTk.hpp.
some bug fixes (inf issues).
Added integrate function.

* Special version of ExprTk with modified license (BSL) for the LMMS project https:/LMMS/lmms

* Xpressive Plug-In- fixed some building errors.
Added the "e" euler's constant.

* Xpressive Plug-In - fix mingw64 issues

* X-Pressive Plug-in:
Added "trel" (time since release) variable.
The integrate function can now have unlimited usage.
Added selective interpolation per wave.
Improved a little the random vector function.
Some other improvements, code cleaning, etc...

* Xpressive Plug-In:
move clearGraph definition into Graph.cpp.
fixed compilation errors. (oops..)

* X-Pressive plug-in: updated presets names

* X-Pressive plug-in
added semitone function, added sample-rate variable

* X-Pressive plug-in, code cleaning, changed the rendering function to
achieve performace gain.

* X-Pressive plug-in - fix the string counting function

* X-Pressive plug-in - until somebody will find a better solution,
exprtk.hpp is patched under the name exprtk.patched.hpp ...

* X-Pressive plug-in - fix compiling errors.

* X-Pressive plug-in - added patch file for exprtk.hpp,
added last function that gives last calculated samples.
moved ExprSynth to be with ExprFront for performance reasons.

* X-Pressive plugin - moved the patched file back to the source tree, added .gitignore file..

* X-Pressive plugin - fix compilation error. (isnan isinf)

* X-Pressive plugin - tried to fix embed.cpp problem,
added new variable to the parser (tempo)

* X-Pressive plugin - fixed cmake script

* X-Pressive plugin - updated the license and the diff file.

* Updates to ExprTk

* Added return statement enable/disable via parser settings

Added exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plugin - updated CMakeLists.txt to use the correct flags on each platform.
also added exprtk.hpp as a dependency for the patch command.
Updated the exprtk diff file.

* X-Pressive plugin - moved the enhanced features flag to the WIN64 installation.

* X-Pressive plugin - another fix for CMakeLists.txt

* Minor updates to ExprTk

Updated multi-sub expression operator to return final sub-expression type.
Updates to exprtk_disable_return_statement macro for disabling return statements and associated exceptions at the source code level.

* X-Pressive plug-in - added try-block around exprtk calls and enabled the
-fexceptions flag, so patch file is no longer needed.

* X-Pressive plug-in - small fix in CMakeLists.txt

* Update ExprTk to tip of branch.

* X-Pressive plugin - added graph drawing feature..

* Updating exprtk.hpp to the latest upstream version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.