Rename xpressive to Xpressive

This commit is contained in:
tresf
2017-11-10 18:31:29 -05:00
committed by Tres Finocchiaro
parent 80a49db6f6
commit 231cc82de1
26 changed files with 104 additions and 89 deletions

4
.gitmodules vendored
View File

@@ -13,6 +13,6 @@
[submodule "plugins/LadspaEffect/calf/veal"]
path = plugins/LadspaEffect/calf/veal
url = https://github.com/lmms/veal
[submodule "plugins/xpressive/exprtk"]
path = plugins/xpressive/exprtk
[submodule "plugins/Xpressive/exprtk"]
path = plugins/Xpressive/exprtk
url = https://github.com/ArashPartow/exprtk

View File

@@ -80,7 +80,7 @@ IF("${PLUGIN_LIST}" STREQUAL "")
watsyn
waveshaper
vibed
xpressive
Xpressive
zynaddsubfx
)

View File

@@ -0,0 +1,26 @@
INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(exprtk)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_sc_andor")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_return_statement")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_break_continue")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_comments")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_string_capabilities")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_rtl_io_file")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_rtl_vecops")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WERROR_FLAGS} -fexceptions")
IF(LMMS_BUILD_WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -Dexprtk_disable_enhanced_features")
ENDIF()
BUILD_PLUGIN(xpressive
Xpressive.cpp
ExprSynth.cpp
Xpressive.h
exprtk/exprtk.hpp
MOCFILES Xpressive.h
EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png"
)

View File

@@ -1,5 +1,5 @@
/*
* exprfront.cpp - implementation of a Frontend to ExprTk
* ExprSynth.cpp - Implementation of a Frontend to ExprTk
*
* Copyright (c) 2016-2017 Orr Dvori
*
@@ -23,7 +23,7 @@
*/
#include "exprsynth.h"
#include "ExprSynth.h"
#include <string>
#include <vector>
@@ -31,7 +31,7 @@
#include <cstdlib>
#include <random>
#include "expressive_plugin.h"
#include "Xpressive.h"
#include "interpolation.h"
#include "lmms_math.h"

View File

@@ -22,8 +22,8 @@
*
*/
#ifndef EXPRFRONT_H_
#define EXPRFRONT_H_
#ifndef EXPRSYNTH_H
#define EXPRSYNTH_H
#include <cmath>
#include <cstddef>
@@ -138,4 +138,4 @@ inline void clearArray(T* arr,unsigned int size)
#endif /* EXPRFRONT_H_ */
#endif

View File

@@ -1,5 +1,5 @@
/*
* expressive_plugin.cpp - instrument which uses a mathematical formula parser
* Xpressive.cpp - Instrument which uses a mathematical formula parser
*
* Copyright (c) 2016-2017 Orr Dvori
*
@@ -22,7 +22,7 @@
*
*/
#include "expressive_plugin.h"
#include "Xpressive.h"
#include <QDomElement>
@@ -46,7 +46,7 @@
#include "embed.h"
#include "exprsynth.h"
#include "ExprSynth.h"
extern "C" {
@@ -68,14 +68,14 @@ O2 -> trianglew(2t*f)*(0.5+0.5sinew(12*A1*t))+sinew(t*f)*(0.5+0.5sinew(12*A1*t+0
/***********************************************************************
*
* class Expressive
* class Xpressive
*
* lmms - plugin
*
***********************************************************************/
#define GRAPH_LENGTH 4096
Expressive::Expressive(InstrumentTrack* instrument_track) :
Xpressive::Xpressive(InstrumentTrack* instrument_track) :
Instrument(instrument_track, &xpressive_plugin_descriptor),
m_graphO1(-1.0f, 1.0f, 360, this),
m_graphO2(-1.0f, 1.0f, 360, this),
@@ -107,10 +107,10 @@ Expressive::Expressive(InstrumentTrack* instrument_track) :
m_outputExpression[1]="expw(integrate(f*atan(500t)*2/pi))*0.5+0.12";
}
Expressive::~Expressive() {
Xpressive::~Xpressive() {
}
void Expressive::saveSettings(QDomDocument & _doc, QDomElement & _this) {
void Xpressive::saveSettings(QDomDocument & _doc, QDomElement & _this) {
// Save plugin version
_this.setAttribute("version", "0.1");
@@ -146,7 +146,7 @@ void Expressive::saveSettings(QDomDocument & _doc, QDomElement & _this) {
}
void Expressive::loadSettings(const QDomElement & _this) {
void Xpressive::loadSettings(const QDomElement & _this) {
m_outputExpression[0]=_this.attribute( "O1").toLatin1();
m_outputExpression[1]=_this.attribute( "O2").toLatin1();
@@ -191,11 +191,11 @@ void Expressive::loadSettings(const QDomElement & _this) {
}
QString Expressive::nodeName() const {
QString Xpressive::nodeName() const {
return (xpressive_plugin_descriptor.name);
}
void Expressive::playNote(NotePlayHandle* nph, sampleFrame* working_buffer) {
void Xpressive::playNote(NotePlayHandle* nph, sampleFrame* working_buffer) {
m_A1=m_parameterA1.value();
m_A2=m_parameterA2.value();
m_A3=m_parameterA3.value();
@@ -237,15 +237,15 @@ void Expressive::playNote(NotePlayHandle* nph, sampleFrame* working_buffer) {
instrumentTrack()->processAudioBuffer(working_buffer, frames + offset, nph);
}
void Expressive::deleteNotePluginData(NotePlayHandle* nph) {
void Xpressive::deleteNotePluginData(NotePlayHandle* nph) {
delete static_cast<ExprSynth *>(nph->m_pluginData);
}
PluginView * Expressive::instantiateView(QWidget* parent) {
return (new expressiveView(this, parent));
PluginView * Xpressive::instantiateView(QWidget* parent) {
return (new XpressiveView(this, parent));
}
class expressiveKnob: public Knob {
class XpressiveKnob: public Knob {
public:
void setStyle()
{
@@ -258,11 +258,11 @@ public:
setTotalAngle(300.0);
setLineWidth(3);
}
expressiveKnob(QWidget * _parent, const QString & _name) :
XpressiveKnob(QWidget * _parent, const QString & _name) :
Knob(knobStyled, _parent,_name) {
setStyle();
}
expressiveKnob(QWidget * _parent) :
XpressiveKnob(QWidget * _parent) :
Knob(knobStyled, _parent) {
setStyle();
}
@@ -270,7 +270,7 @@ public:
};
expressiveView::expressiveView(Instrument * _instrument, QWidget * _parent) :
XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) :
InstrumentView(_instrument, _parent)
{
@@ -352,7 +352,7 @@ expressiveView::expressiveView(Instrument * _instrument, QWidget * _parent) :
m_selectedGraphGroup->addButton(m_o1Btn);
m_selectedGraphGroup->addButton(m_o2Btn);
Expressive *e = castModel<Expressive>();
Xpressive *e = castModel<Xpressive>();
m_selectedGraphGroup->setModel(&e->selectedGraph());
m_sinWaveBtn = new PixmapButton(this, tr("Sine wave"));
@@ -423,27 +423,27 @@ expressiveView::expressiveView(Instrument * _instrument, QWidget * _parent) :
m_expressionEditor->move(9, 128);
m_expressionEditor->resize(180, 90);
m_generalPurposeKnob[0] = new expressiveKnob(this,"A1");
m_generalPurposeKnob[0] = new XpressiveKnob(this,"A1");
m_generalPurposeKnob[0]->setHintText(tr("General purpose 1:"), "");
m_generalPurposeKnob[0]->move(COL_KNOBS, ROW_KNOBSA1);
m_generalPurposeKnob[1] = new expressiveKnob(this,"A2");
m_generalPurposeKnob[1] = new XpressiveKnob(this,"A2");
m_generalPurposeKnob[1]->setHintText(tr("General purpose 2:"), "");
m_generalPurposeKnob[1]->move(COL_KNOBS, ROW_KNOBSA2);
m_generalPurposeKnob[2] = new expressiveKnob(this,"A3");
m_generalPurposeKnob[2] = new XpressiveKnob(this,"A3");
m_generalPurposeKnob[2]->setHintText(tr("General purpose 3:"), "");
m_generalPurposeKnob[2]->move(COL_KNOBS, ROW_KNOBSA3);
m_panningKnob[0] = new expressiveKnob(this,"O1 panning");
m_panningKnob[0] = new XpressiveKnob(this,"O1 panning");
m_panningKnob[0]->setHintText(tr("O1 panning:"), "");
m_panningKnob[0]->move(COL_KNOBS, ROW_KNOBSP1);
m_panningKnob[1] = new expressiveKnob(this,"O2 panning");
m_panningKnob[1] = new XpressiveKnob(this,"O2 panning");
m_panningKnob[1]->setHintText(tr("O2 panning:"), "");
m_panningKnob[1]->move(COL_KNOBS, ROW_KNOBSP2);
m_relKnob = new expressiveKnob(this,"Release transition");
m_relKnob = new XpressiveKnob(this,"Release transition");
m_relKnob->setHintText(tr("Release transition:"), "ms");
m_relKnob->move(COL_KNOBS, ROW_KNOBREL);
@@ -489,13 +489,13 @@ expressiveView::expressiveView(Instrument * _instrument, QWidget * _parent) :
updateLayout();
}
expressiveView::~expressiveView()
XpressiveView::~XpressiveView()
{
}
void expressiveView::expressionChanged() {
Expressive * e = castModel<Expressive>();
void XpressiveView::expressionChanged() {
Xpressive * e = castModel<Xpressive>();
QByteArray text = m_expressionEditor->toPlainText().toLatin1();
switch (m_selectedGraphGroup->model()->value()) {
@@ -584,7 +584,7 @@ void expressiveView::expressionChanged() {
}
}
void Expressive::smooth(float smoothness,const graphModel * in,graphModel * out)
void Xpressive::smooth(float smoothness,const graphModel * in,graphModel * out)
{
out->setSamples(in->samples());
if (smoothness>0)
@@ -613,10 +613,10 @@ void Expressive::smooth(float smoothness,const graphModel * in,graphModel * out)
void expressiveView::smoothChanged()
void XpressiveView::smoothChanged()
{
Expressive * e = castModel<Expressive>();
Xpressive * e = castModel<Xpressive>();
float smoothness=0;
switch (m_selectedGraphGroup->model()->value()) {
case W1_EXPR:
@@ -629,7 +629,7 @@ void expressiveView::smoothChanged()
smoothness=e->smoothW3().value();
break;
}
Expressive::smooth(smoothness,m_raw_graph,m_graph->model());
Xpressive::smooth(smoothness,m_raw_graph,m_graph->model());
switch (m_selectedGraphGroup->model()->value()) {
case W1_EXPR:
e->W1().copyFrom(m_graph->model());
@@ -645,10 +645,10 @@ void expressiveView::smoothChanged()
m_graph->setEnabled(m_smoothKnob->model()->value() == 0 && m_expressionEditor->toPlainText().size() == 0);
}
void expressiveView::graphDrawn()
void XpressiveView::graphDrawn()
{
m_raw_graph->setSamples(m_graph->model()->samples());
Expressive * e = castModel<Expressive>();
Xpressive * e = castModel<Xpressive>();
switch (m_selectedGraphGroup->model()->value()) {
case W1_EXPR:
e->W1().copyFrom(m_graph->model());
@@ -663,8 +663,8 @@ void expressiveView::graphDrawn()
Engine::getSong()->setModified();
}
void expressiveView::modelChanged() {
Expressive * b = castModel<Expressive>();
void XpressiveView::modelChanged() {
Xpressive * b = castModel<Xpressive>();
m_expressionValidToggle->setModel( &b->exprValid() );
m_generalPurposeKnob[0]->setModel( &b->parameterA1() );
@@ -679,8 +679,8 @@ void expressiveView::modelChanged() {
updateLayout();
}
void expressiveView::updateLayout() {
Expressive * e = castModel<Expressive>();
void XpressiveView::updateLayout() {
Xpressive * e = castModel<Xpressive>();
m_output_expr=false;
m_wave_expr=false;
switch (m_selectedGraphGroup->model()->value()) {
@@ -743,7 +743,7 @@ void expressiveView::updateLayout() {
}
}
void expressiveView::sinWaveClicked() {
void XpressiveView::sinWaveClicked() {
if (m_output_expr)
m_expressionEditor->appendPlainText("sinew(t*f)");
else
@@ -751,7 +751,7 @@ void expressiveView::sinWaveClicked() {
Engine::getSong()->setModified();
}
void expressiveView::triangleWaveClicked() {
void XpressiveView::triangleWaveClicked() {
if (m_output_expr)
m_expressionEditor->appendPlainText("trianglew(t*f)");
else
@@ -759,7 +759,7 @@ void expressiveView::triangleWaveClicked() {
Engine::getSong()->setModified();
}
void expressiveView::sawWaveClicked() {
void XpressiveView::sawWaveClicked() {
if (m_output_expr)
m_expressionEditor->appendPlainText("saww(t*f)");
else
@@ -767,7 +767,7 @@ void expressiveView::sawWaveClicked() {
Engine::getSong()->setModified();
}
void expressiveView::sqrWaveClicked() {
void XpressiveView::sqrWaveClicked() {
if (m_output_expr)
m_expressionEditor->appendPlainText("squarew(t*f)");
else
@@ -775,12 +775,12 @@ void expressiveView::sqrWaveClicked() {
Engine::getSong()->setModified();
}
void expressiveView::noiseWaveClicked() {
void XpressiveView::noiseWaveClicked() {
m_expressionEditor->appendPlainText("rand");
Engine::getSong()->setModified();
}
void expressiveView::moogSawWaveClicked()
void XpressiveView::moogSawWaveClicked()
{
if (m_output_expr)
m_expressionEditor->appendPlainText("moogsaww(t*f)");
@@ -788,7 +788,7 @@ void expressiveView::moogSawWaveClicked()
m_expressionEditor->appendPlainText("moogsaww(t)");
Engine::getSong()->setModified();
}
void expressiveView::expWaveClicked()
void XpressiveView::expWaveClicked()
{
if (m_output_expr)
m_expressionEditor->appendPlainText("expw(t*f)");
@@ -797,16 +797,16 @@ void expressiveView::expWaveClicked()
Engine::getSong()->setModified();
}
void expressiveView::usrWaveClicked() {
void XpressiveView::usrWaveClicked() {
m_expressionEditor->setPlainText("");
QString fileName = m_raw_graph->setWaveToUser();
smoothChanged();
Engine::getSong()->setModified();
}
expressiveHelpView* expressiveHelpView::s_instance=0;
XpressiveHelpView* XpressiveHelpView::s_instance=0;
QString expressiveHelpView::s_helpText=
QString XpressiveHelpView::s_helpText=
"<b>O1, O2</b> - Two output waves. Panning is controled by PN1 and PN2.<br>"
"<b>W1, W2, W3</b> - Wave samples evaluated by expression. In these samples, t variable ranges [0,1).<br>"
"These waves can be used as functions inside the output waves (O1, O2). The wave period is 1.<br>"
@@ -854,7 +854,7 @@ QString expressiveHelpView::s_helpText=
"<b>Phase Modulation</b> - [vol1]*W1( integrate(f) + [vol2]*W2( integrate(f) ) )<br>"
;
expressiveHelpView::expressiveHelpView():QTextEdit(s_helpText)
XpressiveHelpView::XpressiveHelpView():QTextEdit(s_helpText)
{
setWindowTitle ( "X-Pressive Help" );
setTextInteractionFlags ( Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse );
@@ -864,21 +864,21 @@ expressiveHelpView::expressiveHelpView():QTextEdit(s_helpText)
parentWidget()->setFixedSize( 300, 500);
}
void expressiveView::helpClicked() {
expressiveHelpView::getInstance()->show();
void XpressiveView::helpClicked() {
XpressiveHelpView::getInstance()->show();
}
__attribute__((destructor)) static void module_destroy()
{
expressiveHelpView::finalize();
XpressiveHelpView::finalize();
}
extern "C" {
// necessary for getting instance out of shared lib
Plugin * PLUGIN_EXPORT lmms_plugin_main(Model *, void * _data) {
return (new Expressive(static_cast<InstrumentTrack *>(_data)));
return (new Xpressive(static_cast<InstrumentTrack *>(_data)));
}
}

View File

@@ -1,5 +1,5 @@
/*
* expressive_plugin.h - instrument which uses a mathematical formula
* Xpressive.h - Instrument which uses a mathematical formula parser
*
* Copyright (c) 2016-2017 Orr Dvori
*
@@ -23,8 +23,8 @@
*/
#ifndef EXPRESSIVE_PLUGIN_H
#define EXPRESSIVE_PLUGIN_H
#ifndef XPRESSIVE_H
#define XPRESSIVE_H
#include <QPlainTextEdit>
@@ -35,10 +35,10 @@
#include "LedCheckbox.h"
#include "PixmapButton.h"
#include "exprsynth.h"
#include "ExprSynth.h"
class oscillator;
class expressiveView;
class XpressiveView;
const int W1_EXPR = 0;
const int W2_EXPR = 1;
@@ -53,12 +53,12 @@ class SubWindow;
class Expressive : public Instrument
class Xpressive : public Instrument
{
Q_OBJECT
public:
Expressive(InstrumentTrack* instrument_track );
virtual ~Expressive();
Xpressive(InstrumentTrack* instrument_track );
virtual ~Xpressive();
virtual void playNote(NotePlayHandle* nph,
sampleFrame* working_buffer );
@@ -139,14 +139,14 @@ private:
} ;
class expressiveView : public InstrumentView
class XpressiveView : public InstrumentView
{
Q_OBJECT
public:
expressiveView( Instrument* _instrument,
XpressiveView( Instrument* _instrument,
QWidget* _parent );
virtual ~expressiveView();
virtual ~XpressiveView();
protected:
@@ -200,15 +200,15 @@ private:
bool m_wave_expr;
} ;
class expressiveHelpView: public QTextEdit
class XpressiveHelpView: public QTextEdit
{
Q_OBJECT
public:
static expressiveHelpView* getInstance()
static XpressiveHelpView* getInstance()
{
if (!s_instance)
{
s_instance = new expressiveHelpView();
s_instance = new XpressiveHelpView();
}
return s_instance;
}
@@ -218,8 +218,8 @@ public:
}
private:
expressiveHelpView();
static expressiveHelpView *s_instance;
XpressiveHelpView();
static XpressiveHelpView *s_instance;
static QString s_helpText;
};

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 840 B

After

Width:  |  Height:  |  Size: 840 B

View File

Before

Width:  |  Height:  |  Size: 806 B

After

Width:  |  Height:  |  Size: 806 B

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 629 B

After

Width:  |  Height:  |  Size: 629 B

View File

Before

Width:  |  Height:  |  Size: 508 B

After

Width:  |  Height:  |  Size: 508 B

View File

Before

Width:  |  Height:  |  Size: 723 B

After

Width:  |  Height:  |  Size: 723 B

View File

Before

Width:  |  Height:  |  Size: 602 B

After

Width:  |  Height:  |  Size: 602 B

View File

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 685 B

View File

Before

Width:  |  Height:  |  Size: 549 B

After

Width:  |  Height:  |  Size: 549 B

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 628 B

View File

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 771 B

View File

Before

Width:  |  Height:  |  Size: 626 B

After

Width:  |  Height:  |  Size: 626 B

View File

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@@ -1,11 +0,0 @@
INCLUDE(BuildPlugin)
INCLUDE_DIRECTORIES(exprtk)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Dexprtk_disable_sc_andor -Dexprtk_disable_return_statement -Dexprtk_disable_break_continue -Dexprtk_disable_comments -Dexprtk_disable_string_capabilities -Dexprtk_disable_rtl_io_file -Dexprtk_disable_rtl_vecops ${WERROR_FLAGS} -fexceptions")
IF(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -Dexprtk_disable_enhanced_features")
ENDIF()
BUILD_PLUGIN(xpressive expressive_plugin.cpp exprsynth.cpp expressive_plugin.h exprtk/exprtk.hpp MOCFILES expressive_plugin.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png")