All Classes Namespaces Functions Variables Enumerations Enumerator Modules Pages
Public Member Functions | List of all members
ScriptingApi::Synth Class Reference
Inheritance diagram for ScriptingApi::Synth:
ScriptingObject ApiClass

Public Member Functions

void addToFront (bool addToFront)
void deferCallbacks (bool makeAsynchronous)
void noteOff (int noteNumber)
void noteOffByEventId (int eventId)
int playNote (int noteNumber, int velocity)
void addVolumeFade (int eventId, int fadeTimeMilliseconds, int targetVolume)
void addPitchFade (int eventId, int fadeTimeMilliseconds, int targetCoarsePitch, int targetFinePitch)
int addMessageFromHolder (var messageHolder)
void startTimer (double seconds)
void setAttribute (int attributeIndex, float newAttribute)
void setVoiceGainValue (int voiceIndex, float gainValue)
void setVoicePitchValue (int voiceIndex, double pitchValue)
float getAttribute (int attributeIndex) const
int addNoteOn (int channel, int noteNumber, int velocity, int timeStampSamples)
void addNoteOff (int channel, int noteNumber, int timeStampSamples)
void addController (int channel, int number, int value, int timeStampSamples)
void setClockSpeed (int clockSpeed)
void setShouldKillRetriggeredNote (bool killNote)
void stopTimer ()
bool isTimerRunning () const
double getTimerInterval () const
void setMacroControl (int macroIndex, float newValue)
void sendController (int controllerNumber, int controllerValue)
void sendControllerToChildSynths (int controllerNumber, int controllerValue)
int getNumChildSynths () const
void setModulatorAttribute (int chainId, int modulatorIndex, int attributeIndex, float newValue)
int getNumPressedKeys () const
bool isLegatoInterval () const
bool isKeyDown (int noteNumber)
ScriptModulatoraddModulator (int chainId, const String &type, const String &id)
bool removeModulator (var mod)
ScriptEffect * addEffect (const String &type, const String &id, int index)
bool removeEffect (var effect)
ScriptModulatorgetModulator (const String &name)
ScriptEffect * getEffect (const String &name)
ScriptMidiProcessor * getMidiProcessor (const String &name)
ScriptSynth * getChildSynth (const String &name)
ScriptSynth * getChildSynthByIndex (int index)
var getIdList (const String &type)
ScriptAudioSampleProcessor * getAudioSampleProcessor (const String &name)
ScriptTableProcessor * getTableProcessor (const String &name)
SamplergetSampler (const String &name)
ScriptSlotFX * getSlotFX (const String &name)
int getModulatorIndex (int chainId, const String &id) const
bool isSustainPedalDown () const
- Public Member Functions inherited from ApiClass
 ApiClass (int numConstants_)
void addConstant (String constantName, var value)
const var getConstantValue (int index) const
int getConstantIndex (const Identifier &id) const
Identifier getConstantName (int index) const
void addFunction (const Identifier &id, call0 newFunction)
void addFunction1 (const Identifier &id, call1 newFunction)
void addFunction2 (const Identifier &id, call2 newFunction)
void addFunction3 (const Identifier &id, call3 newFunction)
void addFunction4 (const Identifier &id, call4 newFunction)
void addFunction5 (const Identifier &id, call5 newFunction)
void getIndexAndNumArgsForFunction (const Identifier &id, int &index, int &numArgs) const
var callFunction (int index, var *args, int numArgs)
void getAllFunctionNames (Array< Identifier > &ids) const
void getAllConstants (Array< Identifier > &ids) const

Detailed Description

Provides access to the synth where the script processor resides.

There are special methods for SynthGroups which only work with SynthGroups

Member Function Documentation

