LMMS
Loading...
Searching...
No Matches
Controller Class Reference

#include <Controller.h>

Public Member Functions

 Controller ()
 ~Controller ()
void send (int npar, float xval)
 Controller ()
 ~Controller ()
void resetall ()
void add2XML (XMLwrapper *xml)
void defaults ()
void getfromXML (XMLwrapper *xml)
void setpitchwheel (int value)
void setpitchwheelbendrange (unsigned short int value)
void setexpression (int value)
void setpanning (int value)
void setfiltercutoff (int value)
void setfilterq (int value)
void setbandwidth (int value)
void setmodwheel (int value)
void setfmamp (int value)
void setvolume (int value)
void setsustain (int value)
void setportamento (int value)
void setresonancecenter (int value)
void setresonancebw (int value)
void setparameternumber (unsigned int type, int value)
int getnrpn (int *parhi, int *parlo, int *valhi, int *vallo)
int initportamento (float oldfreq, float newfreq, bool legatoflag)
void updateportamento ()

Public Attributes

unsigned char Pchout
struct { 
   unsigned char   mode 
   unsigned char   val1 
   unsigned char   val2 
   struct { 
      unsigned char   par 
   }   ctl
   struct { 
      unsigned char   cpar 
      unsigned char   fpar 
      unsigned char   cval 
   }   nrpn
pars [6]
struct { 
   int   data 
   short int   bendrange 
   float   relfreq 
pitchwheel
struct { 
   int   data 
   float   relvolume 
   unsigned char   receive 
expression
struct { 
   int   data 
   float   pan 
   unsigned char   depth 
panning
struct { 
   int   data 
   float   relfreq 
   unsigned char   depth 
filtercutoff
struct { 
   int   data 
   float   relq 
   unsigned char   depth 
filterq
struct { 
   int   data 
   float   relbw 
   unsigned char   depth 
   unsigned char   exponential 
bandwidth
struct { 
   int   data 
   float   relmod 
   unsigned char   depth 
   unsigned char   exponential 
modwheel
struct { 
   int   data 
   float   relamp 
   unsigned char   receive 
fmamp
struct { 
   int   data 
   float   volume 
   unsigned char   receive 
volume
struct { 
   int   data 
   int   sustain 
   unsigned char   receive 
sustain
struct { 
   int   data 
   unsigned char   portamento 
   unsigned char   receive 
   unsigned char   time 
   unsigned char   proportional 
   unsigned char   propRate 
   unsigned char   propDepth 
   unsigned char   pitchthresh 
   unsigned char   pitchthreshtype 
   unsigned char   updowntimestretch 
   float   freqrap 
   int   noteusing 
   int   used 
   float   x 
   float   dx 
   float   origfreqrap 
portamento
struct { 
   int   data 
   float   relcenter 
   unsigned char   depth 
resonancecenter
struct { 
   int   data 
   float   relbw 
   unsigned char   depth 
resonancebandwidth
struct { 
   int   parhi 
   int   parlo 
   int   valhi 
   int   vallo 
   unsigned char   receive 
NRPN

Private Member Functions

void sendcontroller (int par, unsigned char val)
void sendnrpn (int npar, unsigned char val)

Private Attributes

snd_seq_t * midi_out

Detailed Description

(Midi) Controllers implementation

Constructor & Destructor Documentation

◆ Controller() [1/2]

Controller::Controller ( )

◆ ~Controller() [1/2]

Controller::~Controller ( )

◆ Controller() [2/2]

Controller::Controller ( )

◆ ~Controller() [2/2]

Controller::~Controller ( )

Member Function Documentation

◆ add2XML()

void Controller::add2XML ( XMLwrapper * xml)

◆ defaults()

void Controller::defaults ( )

◆ getfromXML()

void Controller::getfromXML ( XMLwrapper * xml)

◆ getnrpn()

int Controller::getnrpn ( int * parhi,
int * parlo,
int * valhi,
int * vallo )

◆ initportamento()

int Controller::initportamento ( float oldfreq,
float newfreq,
bool legatoflag )

Initialize a portamento

Parameters
oldfreqStarting frequency of the portamento (Hz)
newfreqEnding frequency of the portamento (Hz)
legatoflagtrue when legato is in progress, false otherwise
Returns
1 if properly initialized, 0 otherwise

◆ resetall()

void Controller::resetall ( )

◆ send()

void Controller::send ( int npar,
float xval )

◆ sendcontroller()

void Controller::sendcontroller ( int par,
unsigned char val )
private

◆ sendnrpn()

void Controller::sendnrpn ( int npar,
unsigned char val )
private

◆ setbandwidth()

void Controller::setbandwidth ( int value)

◆ setexpression()

void Controller::setexpression ( int value)

◆ setfiltercutoff()

void Controller::setfiltercutoff ( int value)

◆ setfilterq()

void Controller::setfilterq ( int value)

◆ setfmamp()

void Controller::setfmamp ( int value)

◆ setmodwheel()

void Controller::setmodwheel ( int value)

◆ setpanning()

void Controller::setpanning ( int value)

◆ setparameternumber()

void Controller::setparameternumber ( unsigned int type,
int value )

◆ setpitchwheel()

void Controller::setpitchwheel ( int value)

◆ setpitchwheelbendrange()

void Controller::setpitchwheelbendrange ( unsigned short int value)

◆ setportamento()

void Controller::setportamento ( int value)

Enable or disable portamento

Parameters
value0-127 MIDI value (greater than 64 enables)

◆ setresonancebw()

void Controller::setresonancebw ( int value)

◆ setresonancecenter()

void Controller::setresonancecenter ( int value)

◆ setsustain()

void Controller::setsustain ( int value)

◆ setvolume()

void Controller::setvolume ( int value)

◆ updateportamento()

void Controller::updateportamento ( )

Update portamento's freqrap to next value based upon dx

Member Data Documentation

◆ [struct]

struct { ... } Controller::bandwidth

◆ bendrange

short int Controller::bendrange

◆ cpar

unsigned char Controller::cpar

◆ [struct]

struct { ... } Controller::ctl

◆ cval

unsigned char Controller::cval

◆ data

int Controller::data

<Portamento

◆ depth

unsigned char Controller::depth

◆ dx

float Controller::dx

dx is the increment to x when updateportamento is called

◆ exponential

unsigned char Controller::exponential

◆ [struct]

struct { ... } Controller::expression

◆ [struct]

struct { ... } Controller::filtercutoff

◆ [struct]

struct { ... } Controller::filterq

◆ [struct]

struct { ... } Controller::fmamp

◆ fpar

unsigned char Controller::fpar

◆ freqrap

float Controller::freqrap

this value is used to compute the actual portamento

This is a multiplyer to change the frequency of the newer frequency to fit the profile of the portamento. This will be linear with respect to x.

◆ midi_out

snd_seq_t* Controller::midi_out
private

◆ mode

unsigned char Controller::mode

◆ [struct]

struct { ... } Controller::modwheel

◆ noteusing

int Controller::noteusing

this is used by the Part for knowing which note uses the portamento

◆ [struct]

struct { ... } Controller::NRPN

RPN and NPRPN

◆ [struct]

struct { ... } Controller::nrpn

◆ origfreqrap

float Controller::origfreqrap

this is used for computing oldfreq value from x

◆ pan

float Controller::pan

◆ [struct]

struct { ... } Controller::panning

◆ par

unsigned char Controller::par

◆ parhi

int Controller::parhi

◆ parlo

int Controller::parlo

◆ [struct]

struct { ... } Controller::pars[6]

◆ Pchout

unsigned char Controller::Pchout

◆ pitchthresh

unsigned char Controller::pitchthresh

pitchthresh is the threshold of enabling protamento

◆ pitchthreshtype

unsigned char Controller::pitchthreshtype

enable the portamento only below(0)/above(1) the threshold

◆ [struct]

struct { ... } Controller::pitchwheel

◆ [struct] [1/2]

struct { ... } Controller::portamento

◆ portamento [2/2]

unsigned char Controller::portamento

◆ propDepth

unsigned char Controller::propDepth

Depth of proportinal portamento

◆ proportional

unsigned char Controller::proportional

If the portamento is proportinal to the distance spanned

0 - constant time(default) 1 - proportional

◆ propRate

unsigned char Controller::propRate

Rate of proportinal portamento

◆ receive

unsigned char Controller::receive

Whether the portamento midi events are received or not

◆ relamp

float Controller::relamp

◆ relbw

float Controller::relbw

◆ relcenter

float Controller::relcenter

◆ relfreq

float Controller::relfreq

◆ relmod

float Controller::relmod

◆ relq

float Controller::relq

◆ relvolume

float Controller::relvolume

◆ [struct]

struct { ... } Controller::resonancebandwidth

◆ [struct]

struct { ... } Controller::resonancecenter

◆ [struct] [1/2]

struct { ... } Controller::sustain

◆ sustain [2/2]

int Controller::sustain

◆ time

unsigned char Controller::time

The time that it takes for the portamento to complete

Translates in an expontal fashion to 0 Seconds to 1.93f Seconds of completion time

◆ updowntimestretch

unsigned char Controller::updowntimestretch

this value represent how the portamento time is reduced 0 - for down portamento 1-63 - the up portamento's time is smaller than the down portamento 64 - the portamento time is always the same 64-126 - the down portamento's time is smaller than the up portamento 127 - for upper portamento 'up portamento' means when the frequency is rising (eg: the portamento is from 200Hz to 300 Hz) 'down portamento' means when the frequency is lowering (eg: the portamento is from 300Hz to 200 Hz)

◆ used

int Controller::used

if a the portamento is used by a note

Todo
see if this can be a bool

◆ val1

unsigned char Controller::val1

◆ val2

unsigned char Controller::val2

◆ valhi

int Controller::valhi

◆ vallo

int Controller::vallo

◆ [struct] [1/2]

struct { ... } Controller::volume

◆ volume [2/2]

float Controller::volume

◆ x

float Controller::x

x is from 0.0f (start portamento) to 1.0f (finished portamento)


The documentation for this class was generated from the following files: