- port to minGw
git-svn-id: http://moon:8086/svn/software/trunk/projects/JaySynth@235 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+2
-2
@@ -9,7 +9,7 @@
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "JaySynthSound.h"
|
||||
#include "JaySynthVoice.h"
|
||||
#include "JaySynthMonophonicMGR.h"
|
||||
@@ -83,7 +83,7 @@ JaySynth::JaySynth (int num_voices, String pathToWaves)
|
||||
humanize_voice_param[i] = new param_info_t[max_num_voices];
|
||||
for (j=0; j < max_num_voices; j++)
|
||||
{
|
||||
sprintf_s(paramName, "%s Voice# %03d", String(getParamInfo(i)->pName), j);
|
||||
sprintf(paramName, "%s Voice# %03d", getParamInfo(i)->pName, j);
|
||||
paramInfoInit(&humanize_voice_param[i][j], getParamInfo(i)->id, paramName);
|
||||
paramInfoCopy(&humanize_voice_param[i][j], getParamInfo(i));
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@
|
||||
#define _JAYSYNTH_H_
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "param_scale.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "synth/param_scale.h"
|
||||
#include "JaySynthVoice.h"
|
||||
#include "JaySynthMonophonicMGR.h"
|
||||
|
||||
|
||||
@@ -2191,9 +2191,9 @@ JaySynthAudioProcessorEditor::JaySynthAudioProcessorEditor (JaySynthAudioProcess
|
||||
|
||||
startTimer (500);
|
||||
#ifdef DEBUG
|
||||
m_label_synth_version->setText(String("V ") + String(JucePlugin_VersionString) + String(" (DEBUG)"), true);
|
||||
m_label_synth_version->setText(String("V ") + String(JucePlugin_VersionString) + String(" (DEBUG)"), juce::NotificationType::sendNotification);
|
||||
#else
|
||||
m_label_synth_version->setText(String("V ") + String(JucePlugin_VersionString), true);
|
||||
m_label_synth_version->setText(String("V ") + String(JucePlugin_VersionString), juce::NotificationType::sendNotification);
|
||||
#endif
|
||||
m_btn_noise_enable_led->addListener (this);
|
||||
m_btn_noise_enable_led->setTriggeredOnMouseDown (true);
|
||||
@@ -4210,7 +4210,7 @@ void JaySynthAudioProcessorEditor::labelTextChanged (Label* labelThatHasChanged)
|
||||
if (labelThatHasChanged == m_label_patch_name)
|
||||
{
|
||||
getProcessor()->setCurrentProgramName(labelThatHasChanged->getText());
|
||||
labelThatHasChanged->setText(getProcessor()->getCurrentProgramName(), false);
|
||||
labelThatHasChanged->setText(getProcessor()->getCurrentProgramName(), juce::NotificationType::dontSendNotification);
|
||||
return;
|
||||
}
|
||||
else if (labelThatHasChanged == m_label_patch_number)
|
||||
@@ -5069,7 +5069,7 @@ void JaySynthAudioProcessorEditor::mouseDown (const MouseEvent &m)
|
||||
|
||||
if (m.mods.isRightButtonDown() && !m.mods.isShiftDown())
|
||||
{
|
||||
if (componentThatWasClicked->getComponentID().contains(L"SLIDER"))
|
||||
if (componentThatWasClicked->getComponentID().contains(String("SLIDER")))
|
||||
{
|
||||
switch (paramID)
|
||||
{
|
||||
@@ -5093,7 +5093,7 @@ void JaySynthAudioProcessorEditor::mouseDown (const MouseEvent &m)
|
||||
if (m.mods.isRightButtonDown() && m.mods.isShiftDown())
|
||||
{
|
||||
// Comboboxes don't support midicontroller assignments
|
||||
if (componentThatWasClicked->getComponentID().contains(L"COMBOBOX"))
|
||||
if (componentThatWasClicked->getComponentID().contains(String("COMBOBOX")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -5151,14 +5151,14 @@ void JaySynthAudioProcessorEditor::VelKey_PopUp_event(int event)
|
||||
{
|
||||
case VelKey_PopUp::POPUP_OK:
|
||||
paramID = m_VelKey_PopUp->getParamID();
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), false);
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), juce::NotificationType::dontSendNotification);
|
||||
paramUpdate(paramID, false);
|
||||
deleteAndZero (m_VelKey_PopUp);
|
||||
break;
|
||||
|
||||
case VelKey_PopUp::POPUP_PARAM_CHANGED:
|
||||
paramID = m_VelKey_PopUp->getParamID();
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), false);
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), juce::NotificationType::dontSendNotification);
|
||||
getProcessor()->perVoiceControlChanged(paramID);
|
||||
paramUpdate(paramID, false);
|
||||
break;
|
||||
@@ -5215,7 +5215,7 @@ void JaySynthAudioProcessorEditor::MidiCC_PopUp_event(int event)
|
||||
paramID = m_MidiCC_PopUp->getParamID();
|
||||
getProcessor()->setParam(paramID, m_MidiCC_PopUp->getCurrentParamValue(), false, false);
|
||||
getProcessor()->controlParam(paramID, m_MidiCC_PopUp->getCurrentControlValue());
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), false);
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), juce::NotificationType::dontSendNotification);
|
||||
deleteAndZero (m_MidiCC_PopUp);
|
||||
break;
|
||||
|
||||
@@ -5257,7 +5257,7 @@ void JaySynthAudioProcessorEditor::actionListenerCallback (const String &message
|
||||
if (paramID < 0)
|
||||
break;
|
||||
paramUpdate(paramID, false);
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), false);
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), juce::NotificationType::dontSendNotification);
|
||||
if (m_VelKey_PopUp)
|
||||
m_VelKey_PopUp->setCurrParam(paramID, (float)getProcessor()->getParam(paramID));
|
||||
break;
|
||||
@@ -5289,20 +5289,20 @@ void JaySynthAudioProcessorEditor::actionListenerCallback (const String &message
|
||||
break;
|
||||
|
||||
case JaySynthActionListener::JAYSYNTH_CHANGED_PROGRAM:
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), false);
|
||||
m_label_patch_number->setText(String::formatted("%02d", getProcessor()->getCurrentProgram()), false);
|
||||
m_label_patch_name->setText(getProcessor()->getCurrentProgramName(), juce::NotificationType::dontSendNotification);
|
||||
m_label_patch_number->setText(String::formatted("%02d", getProcessor()->getCurrentProgram()), juce::NotificationType::dontSendNotification);
|
||||
break;
|
||||
|
||||
case JaySynthActionListener::JAYSYNTH_CHANGED_LIMITER:
|
||||
limiter_on = spa.getValue("value", "-1").getIntValue();
|
||||
m_btn_limiter_led->setToggleState(limiter_on != 0, false);
|
||||
m_btn_limiter_led->setToggleState(limiter_on != 0, juce::NotificationType::dontSendNotification);
|
||||
break;
|
||||
|
||||
case JaySynthActionListener::JAYSYNTH_CHANGED_NUM_VOICES_PLAYING:
|
||||
paramID = spa.getValue("value", "-1").getIntValue();
|
||||
if (paramID < 0)
|
||||
break;
|
||||
m_label_num_voices_playing->setText(String::formatted("%d", paramID), false);
|
||||
m_label_num_voices_playing->setText(String::formatted("%d", paramID), juce::NotificationType::dontSendNotification);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -5353,14 +5353,14 @@ void JaySynthAudioProcessorEditor::paramUpdate(int paramID, bool doHostUpdate)
|
||||
pSlider = (Slider*)findChildWithID(String("SLIDER ") + String(paramID));
|
||||
if (pSlider)
|
||||
{
|
||||
pSlider->setValue(getProcessor()->getParameter(paramID), false);
|
||||
pSlider->setValue(getProcessor()->getParameter(paramID), juce::NotificationType::dontSendNotification);
|
||||
pSlider->setColour (Slider::rotarySliderFillColourId, slider_colour);
|
||||
}
|
||||
|
||||
pLabel = (Label*)findChildWithID(String("LABEL ") + String(paramID));
|
||||
if (pLabel)
|
||||
{
|
||||
pLabel->setText((String)getProcessor()->getParameterText(paramID), false);
|
||||
pLabel->setText((String)getProcessor()->getParameterText(paramID), juce::NotificationType::dontSendNotification);
|
||||
pLabel->setColour (Label::textColourId, label_colour);
|
||||
}
|
||||
|
||||
@@ -5370,32 +5370,32 @@ void JaySynthAudioProcessorEditor::paramUpdate(int paramID, bool doHostUpdate)
|
||||
switch(paramID)
|
||||
{
|
||||
case SYNTH_PARAM_OSC_0_FM_SRC_1:
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_0_FM_SRC_OP)), true);
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_0_FM_SRC_OP)), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
case SYNTH_PARAM_OSC_1_FM_SRC_1:
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_1_FM_SRC_OP)), true);
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_1_FM_SRC_OP)), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
case SYNTH_PARAM_OSC_0_AM_SRC_1:
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_0_AM_SRC_OP)), true);
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_0_AM_SRC_OP)), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
case SYNTH_PARAM_OSC_1_AM_SRC_1:
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_1_AM_SRC_OP)), true);
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_1_AM_SRC_OP)), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
case SYNTH_PARAM_OSC_0_PWM_SRC_1:
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_0_PWM_SRC_OP)), true);
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_0_PWM_SRC_OP)), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
case SYNTH_PARAM_OSC_1_PWM_SRC_1:
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_1_PWM_SRC_OP)), true);
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_OSC_1_PWM_SRC_OP)), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
case SYNTH_PARAM_VCF_F_SRC_1:
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_VCF_F_SRC_OP)), true);
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_VCF_F_SRC_OP)), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
case SYNTH_PARAM_VCF_Q_SRC_1:
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_VCF_Q_SRC_OP)), true);
|
||||
pComboBox->setSelectedId(ModSrc1_CB_getIndex((int)getProcessor()->getParam(paramID), (int)getProcessor()->getParam(SYNTH_PARAM_VCF_Q_SRC_OP)), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
|
||||
default:
|
||||
pComboBox->setSelectedId(1 + (int)getProcessor()->getParam(paramID), true);
|
||||
pComboBox->setSelectedId(1 + (int)getProcessor()->getParam(paramID), juce::NotificationType::sendNotification);
|
||||
break;
|
||||
}
|
||||
pComboBox->setColour (ComboBox:: backgroundColourId, combobox_colour);
|
||||
@@ -5404,7 +5404,7 @@ void JaySynthAudioProcessorEditor::paramUpdate(int paramID, bool doHostUpdate)
|
||||
pButton = (Button*)findChildWithID(String("BUTTON ") + String(paramID));
|
||||
if (pButton)
|
||||
{
|
||||
pButton->setToggleState(getProcessor()->getParameter(paramID) > 0.5, false);
|
||||
pButton->setToggleState(getProcessor()->getParameter(paramID) > 0.5, juce::NotificationType::dontSendNotification);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
==============================================================================
|
||||
*/
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "JaySynthMidiCC.h"
|
||||
|
||||
//==============================================================================
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define _JAYSYNTH_MIDICC_
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
|
||||
//==============================================================================
|
||||
#define MIDICONTROLLER_TYPE_VELKEY 0x00000080
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "JaySynthMonophonicMGR.h"
|
||||
|
||||
/** A JaySynth voice that just plays incredible sounds.. */
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define _JAYSYNTHMONOPHONICMGR_H_
|
||||
|
||||
//#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
|
||||
class JaySynthMonophonicMGR
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "JaySynthSound.h"
|
||||
|
||||
JaySynthSound::JaySynthSound()
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define _JAYSYNTHSOUND_H_
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "JaySynthMidiCC.h"
|
||||
|
||||
//==============================================================================
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "JaySynthSound.h"
|
||||
#include "JaySynthVoice.h"
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#define _JAYSYNTHVOICE_H_
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
|
||||
class JaySynthVoice
|
||||
{
|
||||
|
||||
+14
-14
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
//[Headers] You can add your own extra header files here...
|
||||
#include "param_scale.h"
|
||||
#include "synth/param_scale.h"
|
||||
//[/Headers]
|
||||
|
||||
#include "MidiCC_PopUp.h"
|
||||
@@ -147,12 +147,12 @@ MidiCC_PopUp::MidiCC_PopUp (JaySynthMidiCC *pMidiCC, int paramID, synth_float_t
|
||||
GetMax();
|
||||
restoreTestSlider();
|
||||
|
||||
label_MidiCC_ID->setText(String(pMidiCC->getControllerID(pMidiCC_container)), false);
|
||||
label_parameter_name->setText(name, false);
|
||||
label_MidiCC_ID->setText(String(pMidiCC->getControllerID(pMidiCC_container)), juce::NotificationType::dontSendNotification);
|
||||
label_parameter_name->setText(name, juce::NotificationType::dontSendNotification);
|
||||
|
||||
button_assign_enable->setToggleState(pMidiCC->isAssigned(pMidiCC_container), false);
|
||||
button_move_sliders_enable->setToggleState(pMidiCC->doChangeParameter(pMidiCC_container), false);
|
||||
button_apply_on_patch_init->setToggleState(pMidiCC->doApplyOnPatchInit(pMidiCC_container), false);
|
||||
button_assign_enable->setToggleState(pMidiCC->isAssigned(pMidiCC_container), juce::NotificationType::dontSendNotification);
|
||||
button_move_sliders_enable->setToggleState(pMidiCC->doChangeParameter(pMidiCC_container), juce::NotificationType::dontSendNotification);
|
||||
button_apply_on_patch_init->setToggleState(pMidiCC->doApplyOnPatchInit(pMidiCC_container), juce::NotificationType::dontSendNotification);
|
||||
|
||||
button_assign_enable->setTriggeredOnMouseDown (true);
|
||||
button_assign_enable->setClickingTogglesState(true);
|
||||
@@ -355,8 +355,8 @@ void MidiCC_PopUp::labelTextChanged (Label* labelThatHasChanged)
|
||||
{
|
||||
//[UserLabelCode_label_MidiCC_ID] -- add your label text handling code here..
|
||||
pMidiCC->setControllerID(pMidiCC_container, label_MidiCC_ID->getText().getIntValue());
|
||||
label_MidiCC_ID->setText(String(pMidiCC->getControllerID(pMidiCC_container)), false);
|
||||
button_midi_learn->setToggleState(false, false);
|
||||
label_MidiCC_ID->setText(String(pMidiCC->getControllerID(pMidiCC_container)), juce::NotificationType::dontSendNotification);
|
||||
button_midi_learn->setToggleState(false, juce::NotificationType::dontSendNotification);
|
||||
lastMidiCCvalue = pSavedMidiCCinfo[pMidiCC->getControllerID(pMidiCC_container)].value;
|
||||
if (isEnabled())
|
||||
{
|
||||
@@ -426,11 +426,11 @@ void MidiCC_PopUp::GetMin()
|
||||
{
|
||||
if (doChangeParameter())
|
||||
{
|
||||
label_control_min->setText(String(pMidiCC->getParamMin(pMidiCC_container)), false);
|
||||
label_control_min->setText(String(pMidiCC->getParamMin(pMidiCC_container)), juce::NotificationType::dontSendNotification);
|
||||
}
|
||||
else
|
||||
{
|
||||
label_control_min->setText(String(pMidiCC->getControlMin(pMidiCC_container)), false);
|
||||
label_control_min->setText(String(pMidiCC->getControlMin(pMidiCC_container)), juce::NotificationType::dontSendNotification);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,11 +438,11 @@ void MidiCC_PopUp::GetMax()
|
||||
{
|
||||
if (doChangeParameter())
|
||||
{
|
||||
label_control_max->setText(String(pMidiCC->getParamMax(pMidiCC_container)), false);
|
||||
label_control_max->setText(String(pMidiCC->getParamMax(pMidiCC_container)), juce::NotificationType::dontSendNotification);
|
||||
}
|
||||
else
|
||||
{
|
||||
label_control_max->setText(String(pMidiCC->getControlMax(pMidiCC_container)), false);
|
||||
label_control_max->setText(String(pMidiCC->getControlMax(pMidiCC_container)), juce::NotificationType::dontSendNotification);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,7 +484,7 @@ void MidiCC_PopUp::SetMin()
|
||||
break;
|
||||
}
|
||||
|
||||
label_control_min->setText(String(pInfo->pmin), false);
|
||||
label_control_min->setText(String(pInfo->pmin), juce::NotificationType::dontSendNotification);
|
||||
}
|
||||
|
||||
void MidiCC_PopUp::SetMax()
|
||||
@@ -526,7 +526,7 @@ void MidiCC_PopUp::SetMax()
|
||||
break;
|
||||
}
|
||||
|
||||
label_control_max->setText(String(pInfo->pmax), false);
|
||||
label_control_max->setText(String(pInfo->pmax), juce::NotificationType::dontSendNotification);
|
||||
}
|
||||
//[/MiscUserCode]
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
if (!button_midi_learn->getToggleState())
|
||||
return;
|
||||
|
||||
label_MidiCC_ID->setText(String(controllerID), true);
|
||||
label_MidiCC_ID->setText(String(controllerID), juce::NotificationType::sendNotification);
|
||||
}
|
||||
synth_float_t getCurrentControlValue(void)
|
||||
{
|
||||
@@ -128,11 +128,11 @@ public:
|
||||
{
|
||||
if (doChangeParameter())
|
||||
{
|
||||
slider_test->setValue(toSlider(pMidiCC->getParam(pMidiCC_container), (synth_float_t)currentParamValue), true);
|
||||
slider_test->setValue(toSlider(pMidiCC->getParam(pMidiCC_container), (synth_float_t)currentParamValue), juce::NotificationType::sendNotification);
|
||||
}
|
||||
else
|
||||
{
|
||||
slider_test->setValue(toSlider(pMidiCC->getControl(pMidiCC_container), (synth_float_t)currentControlValue), true);
|
||||
slider_test->setValue(toSlider(pMidiCC->getControl(pMidiCC_container), (synth_float_t)currentControlValue), juce::NotificationType::sendNotification);
|
||||
}
|
||||
}
|
||||
void GetMin();
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#include "PluginProcessor.h"
|
||||
#include "JaySynthAudioProcessorEditor.h"
|
||||
#include "vector_utils.h"
|
||||
#include "synth/vector_utils.h"
|
||||
|
||||
JaySynthAudioProcessorEditor* getEditor(JaySynthAudioProcessor *pThis)
|
||||
{
|
||||
@@ -510,8 +510,8 @@ void JaySynthAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer
|
||||
{
|
||||
const int numSamples = buffer.getNumSamples();
|
||||
int i;
|
||||
float *buf1 = buffer.getSampleData (0, 0);
|
||||
float *buf2 = buffer.getSampleData (1, 0);
|
||||
float *buf1 = buffer.getWritePointer (0, 0);
|
||||
float *buf2 = buffer.getWritePointer (1, 0);
|
||||
synth_float_t limiter_env[SYNTH_MAX_BUFSIZE];
|
||||
synth_float_t limiter_gain[SYNTH_MAX_BUFSIZE];
|
||||
synth_float_t buf[2][SYNTH_MAX_BUFSIZE];
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#define __PLUGINPROCESSOR_H_20F201CA__
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "JaySynthSound.h"
|
||||
#include "JaySynth.h"
|
||||
|
||||
@@ -168,7 +168,15 @@ public:
|
||||
const String getOutputChannelName (int channelIndex) const;
|
||||
bool isInputChannelStereoPair (int index) const;
|
||||
bool isOutputChannelStereoPair (int index) const;
|
||||
|
||||
bool silenceInProducesSilenceOut() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
double getTailLengthSeconds() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool acceptsMidi() const;
|
||||
bool producesMidi() const;
|
||||
|
||||
|
||||
+55
-55
@@ -560,20 +560,20 @@ VelKey_PopUp::VelKey_PopUp (JaySynthMidiCC *pMidiCC, int paramID, synth_float_t
|
||||
m_velKey_constraints.scenter = 0.5;
|
||||
m_velKey_constraints.pcenter = -1E18;
|
||||
|
||||
label_parameter_name->setText(name, false);
|
||||
comboBoxOPSel->setSelectedId(1 + pMidiCC->getVelKeyCombineOP(pMidiCC_container), true);
|
||||
label_parameter_name->setText(name, juce::NotificationType::dontSendNotification);
|
||||
comboBoxOPSel->setSelectedId(1 + pMidiCC->getVelKeyCombineOP(pMidiCC_container), juce::NotificationType::sendNotification);
|
||||
|
||||
slider_vel_kexp->setValue(toSlider(&m_shape_xform, pMidiCC->getVelCurve(pMidiCC_container)->kexp), false);
|
||||
slider_vel_scenter->setValue(toSlider(&m_skew_xform, pMidiCC->getVelCurve(pMidiCC_container)->scenter), false);
|
||||
slider_vel_max->setValue(toSlider(&m_velKey_constraints, pMidiCC->getVelCurve(pMidiCC_container)->pmax*m_velKey_constraints.pmax), false);
|
||||
slider_vel_min->setValue(toSlider(&m_velKey_constraints, pMidiCC->getVelCurve(pMidiCC_container)->pmin*m_velKey_constraints.pmax), false);
|
||||
button_vel_assign_enable->setToggleState(pMidiCC->isAssignedVel(pMidiCC_container), false);
|
||||
slider_vel_kexp->setValue(toSlider(&m_shape_xform, pMidiCC->getVelCurve(pMidiCC_container)->kexp), juce::NotificationType::dontSendNotification);
|
||||
slider_vel_scenter->setValue(toSlider(&m_skew_xform, pMidiCC->getVelCurve(pMidiCC_container)->scenter), juce::NotificationType::dontSendNotification);
|
||||
slider_vel_max->setValue(toSlider(&m_velKey_constraints, pMidiCC->getVelCurve(pMidiCC_container)->pmax*m_velKey_constraints.pmax), juce::NotificationType::dontSendNotification);
|
||||
slider_vel_min->setValue(toSlider(&m_velKey_constraints, pMidiCC->getVelCurve(pMidiCC_container)->pmin*m_velKey_constraints.pmax), juce::NotificationType::dontSendNotification);
|
||||
button_vel_assign_enable->setToggleState(pMidiCC->isAssignedVel(pMidiCC_container), juce::NotificationType::dontSendNotification);
|
||||
|
||||
slider_key_kexp->setValue(toSlider(&m_shape_xform, pMidiCC->getKeyCurve(pMidiCC_container)->kexp), false);
|
||||
slider_key_scenter->setValue(toSlider(&m_skew_xform, pMidiCC->getKeyCurve(pMidiCC_container)->scenter), false);
|
||||
slider_key_max->setValue(toSlider(&m_velKey_constraints, pMidiCC->getKeyCurve(pMidiCC_container)->pmax*m_velKey_constraints.pmax), false);
|
||||
slider_key_min->setValue(toSlider(&m_velKey_constraints, pMidiCC->getKeyCurve(pMidiCC_container)->pmin*m_velKey_constraints.pmax), false);
|
||||
button_key_assign_enable->setToggleState(pMidiCC->isAssignedKey(pMidiCC_container), false);
|
||||
slider_key_kexp->setValue(toSlider(&m_shape_xform, pMidiCC->getKeyCurve(pMidiCC_container)->kexp), juce::NotificationType::dontSendNotification);
|
||||
slider_key_scenter->setValue(toSlider(&m_skew_xform, pMidiCC->getKeyCurve(pMidiCC_container)->scenter), juce::NotificationType::dontSendNotification);
|
||||
slider_key_max->setValue(toSlider(&m_velKey_constraints, pMidiCC->getKeyCurve(pMidiCC_container)->pmax*m_velKey_constraints.pmax), juce::NotificationType::dontSendNotification);
|
||||
slider_key_min->setValue(toSlider(&m_velKey_constraints, pMidiCC->getKeyCurve(pMidiCC_container)->pmin*m_velKey_constraints.pmax), juce::NotificationType::dontSendNotification);
|
||||
button_key_assign_enable->setToggleState(pMidiCC->isAssignedKey(pMidiCC_container), juce::NotificationType::dontSendNotification);
|
||||
|
||||
addListener(listener);
|
||||
listeners.call (&VelKey_PopUp_Listener::VelKey_PopUp_event, POPUP_CREATED);
|
||||
@@ -837,8 +837,8 @@ void VelKey_PopUp::buttonClicked (Button* buttonThatWasClicked)
|
||||
curve_max = pMidiCC->getVelCurve(pMidiCC_container)->pmax;
|
||||
pMidiCC->setVelCurveMin(pMidiCC_container, curve_max);
|
||||
pMidiCC->setVelCurveMax(pMidiCC_container, curve_min);
|
||||
slider_vel_max->setValue(toSlider(&m_velKey_constraints, pMidiCC->getVelCurve(pMidiCC_container)->pmax*m_velKey_constraints.pmax), false);
|
||||
slider_vel_min->setValue(toSlider(&m_velKey_constraints, pMidiCC->getVelCurve(pMidiCC_container)->pmin*m_velKey_constraints.pmax), false);
|
||||
slider_vel_max->setValue(toSlider(&m_velKey_constraints, pMidiCC->getVelCurve(pMidiCC_container)->pmax*m_velKey_constraints.pmax), juce::NotificationType::dontSendNotification);
|
||||
slider_vel_min->setValue(toSlider(&m_velKey_constraints, pMidiCC->getVelCurve(pMidiCC_container)->pmin*m_velKey_constraints.pmax), juce::NotificationType::dontSendNotification);
|
||||
|
||||
displayUpdate();
|
||||
listeners.call (&VelKey_PopUp_Listener::VelKey_PopUp_event, POPUP_PARAM_CHANGED);
|
||||
@@ -851,8 +851,8 @@ void VelKey_PopUp::buttonClicked (Button* buttonThatWasClicked)
|
||||
curve_max = pMidiCC->getKeyCurve(pMidiCC_container)->pmax;
|
||||
pMidiCC->setKeyCurveMin(pMidiCC_container, curve_max);
|
||||
pMidiCC->setKeyCurveMax(pMidiCC_container, curve_min);
|
||||
slider_key_max->setValue(toSlider(&m_velKey_constraints, pMidiCC->getKeyCurve(pMidiCC_container)->pmax*m_velKey_constraints.pmax), false);
|
||||
slider_key_min->setValue(toSlider(&m_velKey_constraints, pMidiCC->getKeyCurve(pMidiCC_container)->pmin*m_velKey_constraints.pmax), false);
|
||||
slider_key_max->setValue(toSlider(&m_velKey_constraints, pMidiCC->getKeyCurve(pMidiCC_container)->pmax*m_velKey_constraints.pmax), juce::NotificationType::dontSendNotification);
|
||||
slider_key_min->setValue(toSlider(&m_velKey_constraints, pMidiCC->getKeyCurve(pMidiCC_container)->pmin*m_velKey_constraints.pmax), juce::NotificationType::dontSendNotification);
|
||||
|
||||
displayUpdate();
|
||||
listeners.call (&VelKey_PopUp_Listener::VelKey_PopUp_event, POPUP_PARAM_CHANGED);
|
||||
@@ -872,27 +872,27 @@ void VelKey_PopUp::labelTextChanged (Label* labelThatHasChanged)
|
||||
{
|
||||
//[UserLabelCode_label_vel_ymin] -- add your label text handling code here..
|
||||
if (!m_isFlipped_vel)
|
||||
slider_vel_min->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_vel_min->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
else
|
||||
slider_vel_max->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_vel_max->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
//[/UserLabelCode_label_vel_ymin]
|
||||
}
|
||||
else if (labelThatHasChanged == label_vel_ymax)
|
||||
{
|
||||
//[UserLabelCode_label_vel_ymax] -- add your label text handling code here..
|
||||
if (!m_isFlipped_vel)
|
||||
slider_vel_max->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_vel_max->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
else
|
||||
slider_vel_min->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_vel_min->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
//[/UserLabelCode_label_vel_ymax]
|
||||
}
|
||||
else if (labelThatHasChanged == label_key_ymin)
|
||||
{
|
||||
//[UserLabelCode_label_key_ymin] -- add your label text handling code here..
|
||||
if (!m_isFlipped_key)
|
||||
slider_key_min->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_key_min->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
else
|
||||
slider_key_max->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_key_max->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
|
||||
//[/UserLabelCode_label_key_ymin]
|
||||
}
|
||||
@@ -900,33 +900,33 @@ void VelKey_PopUp::labelTextChanged (Label* labelThatHasChanged)
|
||||
{
|
||||
//[UserLabelCode_label_key_ymax] -- add your label text handling code here..
|
||||
if (!m_isFlipped_key)
|
||||
slider_key_max->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_key_max->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
else
|
||||
slider_key_min->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_key_min->setValue(toSlider(&m_velKey_constraints, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
//[/UserLabelCode_label_key_ymax]
|
||||
}
|
||||
else if (labelThatHasChanged == label_vel_shape)
|
||||
{
|
||||
//[UserLabelCode_label_vel_shape] -- add your label text handling code here..
|
||||
slider_vel_kexp->setValue(toSlider(&m_shape_xform, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_vel_kexp->setValue(toSlider(&m_shape_xform, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
//[/UserLabelCode_label_vel_shape]
|
||||
}
|
||||
else if (labelThatHasChanged == label_vel_skew)
|
||||
{
|
||||
//[UserLabelCode_label_vel_skew] -- add your label text handling code here..
|
||||
slider_vel_scenter->setValue(toSlider(&m_skew_xform, String(labelThatHasChanged->getText()).getFloatValue()/100), true);
|
||||
slider_vel_scenter->setValue(toSlider(&m_skew_xform, String(labelThatHasChanged->getText()).getFloatValue()/100), juce::NotificationType::sendNotification);
|
||||
//[/UserLabelCode_label_vel_skew]
|
||||
}
|
||||
else if (labelThatHasChanged == label_key_shape)
|
||||
{
|
||||
//[UserLabelCode_label_key_shape] -- add your label text handling code here..
|
||||
slider_key_kexp->setValue(toSlider(&m_shape_xform, String(labelThatHasChanged->getText()).getFloatValue()), true);
|
||||
slider_key_kexp->setValue(toSlider(&m_shape_xform, String(labelThatHasChanged->getText()).getFloatValue()), juce::NotificationType::sendNotification);
|
||||
//[/UserLabelCode_label_key_shape]
|
||||
}
|
||||
else if (labelThatHasChanged == label_key_skew)
|
||||
{
|
||||
//[UserLabelCode_label_key_skew] -- add your label text handling code here..
|
||||
slider_key_scenter->setValue(toSlider(&m_skew_xform, String(labelThatHasChanged->getText()).getFloatValue()/100), true);
|
||||
slider_key_scenter->setValue(toSlider(&m_skew_xform, String(labelThatHasChanged->getText()).getFloatValue()/100), juce::NotificationType::sendNotification);
|
||||
//[/UserLabelCode_label_key_skew]
|
||||
}
|
||||
|
||||
@@ -973,24 +973,24 @@ void VelKey_PopUp::displayUpdate(void)
|
||||
|
||||
if (y1 < y2)
|
||||
{
|
||||
label_vel_ymin->setText(String(y1, m_label_prec), false);
|
||||
label_vel_ymax->setText(String(y2, m_label_prec), false);
|
||||
label_vel_max_text->setText(m_text_vel_max, false);
|
||||
label_vel_min_text->setText(m_text_vel_min, false);
|
||||
label_vel_ymin->setText(String(y1, m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
label_vel_ymax->setText(String(y2, m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
label_vel_max_text->setText(m_text_vel_max, juce::NotificationType::dontSendNotification);
|
||||
label_vel_min_text->setText(m_text_vel_min, juce::NotificationType::dontSendNotification);
|
||||
m_isFlipped_vel = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
label_vel_ymin->setText(String(y2, m_label_prec), false);
|
||||
label_vel_ymax->setText(String(y1, m_label_prec), false);
|
||||
label_vel_max_text->setText(m_text_vel_min, false);
|
||||
label_vel_min_text->setText(m_text_vel_max, false);
|
||||
label_vel_ymin->setText(String(y2, m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
label_vel_ymax->setText(String(y1, m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
label_vel_max_text->setText(m_text_vel_min, juce::NotificationType::dontSendNotification);
|
||||
label_vel_min_text->setText(m_text_vel_max, juce::NotificationType::dontSendNotification);
|
||||
m_isFlipped_vel = true;
|
||||
}
|
||||
label_vel_shape->setText(String(pMidiCC->getVelCurve(pMidiCC_container)->kexp, m_label_shape_prec), false);
|
||||
label_vel_skew->setText(String(100*pMidiCC->getVelCurve(pMidiCC_container)->scenter, 1), false);
|
||||
label_vel_x->setText(String(100*m_currentMidiNoteInfo.velocity, 1), false);
|
||||
label_vel_y->setText(String(pMidiCC->getConstraints(pMidiCC_container)->pmax*toParam(pMidiCC->getVelCurve(pMidiCC_container), m_currentMidiNoteInfo.velocity), m_label_prec), false);
|
||||
label_vel_shape->setText(String(pMidiCC->getVelCurve(pMidiCC_container)->kexp, m_label_shape_prec), juce::NotificationType::dontSendNotification);
|
||||
label_vel_skew->setText(String(100*pMidiCC->getVelCurve(pMidiCC_container)->scenter, 1), juce::NotificationType::dontSendNotification);
|
||||
label_vel_x->setText(String(100*m_currentMidiNoteInfo.velocity, 1), juce::NotificationType::dontSendNotification);
|
||||
label_vel_y->setText(String(pMidiCC->getConstraints(pMidiCC_container)->pmax*toParam(pMidiCC->getVelCurve(pMidiCC_container), m_currentMidiNoteInfo.velocity), m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
|
||||
m_graph_vel->SetMarkerX(m_currentMidiNoteInfo.velocity);
|
||||
m_graph_vel->Draw(pMidiCC->getVelCurve(pMidiCC_container)->pmin, pMidiCC->getVelCurve(pMidiCC_container)->pmax, pMidiCC->getVelCurve(pMidiCC_container));
|
||||
@@ -1000,27 +1000,27 @@ void VelKey_PopUp::displayUpdate(void)
|
||||
|
||||
if (y1 < y2)
|
||||
{
|
||||
label_key_ymin->setText(String(y1, m_label_prec), false);
|
||||
label_key_ymax->setText(String(y2, m_label_prec), false);
|
||||
label_key_max_text->setText(m_text_key_max, false);
|
||||
label_key_min_text->setText(m_text_key_min, false);
|
||||
label_key_ymin->setText(String(y1, m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
label_key_ymax->setText(String(y2, m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
label_key_max_text->setText(m_text_key_max, juce::NotificationType::dontSendNotification);
|
||||
label_key_min_text->setText(m_text_key_min, juce::NotificationType::dontSendNotification);
|
||||
m_isFlipped_key = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
label_key_ymin->setText(String(y2, m_label_prec), false);
|
||||
label_key_ymax->setText(String(y1, m_label_prec), false);
|
||||
label_key_max_text->setText(m_text_key_min, false);
|
||||
label_key_min_text->setText(m_text_key_max, false);
|
||||
label_key_ymin->setText(String(y2, m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
label_key_ymax->setText(String(y1, m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
label_key_max_text->setText(m_text_key_min, juce::NotificationType::dontSendNotification);
|
||||
label_key_min_text->setText(m_text_key_max, juce::NotificationType::dontSendNotification);
|
||||
m_isFlipped_key = true;
|
||||
}
|
||||
label_key_shape->setText(String(pMidiCC->getKeyCurve(pMidiCC_container)->kexp, m_label_shape_prec), false);
|
||||
label_key_skew->setText(String(100*pMidiCC->getKeyCurve(pMidiCC_container)->scenter, 1), false);
|
||||
// label_key_x->setText(String(100*(float)m_currentMidiNoteInfo.note/127, 1), false);
|
||||
label_key_x0->setText(getNoteName(0), false);
|
||||
label_key_x100->setText(getNoteName(127), false);
|
||||
label_key_x->setText(getNoteName(m_currentMidiNoteInfo.note), false);
|
||||
label_key_y->setText(String(pMidiCC->getConstraints(pMidiCC_container)->pmax*toParam(pMidiCC->getKeyCurve(pMidiCC_container), (float)m_currentMidiNoteInfo.note/127), m_label_prec), false);
|
||||
label_key_shape->setText(String(pMidiCC->getKeyCurve(pMidiCC_container)->kexp, m_label_shape_prec), juce::NotificationType::dontSendNotification);
|
||||
label_key_skew->setText(String(100*pMidiCC->getKeyCurve(pMidiCC_container)->scenter, 1), juce::NotificationType::dontSendNotification);
|
||||
// label_key_x->setText(String(100*(float)m_currentMidiNoteInfo.note/127, 1), juce::NotificationType::dontSendNotification);
|
||||
label_key_x0->setText(getNoteName(0), juce::NotificationType::dontSendNotification);
|
||||
label_key_x100->setText(getNoteName(127), juce::NotificationType::dontSendNotification);
|
||||
label_key_x->setText(getNoteName(m_currentMidiNoteInfo.note), juce::NotificationType::dontSendNotification);
|
||||
label_key_y->setText(String(pMidiCC->getConstraints(pMidiCC_container)->pmax*toParam(pMidiCC->getKeyCurve(pMidiCC_container), (float)m_currentMidiNoteInfo.note/127), m_label_prec), juce::NotificationType::dontSendNotification);
|
||||
|
||||
m_graph_key->SetMarkerX((float)m_currentMidiNoteInfo.note/127);
|
||||
m_graph_key->Draw(pMidiCC->getKeyCurve(pMidiCC_container)->pmin, pMidiCC->getKeyCurve(pMidiCC_container)->pmax, pMidiCC->getKeyCurve(pMidiCC_container));
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
//[Headers] -- You can add your own extra header files here --
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
#include "PluginProcessor.h"
|
||||
class VelKey_PopUp_Listener
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
//[Headers] -- You can add your own extra header files here --
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "synth_defs.h"
|
||||
#include "synth/synth_defs.h"
|
||||
//[/Headers]
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
// --------------------------------------------------------------
|
||||
#define SINE_TABLE_START_INDEX 2
|
||||
#define COSINE_TABLE_START_INDEX 2
|
||||
#define EXP_TABLE_START_INDEX 0
|
||||
|
||||
// --------------------------------------------------------------
|
||||
#include <math.h>
|
||||
#include "synth_defs.h"
|
||||
|
||||
// Taylor series coefficent for cos(pi*x)
|
||||
// In this table x is premultiplied with pi!
|
||||
static const synth_float_t _sg_cos_pmpi_lut[] =
|
||||
{
|
||||
1.92957430940392e-003,
|
||||
-25.8068913900141e-003,
|
||||
235.330630358893e-003,
|
||||
-1.33526276885459e+000,
|
||||
4.05871212641677e+000,
|
||||
-4.93480220054468e+000,
|
||||
1.00000000000000e+000
|
||||
|
||||
};
|
||||
|
||||
// Taylor series coefficent for sin(x)
|
||||
static const synth_float_t _sg_sin_lut[] =
|
||||
{
|
||||
1.605904383682161e-010,
|
||||
-2.505210838544172e-008,
|
||||
2.755731922398589e-006,
|
||||
-1.984126984126984e-004,
|
||||
8.333333333333333e-003,
|
||||
-1.666666666666667e-001,
|
||||
1.000000000000000e+000
|
||||
};
|
||||
|
||||
// Taylor series coefficent for sin(x)
|
||||
static const synth_float_t _sg_cos_lut[] =
|
||||
{
|
||||
2.087675698786810e-009,
|
||||
-2.755731922398589e-007,
|
||||
2.480158730158730e-005,
|
||||
-1.388888888888889e-003,
|
||||
4.166666666666666e-002,
|
||||
-5.000000000000000e-001,
|
||||
1.000000000000000e+000
|
||||
};
|
||||
|
||||
// Taylor series coefficent for sin(x)
|
||||
static const synth_float_t _sg_exp_lut[] =
|
||||
{
|
||||
1.984126984126984e-004,
|
||||
1.388888888888889e-003,
|
||||
8.333333333333333e-003,
|
||||
4.166666666666666e-002,
|
||||
1.666666666666667e-001,
|
||||
5.000000000000000e-001,
|
||||
1.000000000000000e+000,
|
||||
1.000000000000000e+000
|
||||
};
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Exported functions
|
||||
// --------------------------------------------------------------
|
||||
// Cos (pi*x)
|
||||
synth_float_t FastTrig_cos_premult_pi(synth_float_t x)
|
||||
{
|
||||
int i, yneg;
|
||||
synth_float_t y, xx;
|
||||
|
||||
yneg = 0;
|
||||
|
||||
if (x < 0)
|
||||
x = -x;
|
||||
|
||||
if (x > (synth_float_t)0.5)
|
||||
{
|
||||
if (x > (synth_float_t)1.5)
|
||||
{
|
||||
x = (synth_float_t)2. - x;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = (synth_float_t)1. - x;
|
||||
yneg = 1;
|
||||
}
|
||||
}
|
||||
xx = x*x;
|
||||
y = _sg_cos_pmpi_lut[0];
|
||||
|
||||
for (i=1; i < sizeof(_sg_cos_pmpi_lut)/sizeof(synth_float_t); i++)
|
||||
y = y * xx + _sg_cos_pmpi_lut[i];
|
||||
|
||||
if (yneg)
|
||||
y = -y;
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
// sin (x)
|
||||
// Best in range -0.5*pi .. +0.5*pi
|
||||
synth_float_t FastTrig_sin(synth_float_t x)
|
||||
{
|
||||
int i = SINE_TABLE_START_INDEX;
|
||||
synth_float_t xx, y;
|
||||
|
||||
xx = x*x;
|
||||
y = _sg_sin_lut[i++];
|
||||
|
||||
for (i=i; i < sizeof(_sg_sin_lut)/sizeof(synth_float_t); i++)
|
||||
y = y * xx + _sg_sin_lut[i];
|
||||
|
||||
return y * x;
|
||||
}
|
||||
|
||||
// cos (x)
|
||||
// Best in range -0.5*pi .. +0.5*pi
|
||||
synth_float_t FastTrig_cos(synth_float_t x)
|
||||
{
|
||||
int i = COSINE_TABLE_START_INDEX;
|
||||
synth_float_t xx, y;
|
||||
|
||||
xx = x*x;
|
||||
y = _sg_cos_lut[i++];
|
||||
|
||||
for (i=i; i < sizeof(_sg_cos_lut)/sizeof(synth_float_t); i++)
|
||||
y = y * xx + _sg_cos_lut[i];
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
// exp (x)
|
||||
synth_float_t FastTrig_exp(synth_float_t x)
|
||||
{
|
||||
int i = EXP_TABLE_START_INDEX;
|
||||
synth_float_t y;
|
||||
|
||||
y = _sg_exp_lut[i++];
|
||||
|
||||
for (i=i; i < sizeof(_sg_exp_lut)/sizeof(synth_float_t); i++)
|
||||
y = y * x + _sg_exp_lut[i];
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
// exp (x) - 1
|
||||
synth_float_t FastTrig_exp_minus_1(synth_float_t x)
|
||||
{
|
||||
int i = EXP_TABLE_START_INDEX;
|
||||
synth_float_t y;
|
||||
|
||||
y = _sg_exp_lut[i++];
|
||||
|
||||
for (i=i; i < sizeof(_sg_exp_lut)/sizeof(synth_float_t)-1; i++)
|
||||
y = y * x + _sg_exp_lut[i];
|
||||
|
||||
return y*x;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// --------------------------------------------------------------
|
||||
#ifndef _FAST_TRIG_H_
|
||||
#define _FAST_TRIG_H_
|
||||
|
||||
#include "synth_types.h"
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Types
|
||||
// --------------------------------------------------------------
|
||||
|
||||
// --------------------------------------------------------------
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// --------------------------------------------------------------
|
||||
// Exported functions
|
||||
// --------------------------------------------------------------
|
||||
synth_float_t FastTrig_cos_premult_pi(synth_float_t x);
|
||||
synth_float_t FastTrig_sin(synth_float_t x);
|
||||
synth_float_t FastTrig_cos(synth_float_t x);
|
||||
synth_float_t FastTrig_exp(synth_float_t x);
|
||||
synth_float_t FastTrig_exp_minus_1(synth_float_t x);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
||||
#endif
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#endif // _FAST_TRIG_H_
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "synth_defs.h"
|
||||
#include "vcf.h"
|
||||
#include "fast_trig/fast_trig.h"
|
||||
#include "fast_trig.h"
|
||||
|
||||
/*************************************************************************/
|
||||
/* Global Variables */
|
||||
|
||||
Reference in New Issue
Block a user