void addController ( int  channel,
int  number,
int  value,
int  timeStampSamples 

Adds a controller to the buffer.

ScriptingApi::Synth::ScriptEffect * addEffect ( const String &  type,
const String &  id,
int  index 

Adds a effect (index = -1 to append it at the end).

int addMessageFromHolder ( var  messageHolder)

Adds the event from the given holder and returns a event id for note ons.

ScriptingObjects::ScriptingModulator * addModulator ( int  chainId,
const String &  type,
const String &  id 

Adds a Modulator to the synth's chain. If it already exists, it returns the index.

void addNoteOff ( int  channel,
int  noteNumber,
int  timeStampSamples 

Adds a note off to the buffer.

int addNoteOn ( int  channel,
int  noteNumber,
int  velocity,
int  timeStampSamples 

Adds a note on to the buffer.

void addPitchFade ( int  eventId,
int  fadeTimeMilliseconds,
int  targetCoarsePitch,
int  targetFinePitch 

Adds a pitch fade to the given event ID.

void addToFront ( bool  addToFront)

Adds the interface to the Container's body (or the frontend interface if compiled)

void addVolumeFade ( int  eventId,
int  fadeTimeMilliseconds,
int  targetVolume 

Fades all voices with the given event id to the target volume (in decibels).

void deferCallbacks ( bool  makeAsynchronous)

Defers all callbacks to the message thread (midi callbacks become read-only).

float getAttribute ( int  attributeIndex) const

Returns the attribute of the parent synth.

ScriptingObjects::ScriptingAudioSampleProcessor * getAudioSampleProcessor ( const String &  name)

Returns the child synth with the supplied name.

ScriptingObjects::ScriptingSynth * getChildSynth ( const String &  name)

Returns the child synth with the supplied name.

ScriptingApi::Synth::ScriptSynth * getChildSynthByIndex ( int  index)

Returns the child synth with the given index.

ScriptingObjects::ScriptingEffect * getEffect ( const String &  name)

Returns the Effect with the supplied name. Can only be called in onInit(). It looks also in all child processors.

var getIdList ( const String &  type)

Searches the child processors and returns a list with every ID of the given type.

ScriptingObjects::ScriptingMidiProcessor * getMidiProcessor ( const String &  name)

Returns the MidiProcessor with the supplied name. Can not be the own name!

ScriptingObjects::ScriptingModulator * getModulator ( const String &  name)

Returns the Modulator with the supplied name. Can be only called in onInit. It looks also in all child processors.

int getModulatorIndex ( int  chainId,
const String &  id 
) const

Returns the index of the Modulator in the chain with the supplied chainId

int getNumChildSynths ( ) const

Returns the number of child synths. Works with SynthGroups and SynthChains.

int getNumPressedKeys ( ) const

Returns the number of pressed keys (!= the number of playing voices!).

ScriptingApi::Sampler * getSampler ( const String &  name)

Returns the first sampler with the name name.

ScriptingApi::Synth::ScriptSlotFX * getSlotFX ( const String &  name)

Returns the first slot with the given name.

ScriptingObjects::ScriptingTableProcessor * getTableProcessor ( const String &  name)

Returns the table processor with the given name.

double getTimerInterval ( ) const

Returns the current timer interval in seconds.

bool isKeyDown ( int  noteNumber)

Checks if the given key is pressed.

bool isLegatoInterval ( ) const

Checks if any key is pressed.

bool isSustainPedalDown ( ) const

Returns true if the sustain pedal is pressed.

bool isTimerRunning ( ) const

Checks if the timer for this script is running.

void noteOff ( int  noteNumber)

Sends a note off message. The envelopes will tail off.

void noteOffByEventId ( int  eventId)

Sends a note off message for the supplied event ID. This is more stable than the deprecated noteOff() method.

int playNote ( int  noteNumber,
int  velocity 

Plays a note and returns the event id. Be careful or you get stuck notes!

bool removeEffect ( var  effect)

Removes the given effect.

bool removeModulator ( var  mod)

Removes the modulator.

void sendController ( int  controllerNumber,
int  controllerValue 

Sends a controller event to the synth.

void sendControllerToChildSynths ( int  controllerNumber,
int  controllerValue 

The same as sendController (for backwards compatibility)

void setAttribute ( int  attributeIndex,
float  newAttribute 

Sets an attribute of the parent synth.

void setClockSpeed ( int  clockSpeed)

Sets the internal clock speed.

void setMacroControl ( int  macroIndex,
float  newValue 

Sets one of the eight macro controllers to the newValue.

macroIndexthe index of the macro from 1 - 8
newValueThe range for the newValue is 0.0 - 127.0.
void setModulatorAttribute ( int  chainId,
int  modulatorIndex,
int  attributeIndex,
float  newValue 

Sets a ModulatorAttribute.

chainIdthe chain where the Modulator is. GainModulation = 1, PitchModulation = 0
modulatorIndexthe index of the Modulator starting with 0.
attributeIndexthe index of the Modulator starting with 0. Intensity is '-12', Bypassed is '-13'
newValuethe value. The range for Gain is 0.0 - 1.0, the Range for Pitch is -12.0 ... 12.0
void setShouldKillRetriggeredNote ( bool  killNote)

If set to true, this will kill retriggered notes (default).

void setVoiceGainValue ( int  voiceIndex,
float  gainValue 

Applies a gain factor to a specified voice.

void setVoicePitchValue ( int  voiceIndex,
double  pitchValue 

Applies a pitch factor (0.5 ... 2.0) to a specified voice.

void startTimer ( double  seconds)

Starts the timer of the synth.

void stopTimer ( )

Stops the timer of the synth. You can call this also in the timer callback.

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.