WTSynth files

This commit is contained in:
Vesa
2014-03-21 10:53:11 +02:00
parent 0fa2908f7f
commit 23b3179e1f
40 changed files with 1341 additions and 0 deletions

View File

@@ -608,6 +608,31 @@ sidInstrumentView knob {
qproperty-lineWidth: 2;
}
WTSynthView knob#aKnob {
color: rgb( 255, 255, 255 );
qproperty-outerColor: rgb( 255, 255, 255 );
qproperty-innerRadius: 1;
qproperty-outerRadius: 9;
qproperty-lineWidth: 2;
}
WTSynthView knob#bKnob {
color: rgb( 255, 255, 255 );
qproperty-outerColor: rgb( 255, 255, 255 );
qproperty-innerRadius: 1;
qproperty-outerRadius: 9;
qproperty-lineWidth: 2;
}
WTSynthView knob#mixKnob {
color: rgb( 255, 255, 255 );
qproperty-outerColor: rgb( 255, 255, 255 );
qproperty-innerRadius: 1;
qproperty-outerRadius: 15;
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
* colour codes MUST be of the form #RRGGBB */

1096
plugins/wtsynth/WTSynth.cpp Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -29,10 +29,230 @@
#include "Instrument.h"
#include "InstrumentView.h"
#include "graph.h"
#include "AutomatableModel.h"
#include "automatable_button.h"
#include "knob.h"
#include "NotePlayHandle.h"
#include "pixmap_button.h"
const int WAVELEN = 220;
const int MOD_MIX = 0;
const int MOD_AM = 1;
const int MOD_RM = 2;
const int MOD_PM = 3;
const int NUM_MODS = 4;
const int A1_OSC = 0;
const int A2_OSC = 1;
const int B1_OSC = 2;
const int B2_OSC = 3;
const int NUM_OSCS = 4;
class WTSynthInstrument;
class WTSynthView;
class WTSynthObject
{
public:
WTSynthObject( float * _A1wave, float * _A2wave,
float * _B1wave, float * _B2wave,
int _amod, int _bmod, const sample_rate_t _samplerate, NotePlayHandle * _nph );
virtual ~WTSynthObject();
void renderOutput( sampleFrame * _abuf, sampleFrame * _bbuf, fpp_t _frames );
void updateFrequencies();
void changeVolume( int _osc, float _lvol, float _rvol );
void changeMult( int _osc, int _mul );
void changeTune( int _osc, float _ltune, float _rtune );
private:
sample_t * m_A1wave;
sample_t * m_A2wave;
sample_t * m_B1wave;
sample_t * m_B2wave;
float m_lvol [NUM_OSCS];
float m_rvol [NUM_OSCS];
int m_mult [NUM_OSCS];
float m_ltune [NUM_OSCS];
float m_rtune [NUM_OSCS];
int m_amod;
int m_bmod;
const sample_rate_t m_samplerate;
NotePlayHandle * m_nph;
float m_lphase [NUM_OSCS];
float m_rphase [NUM_OSCS];
float m_lfreq [NUM_OSCS];
float m_rfreq [NUM_OSCS];
};
class WTSynthInstrument : public Instrument
{
Q_OBJECT
public:
WTSynthInstrument( InstrumentTrack * _instrument_track );
virtual ~WTSynthInstrument();
virtual void playNote( NotePlayHandle * _n,
sampleFrame * _working_buffer );
virtual void deleteNotePluginData( NotePlayHandle * _n );
virtual void saveSettings( QDomDocument & _doc,
QDomElement & _this );
virtual void loadSettings( const QDomElement & _this );
virtual QString nodeName() const;
virtual f_cnt_t desiredReleaseFrames() const
{
return( 64 );
}
virtual PluginView * instantiateView( QWidget * _parent );
protected slots:
void updateVolumes( int _osc );
void updateMult( int _osc );
void updateTunes( int _osc );
private:
inline float leftCh( float _vol, float _pan )
{
return ( _pan <= 0 ? 1.0 : 1.0 - ( _pan / 100.0 ) ) * _vol;
}
inline float rightCh( float _vol, float _pan )
{
return ( _pan >= 0 ? 1.0 : 1.0 + ( _pan / 100.0 ) ) * _vol;
}
FloatModel a1_vol;
FloatModel a2_vol;
FloatModel b1_vol;
FloatModel b2_vol;
FloatModel a1_pan;
FloatModel a2_pan;
FloatModel b1_pan;
FloatModel b2_pan;
IntModel a1_mult;
IntModel a2_mult;
IntModel b1_mult;
IntModel b2_mult;
FloatModel a1_ltune;
FloatModel a2_ltune;
FloatModel b1_ltune;
FloatModel b2_ltune;
FloatModel a1_rtune;
FloatModel a2_rtune;
FloatModel b1_rtune;
FloatModel b2_rtune;
graphModel a1_graph;
graphModel a2_graph;
graphModel b1_graph;
graphModel b2_graph;
FloatModel m_abmix;
IntModel m_amod;
IntModel m_bmod;
IntModel m_selectedGraph;
bool m_volChanged [NUM_OSCS];
bool m_multChanged [NUM_OSCS];
bool m_tuneChanged [NUM_OSCS];
friend class WTSynthView;
};
class WTSynthView : public InstrumentView
{
Q_OBJECT
public:
WTSynthView( Instrument * _instrument,
QWidget * _parent );
virtual ~WTSynthView();
protected slots:
void updateLayout();
void sinWaveClicked();
void triWaveClicked();
void sawWaveClicked();
void sqrWaveClicked();
void smoothClicked();
void normalizeClicked();
void invertClicked();
void phaseLeftClicked();
void phaseRightClicked();
private:
virtual void modelChanged();
// knobs
knob * a1_volKnob;
knob * a2_volKnob;
knob * b1_volKnob;
knob * b2_volKnob;
knob * a1_panKnob;
knob * a2_panKnob;
knob * b1_panKnob;
knob * b2_panKnob;
knob * a1_multKnob;
knob * a2_multKnob;
knob * b1_multKnob;
knob * b2_multKnob;
knob * a1_ltuneKnob;
knob * a2_ltuneKnob;
knob * b1_ltuneKnob;
knob * b2_ltuneKnob;
knob * a1_rtuneKnob;
knob * a2_rtuneKnob;
knob * b1_rtuneKnob;
knob * b2_rtuneKnob;
knob * m_abmixKnob;
automatableButtonGroup * m_selectedGraphGroup;
automatableButtonGroup * m_aModGroup;
automatableButtonGroup * m_bModGroup;
static QPixmap * s_artwork;
graph * a1_graph;
graph * a2_graph;
graph * b1_graph;
graph * b2_graph;
pixmapButton * m_sinWaveButton;
pixmapButton * m_triWaveButton;
pixmapButton * m_sawWaveButton;
pixmapButton * m_sqrWaveButton;
pixmapButton * m_normalizeButton;
pixmapButton * m_invertButton;
pixmapButton * m_smoothButton;
pixmapButton * m_phaseLeftButton;
pixmapButton * m_phaseRightButton;
};
#endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

BIN
plugins/wtsynth/artwork.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

BIN
plugins/wtsynth/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B