Rename & refactor to Watsyn, add logo, tweak some algorithms

This commit is contained in:
Vesa
2014-03-25 02:15:03 +02:00
parent 8109d38f2e
commit b118c23123
54 changed files with 98 additions and 96 deletions

View File

@@ -238,7 +238,7 @@ TrackContainerView QFrame{
/* autoscroll, loop, stop behaviour toggle buttons */
nStateButton {
nStateButton {
max-height: 26px;
max-width: 26px;
min-height: 26px;
@@ -366,7 +366,7 @@ toolButton#playButton {
toolButton#stopButton {
border-top-right-radius: 5px 15px;
border-bottom-right-radius: 5px 15px;
border-bottom-right-radius: 5px 15px;
}
/* record and record-accompany can be styled with #recordButton and #recordAccompanyButton respectively */
@@ -608,54 +608,40 @@ sidInstrumentView knob {
qproperty-lineWidth: 2;
}
WTSynthView knob#aKnob {
WatsynView knob {
qproperty-innerRadius: 1;
qproperty-outerRadius: 7;
qproperty-centerPointX: 9.5;
qproperty-centerPointY: 9.5;
qproperty-lineWidth: 2;
}
WatsynView knob#aKnob {
color: #43b2ff;
qproperty-outerColor: #43b2ff;
qproperty-innerRadius: 1;
qproperty-outerRadius: 7;
qproperty-centerPointX: 9.5;
qproperty-centerPointY: 9.5;
qproperty-lineWidth: 2;
}
WTSynthView knob#bKnob {
WatsynView knob#bKnob {
color: #fc5431;
qproperty-outerColor: #fc5431;
qproperty-innerRadius: 1;
qproperty-outerRadius: 7;
qproperty-centerPointX: 9.5;
qproperty-centerPointY: 9.5;
qproperty-lineWidth: 2;
}
WTSynthView knob#mixKnob {
WatsynView knob#mixKnob {
color: #43ff82;
qproperty-outerColor: #43ff82;
qproperty-innerRadius: 1;
qproperty-outerRadius: 13;
qproperty-centerPointX: 15.5;
qproperty-centerPointY: 15.5;
qproperty-lineWidth: 2;
qproperty-centerPointY: 15.5;
}
WTSynthView knob#mixenvKnob {
WatsynView knob#mixenvKnob {
color: #43ff82;
qproperty-outerColor: #43ff82;
qproperty-innerRadius: 1;
qproperty-outerRadius: 7;
qproperty-centerPointX: 9.5;
qproperty-centerPointY: 9.5;
qproperty-lineWidth: 2;
}
WTSynthView knob#xtalkKnob {
WatsynView knob#xtalkKnob {
color: #fb50fb;
qproperty-outerColor: #fb50fb;
qproperty-innerRadius: 1;
qproperty-outerRadius: 7;
qproperty-centerPointX: 9.5;
qproperty-centerPointY: 9.5;
qproperty-lineWidth: 2;
}
/* palette information - each colour definition must be on a single line, and the line must begin with "palette:", with no leading whitespace

View File

@@ -28,7 +28,7 @@ ADD_SUBDIRECTORY(triple_oscillator)
ADD_SUBDIRECTORY(vestige)
ADD_SUBDIRECTORY(vst_base)
ADD_SUBDIRECTORY(VstEffect)
ADD_SUBDIRECTORY(watsyn)
ADD_SUBDIRECTORY(waveshaper)
ADD_SUBDIRECTORY(wtsynth)
ADD_SUBDIRECTORY(vibed)
ADD_SUBDIRECTORY(zynaddsubfx)

View File

@@ -0,0 +1,3 @@
INCLUDE(BuildPlugin)
BUILD_PLUGIN(watsyn Watsyn.cpp Watsyn.h MOCFILES Watsyn.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png)

View File

@@ -1,5 +1,5 @@
/*
* WTSynth.cpp - work in process, name pending
* Watsyn.cpp - a 4-oscillator modulating wavetable synth
*
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
*
@@ -24,7 +24,7 @@
#include <QtXml/QDomElement>
#include "WTSynth.h"
#include "Watsyn.h"
#include "engine.h"
#include "InstrumentTrack.h"
#include "templates.h"
@@ -37,10 +37,10 @@
extern "C"
{
Plugin::Descriptor PLUGIN_EXPORT wtsynth_plugin_descriptor =
Plugin::Descriptor PLUGIN_EXPORT watsyn_plugin_descriptor =
{
STRINGIFY( PLUGIN_NAME ),
"WTSynth",
"Watsyn",
QT_TRANSLATE_NOOP( "pluginBrowser",
"4-oscillator modulatable wavetable synth" ),
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>",
@@ -56,10 +56,10 @@ Plugin::Descriptor PLUGIN_EXPORT wtsynth_plugin_descriptor =
WTSynthObject::WTSynthObject( float * _A1wave, float * _A2wave,
WatsynObject::WatsynObject( float * _A1wave, float * _A2wave,
float * _B1wave, float * _B2wave,
int _amod, int _bmod, const sample_rate_t _samplerate, NotePlayHandle * _nph, fpp_t _frames,
WTSynthInstrument * _w ) :
WatsynInstrument * _w ) :
m_amod( _amod ),
m_bmod( _bmod ),
m_samplerate( _samplerate ),
@@ -89,14 +89,14 @@ WTSynthObject::WTSynthObject( float * _A1wave, float * _A2wave,
WTSynthObject::~WTSynthObject()
WatsynObject::~WatsynObject()
{
delete[] m_abuf;
delete[] m_bbuf;
}
void WTSynthObject::renderOutput( fpp_t _frames )
void WatsynObject::renderOutput( fpp_t _frames )
{
if( m_abuf == NULL )
m_abuf = new sampleFrame[m_fpp];
@@ -223,8 +223,8 @@ void WTSynthObject::renderOutput( fpp_t _frames )
WTSynthInstrument::WTSynthInstrument( InstrumentTrack * _instrument_track ) :
Instrument( _instrument_track, &wtsynth_plugin_descriptor ),
WatsynInstrument::WatsynInstrument( InstrumentTrack * _instrument_track ) :
Instrument( _instrument_track, &watsyn_plugin_descriptor ),
a1_vol( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Volume A1" ) ),
a2_vol( 100.0f, 0.0f, 200.0f, 0.1f, this, tr( "Volume A2" ) ),
@@ -305,17 +305,17 @@ WTSynthInstrument::WTSynthInstrument( InstrumentTrack * _instrument_track ) :
}
WTSynthInstrument::~WTSynthInstrument()
WatsynInstrument::~WatsynInstrument()
{
}
void WTSynthInstrument::playNote( NotePlayHandle * _n,
void WatsynInstrument::playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer )
{
if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL )
{
WTSynthObject * w = new WTSynthObject( const_cast<float*>( a1_graph.samples() ),
WatsynObject * w = new WatsynObject( const_cast<float*>( a1_graph.samples() ),
const_cast<float*>( a2_graph.samples() ),
const_cast<float*>( b1_graph.samples() ),
const_cast<float*>( b2_graph.samples() ),
@@ -328,7 +328,7 @@ void WTSynthInstrument::playNote( NotePlayHandle * _n,
const fpp_t frames = _n->framesLeftForCurrentPeriod();
WTSynthObject * w = static_cast<WTSynthObject *>( _n->m_pluginData );
WatsynObject * w = static_cast<WatsynObject *>( _n->m_pluginData );
sampleFrame * abuf = w->abuf();
sampleFrame * bbuf = w->bbuf();
@@ -435,13 +435,13 @@ void WTSynthInstrument::playNote( NotePlayHandle * _n,
}
void WTSynthInstrument::deleteNotePluginData( NotePlayHandle * _n )
void WatsynInstrument::deleteNotePluginData( NotePlayHandle * _n )
{
delete static_cast<WTSynthObject *>( _n->m_pluginData );
delete static_cast<WatsynObject *>( _n->m_pluginData );
}
void WTSynthInstrument::saveSettings( QDomDocument & _doc,
void WatsynInstrument::saveSettings( QDomDocument & _doc,
QDomElement & _this )
{
a1_vol.saveSettings( _doc, _this, "a1_vol" );
@@ -495,7 +495,7 @@ void WTSynthInstrument::saveSettings( QDomDocument & _doc,
}
void WTSynthInstrument::loadSettings( const QDomElement & _this )
void WatsynInstrument::loadSettings( const QDomElement & _this )
{
a1_vol.loadSettings( _this, "a1_vol" );
a2_vol.loadSettings( _this, "a2_vol" );
@@ -552,19 +552,19 @@ void WTSynthInstrument::loadSettings( const QDomElement & _this )
}
QString WTSynthInstrument::nodeName() const
QString WatsynInstrument::nodeName() const
{
return( wtsynth_plugin_descriptor.name );
return( watsyn_plugin_descriptor.name );
}
PluginView * WTSynthInstrument::instantiateView( QWidget * _parent )
PluginView * WatsynInstrument::instantiateView( QWidget * _parent )
{
return( new WTSynthView( this, _parent ) );
return( new WatsynView( this, _parent ) );
}
void WTSynthInstrument::updateVolumes()
void WatsynInstrument::updateVolumes()
{
m_lvol[A1_OSC] = leftCh( a1_vol.value(), a1_pan.value() );
m_rvol[A1_OSC] = rightCh( a1_vol.value(), a1_pan.value() );
@@ -579,7 +579,7 @@ void WTSynthInstrument::updateVolumes()
m_rvol[B2_OSC] = rightCh( b2_vol.value(), b2_pan.value() );
}
void WTSynthInstrument::updateFreq()
void WatsynInstrument::updateFreq()
{
// calculate frequencies
m_lfreq[A1_OSC] = ( a1_mult.value() / 8 ) * powf( 2, a1_ltune.value() / 1200 );
@@ -596,7 +596,7 @@ void WTSynthInstrument::updateFreq()
}
WTSynthView::WTSynthView( Instrument * _instrument,
WatsynView::WatsynView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentView( _instrument, _parent )
{
@@ -871,13 +871,13 @@ WTSynthView::WTSynthView( Instrument * _instrument,
}
WTSynthView::~WTSynthView()
WatsynView::~WatsynView()
{
}
void WTSynthView::updateLayout()
void WatsynView::updateLayout()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -910,7 +910,7 @@ void WTSynthView::updateLayout()
void WTSynthView::sinWaveClicked()
void WatsynView::sinWaveClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -934,7 +934,7 @@ void WTSynthView::sinWaveClicked()
}
void WTSynthView::triWaveClicked()
void WatsynView::triWaveClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -958,7 +958,7 @@ void WTSynthView::triWaveClicked()
}
void WTSynthView::sawWaveClicked()
void WatsynView::sawWaveClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -982,7 +982,7 @@ void WTSynthView::sawWaveClicked()
}
void WTSynthView::sqrWaveClicked()
void WatsynView::sqrWaveClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -1006,7 +1006,7 @@ void WTSynthView::sqrWaveClicked()
}
void WTSynthView::normalizeClicked()
void WatsynView::normalizeClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -1030,7 +1030,7 @@ void WTSynthView::normalizeClicked()
}
void WTSynthView::invertClicked()
void WatsynView::invertClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -1054,7 +1054,7 @@ void WTSynthView::invertClicked()
}
void WTSynthView::smoothClicked()
void WatsynView::smoothClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -1078,7 +1078,7 @@ void WTSynthView::smoothClicked()
}
void WTSynthView::phaseLeftClicked()
void WatsynView::phaseLeftClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -1102,7 +1102,7 @@ void WTSynthView::phaseLeftClicked()
}
void WTSynthView::phaseRightClicked()
void WatsynView::phaseRightClicked()
{
switch( m_selectedGraphGroup->model()->value() )
{
@@ -1126,7 +1126,7 @@ void WTSynthView::phaseRightClicked()
}
void WTSynthView::loadClicked()
void WatsynView::loadClicked()
{
QString fileName;
switch( m_selectedGraphGroup->model()->value() )
@@ -1151,9 +1151,9 @@ void WTSynthView::loadClicked()
}
void WTSynthView::modelChanged()
void WatsynView::modelChanged()
{
WTSynthInstrument * w = castModel<WTSynthInstrument>();
WatsynInstrument * w = castModel<WatsynInstrument>();
a1_volKnob -> setModel( &w -> a1_vol );
a2_volKnob -> setModel( &w -> a2_vol );
@@ -1210,11 +1210,11 @@ extern "C"
// necessary for getting instance out of shared lib
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data )
{
return( new WTSynthInstrument( static_cast<InstrumentTrack *>( _data ) ) );
return( new WatsynInstrument( static_cast<InstrumentTrack *>( _data ) ) );
}
}
#include "moc_WTSynth.cxx"
#include "moc_Watsyn.cxx"

View File

@@ -1,5 +1,5 @@
/*
* WTSynth.h - work in process, name pending
* Watsyn.h - a 4-oscillator modulating wavetable synth
*
* Copyright (c) 2014 Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>
*
@@ -23,8 +23,8 @@
*/
#ifndef WTSYNTH_H
#define WTSYNTH_H
#ifndef WATSYN_H
#define WATSYN_H
#include "Instrument.h"
#include "InstrumentView.h"
@@ -71,16 +71,16 @@ extern const int B1_OSC = 2;
extern const int B2_OSC = 3;
extern const int NUM_OSCS = 4;
class WTSynthInstrument;
class WatsynInstrument;
class WTSynthObject
class WatsynObject
{
public:
WTSynthObject( float * _A1wave, float * _A2wave,
WatsynObject( float * _A1wave, float * _A2wave,
float * _B1wave, float * _B2wave,
int _amod, int _bmod, const sample_rate_t _samplerate, NotePlayHandle * _nph, fpp_t _frames,
WTSynthInstrument * _w );
virtual ~WTSynthObject();
WatsynInstrument * _w );
virtual ~WatsynObject();
void renderOutput( fpp_t _frames );
@@ -103,17 +103,33 @@ private:
{
return s1 + ( s2 - s1 ) * x;
}*/
// quick and dirty approximation of cubic interpolation
inline sample_t interpolate( sample_t s1, sample_t s2, float x )
{
const float x2 = powf( x, 2 );
const float x3 = powf( x, 3 );
const float m = s2 - s1;
//const float m = s2 - s1;
return ( ( x3 * 2.0 - x2 * 3.0 + 1.0 ) * s1 ) +
( ( x3 * -2.0 + x2 * 3.0 ) * s2 );// +
//( ( x + x3 * 2.0 - x2 * 3.0 ) * m );
}
// more accurate cubic interpolation...
// consumes more cpu than ^ but doesn't bring a marked increase in sound quality IMO
/* inline sample_t interpolate( sample_t s0, sample_t s1, sample_t s2, sample_t s3, float x )
{
const float x2 = powf( x, 2 );
const float x3 = powf( x, 3 );
const float m1 = ( s2 - s0 ) / 2;
const float m2 = ( s3 - s1 ) / 2;
return ( ( x3 * 2.0 - x2 * 3.0 + 1.0 ) * s1 ) +
( ( x3 * -2.0 + x2 * 3.0 ) * s2 ) +
( ( x + x3 * 2.0 - x2 * 3.0 ) * m );
}
( ( x3 - x2 * 2 + x ) * m1 ) +
( ( x3 - x2 ) * m2 );
}*/
int m_amod;
int m_bmod;
@@ -123,7 +139,7 @@ private:
fpp_t m_fpp;
WTSynthInstrument * m_parent;
WatsynInstrument * m_parent;
sampleFrame * m_abuf;
sampleFrame * m_bbuf;
@@ -137,12 +153,12 @@ private:
float m_B2wave [WAVELEN];
};
class WTSynthInstrument : public Instrument
class WatsynInstrument : public Instrument
{
Q_OBJECT
public:
WTSynthInstrument( InstrumentTrack * _instrument_track );
virtual ~WTSynthInstrument();
WatsynInstrument( InstrumentTrack * _instrument_track );
virtual ~WatsynInstrument();
virtual void playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer );
@@ -161,7 +177,7 @@ public:
}
virtual PluginView * instantiateView( QWidget * _parent );
public slots:
void updateVolumes();
void updateFreq();
@@ -229,18 +245,18 @@ private:
IntModel m_selectedGraph;
friend class WTSynthObject;
friend class WTSynthView;
friend class WatsynObject;
friend class WatsynView;
};
class WTSynthView : public InstrumentView
class WatsynView : public InstrumentView
{
Q_OBJECT
public:
WTSynthView( Instrument * _instrument,
WatsynView( Instrument * _instrument,
QWidget * _parent );
virtual ~WTSynthView();
virtual ~WatsynView();
protected slots:
void updateLayout();

View File

Before

Width:  |  Height:  |  Size: 767 B

After

Width:  |  Height:  |  Size: 767 B

View File

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 462 B

View File

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 815 B

View File

Before

Width:  |  Height:  |  Size: 500 B

After

Width:  |  Height:  |  Size: 500 B

View File

Before

Width:  |  Height:  |  Size: 830 B

After

Width:  |  Height:  |  Size: 830 B

View File

Before

Width:  |  Height:  |  Size: 480 B

After

Width:  |  Height:  |  Size: 480 B

View File

Before

Width:  |  Height:  |  Size: 1006 B

After

Width:  |  Height:  |  Size: 1006 B

View File

Before

Width:  |  Height:  |  Size: 619 B

After

Width:  |  Height:  |  Size: 619 B

View File

Before

Width:  |  Height:  |  Size: 829 B

After

Width:  |  Height:  |  Size: 829 B

View File

Before

Width:  |  Height:  |  Size: 476 B

After

Width:  |  Height:  |  Size: 476 B

View File

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 889 B

View File

Before

Width:  |  Height:  |  Size: 569 B

After

Width:  |  Height:  |  Size: 569 B

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

View File

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 712 B

View File

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 431 B

View File

Before

Width:  |  Height:  |  Size: 764 B

After

Width:  |  Height:  |  Size: 764 B

View File

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 490 B

View File

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 712 B

View File

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 451 B

View File

Before

Width:  |  Height:  |  Size: 931 B

After

Width:  |  Height:  |  Size: 931 B

View File

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 630 B

View File

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 729 B

View File

Before

Width:  |  Height:  |  Size: 443 B

After

Width:  |  Height:  |  Size: 443 B

View File

Before

Width:  |  Height:  |  Size: 792 B

After

Width:  |  Height:  |  Size: 792 B

View File

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 540 B

View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

View File

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 596 B

View File

Before

Width:  |  Height:  |  Size: 676 B

After

Width:  |  Height:  |  Size: 676 B

View File

Before

Width:  |  Height:  |  Size: 631 B

After

Width:  |  Height:  |  Size: 631 B

BIN
plugins/watsyn/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 702 B

After

Width:  |  Height:  |  Size: 702 B

View File

Before

Width:  |  Height:  |  Size: 641 B

After

Width:  |  Height:  |  Size: 641 B

View File

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 734 B

View File

Before

Width:  |  Height:  |  Size: 693 B

After

Width:  |  Height:  |  Size: 693 B

View File

Before

Width:  |  Height:  |  Size: 708 B

After

Width:  |  Height:  |  Size: 708 B

View File

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 671 B

View File

Before

Width:  |  Height:  |  Size: 706 B

After

Width:  |  Height:  |  Size: 706 B

View File

Before

Width:  |  Height:  |  Size: 646 B

After

Width:  |  Height:  |  Size: 646 B

View File

Before

Width:  |  Height:  |  Size: 734 B

After

Width:  |  Height:  |  Size: 734 B

View File

Before

Width:  |  Height:  |  Size: 699 B

After

Width:  |  Height:  |  Size: 699 B

View File

Before

Width:  |  Height:  |  Size: 709 B

After

Width:  |  Height:  |  Size: 709 B

View File

Before

Width:  |  Height:  |  Size: 649 B

After

Width:  |  Height:  |  Size: 649 B

View File

Before

Width:  |  Height:  |  Size: 687 B

After

Width:  |  Height:  |  Size: 687 B

View File

Before

Width:  |  Height:  |  Size: 640 B

After

Width:  |  Height:  |  Size: 640 B

View File

Before

Width:  |  Height:  |  Size: 738 B

After

Width:  |  Height:  |  Size: 738 B

View File

Before

Width:  |  Height:  |  Size: 699 B

After

Width:  |  Height:  |  Size: 699 B

View File

Before

Width:  |  Height:  |  Size: 612 B

After

Width:  |  Height:  |  Size: 612 B

View File

@@ -1,3 +0,0 @@
INCLUDE(BuildPlugin)
BUILD_PLUGIN( wtsynth WTSynth.cpp WTSynth.h MOCFILES WTSynth.h EMBEDDED_RESOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B