pull/1/head
asb2m10 11 years ago
parent 4aa85852c9
commit 5b8add06dd
  1. BIN
      Builds/MacOSX/Dexed.xcodeproj/project.xcworkspace/xcuserdata/asb2m10.xcuserdatad/UserInterfaceState.xcuserstate
  2. 101
      Dexed.jucer
  3. 12
      Source/GlobalEditor.cpp
  4. 155
      Source/OperatorEditor.cpp
  5. 6
      Source/OperatorEditor.h
  6. 15
      Source/PluginEditor.cpp
  7. 2
      Source/PluginEditor.h
  8. 45
      Source/PluginParam.cpp
  9. 1
      Source/PluginParam.h
  10. 21
      Source/PluginProcessor.cpp
  11. 10
      Source/PluginProcessor.h
  12. 14
      Source/msfa/dx7note.cc
  13. 1
      Source/msfa/dx7note.h

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT id="ryFHHI" name="Dexed" projectType="audioplug" version="1.0.0"
bundleIdentifier="com.digitalsuburban.Dexed" includeBinaryInAppConfig="1"
buildVST="1" buildAU="0" pluginName="Dexed" pluginDesc="Dexed"
pluginManufacturer="Digital Suburban" pluginManufacturerCode="Manu"
pluginCode="Plug" pluginChannelConfigs="{1, 1}, {2, 2}" pluginIsSynth="1"
pluginWantsMidiIn="1" pluginProducesMidiOut="0" pluginSilenceInIsSilenceOut="0"
pluginEditorRequiresKeys="0" pluginAUExportPrefix="DexedAU" pluginRTASCategory=""
aaxIdentifier="com.yourcompany.Dexed" pluginAAXCategory="AAX_ePlugInCategory_Dynamics"
jucerVersion="3.1.0" companyName="Digital Suburban">
<MAINGROUP id="kHXTgw" name="Dexed">
<GROUP id="{F12593AE-639A-6F59-5819-ACE25AF86F95}" name="Resources">
<FILE id="CGMSPp" name="startup.syx" compile="0" resource="1" file="Resources/startup.syx"/>
</GROUP>
<GROUP id="{EA38D88A-6B79-E394-8B57-FA22D50C4D86}" name="Source">
<FILE id="thAIGQ" name="GlobalEditor.cpp" compile="1" resource="0"
file="Source/GlobalEditor.cpp"/>
<FILE id="CxMFcr" name="GlobalEditor.h" compile="0" resource="0" file="Source/GlobalEditor.h"/>
<FILE id="oUObPG" name="OperatorEditor.cpp" compile="1" resource="0"
file="Source/OperatorEditor.cpp"/>
<FILE id="ChJDca" name="OperatorEditor.h" compile="0" resource="0"
file="Source/OperatorEditor.h"/>
<GROUP id="{CEBA9AF6-1C73-85F6-A187-56A246098441}" name="msfa">
<FILE id="wvG22S" name="freqlut.cc" compile="1" resource="0" file="Source/msfa/freqlut.cc"/>
<FILE id="dulZMd" name="freqlut.h" compile="0" resource="0" file="Source/msfa/freqlut.h"/>
<FILE id="BfOVi6" name="lfo.cc" compile="1" resource="0" file="Source/msfa/lfo.cc"/>
<FILE id="dKoqx3" name="lfo.h" compile="0" resource="0" file="Source/msfa/lfo.h"/>
<FILE id="aF0JXv" name="aligned_buf.h" compile="0" resource="0" file="Source/msfa/aligned_buf.h"/>
<FILE id="iz2SFe" name="controllers.h" compile="0" resource="0" file="Source/msfa/controllers.h"/>
<FILE id="RuUFNI" name="dx7note.cc" compile="1" resource="0" file="Source/msfa/dx7note.cc"/>
<FILE id="BtBx4i" name="dx7note.h" compile="0" resource="0" file="Source/msfa/dx7note.h"/>
<FILE id="zXxFAq" name="env.cc" compile="1" resource="0" file="Source/msfa/env.cc"/>
<FILE id="jxtMqi" name="env.h" compile="0" resource="0" file="Source/msfa/env.h"/>
<FILE id="DsSBXO" name="exp2.cc" compile="1" resource="0" file="Source/msfa/exp2.cc"/>
<FILE id="ZOk50T" name="exp2.h" compile="0" resource="0" file="Source/msfa/exp2.h"/>
<FILE id="U8mKoJ" name="fm_core.cc" compile="1" resource="0" file="Source/msfa/fm_core.cc"/>
<FILE id="pR7RSB" name="fm_core.h" compile="0" resource="0" file="Source/msfa/fm_core.h"/>
<FILE id="USTZRs" name="fm_op_kernel.cc" compile="1" resource="0" file="Source/msfa/fm_op_kernel.cc"/>
<FILE id="BSgkNU" name="fm_op_kernel.h" compile="0" resource="0" file="Source/msfa/fm_op_kernel.h"/>
<FILE id="qdGaN5" name="module.h" compile="0" resource="0" file="Source/msfa/module.h"/>
<FILE id="yQIN5Y" name="pitchenv.cc" compile="1" resource="0" file="Source/msfa/pitchenv.cc"/>
<FILE id="Hfa2Et" name="pitchenv.h" compile="0" resource="0" file="Source/msfa/pitchenv.h"/>
<FILE id="eMP01b" name="sin.cc" compile="1" resource="0" file="Source/msfa/sin.cc"/>
<FILE id="TGO2sW" name="sin.h" compile="0" resource="0" file="Source/msfa/sin.h"/>
<FILE id="SqG02X" name="synth.h" compile="0" resource="0" file="Source/msfa/synth.h"/>
</GROUP>
<FILE id="TgCdkS" name="DXLookNFeel.cpp" compile="1" resource="0" file="Source/DXLookNFeel.cpp"/>
<FILE id="V4bLcd" name="DXLookNFeel.h" compile="0" resource="0" file="Source/DXLookNFeel.h"/>
<FILE id="Yp2cX4" name="PluginProcessor.cpp" compile="1" resource="0"
file="Source/PluginProcessor.cpp"/>
<FILE id="ob0Eek" name="PluginProcessor.h" compile="0" resource="0"
file="Source/PluginProcessor.h"/>
<FILE id="Ec211k" name="PluginEditor.cpp" compile="1" resource="0"
file="Source/PluginEditor.cpp"/>
<FILE id="lZFsG0" name="PluginEditor.h" compile="0" resource="0" file="Source/PluginEditor.h"/>
<FILE id="ZRipB1" name="PluginParam.cpp" compile="1" resource="0" file="Source/PluginParam.cpp"/>
<FILE id="uqNUvy" name="PluginParam.h" compile="0" resource="0" file="Source/PluginParam.h"/>
</GROUP>
</MAINGROUP>
<EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/Documents/src/vstsdk2.4"
postbuildCommand="&#13;&#10;# This script takes the build product and copies it to the AU, VST, and RTAS folders, depending on &#13;&#10;# which plugin types you've built&#13;&#10;&#13;&#10;original=$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME&#13;&#10;&#13;&#10;# this looks inside the binary to detect which platforms are needed.. &#13;&#10;copyAU=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'AudioUnit' | wc -l&#96;&#13;&#10;copyVST=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'VSTPlugin' | wc -l&#96;&#13;&#10;copyRTAS=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'CProcess' | wc -l&#96;&#13;&#10;copyAAX=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'ACFStartup' | wc -l&#96;&#13;&#10;&#13;&#10;if [ $copyAU -gt 0 ]; then&#13;&#10; echo &quot;Copying to AudioUnit folder...&quot;&#13;&#10; AU=~/Library/Audio/Plug-Ins/Components/$PRODUCT_NAME.component&#13;&#10; if [ -d &quot;$AU&quot; ]; then &#13;&#10; rm -r &quot;$AU&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$AU&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMwPTul/BNDLPTul/g' &quot;$AU/Contents/PkgInfo&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMw/BNDL/g' &quot;$AU/Contents/$INFOPLIST_FILE&quot;&#13;&#10;&#13;&#10; # Fix info.plist for AUs built with Xcode 3&#13;&#10; if [ -f &quot;$DEVELOPER_DIR/Library/Developer/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp&quot; ]; then&#13;&#10; echo&#13;&#10; else&#13;&#10; echo &quot;Removing AudioComponents entry from Info.plist because this is not a new-format AU&quot;&#13;&#10; /usr/libexec/PlistBuddy -c &quot;Delete AudioComponents&quot; &quot;$AU/Contents/Info.plist&quot;&#13;&#10; fi&#13;&#10;fi&#13;&#10;&#13;&#10;if [ $copyVST -gt 0 ]; then&#13;&#10; echo &quot;Copying to VST folder...&quot;&#13;&#10; VST=~/Library/Audio/Plug-Ins/VST/$PRODUCT_NAME.vst&#13;&#10; if [ -d &quot;$VST&quot; ]; then &#13;&#10; rm -r &quot;$VST&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$VST&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMwPTul/BNDLPTul/g' &quot;$VST/Contents/PkgInfo&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMw/BNDL/g' &quot;$VST/Contents/$INFOPLIST_FILE&quot;&#13;&#10;fi&#13;&#10;&#13;&#10;if [ $copyRTAS -gt 0 ]; then&#13;&#10; echo &quot;Copying to RTAS folder...&quot;&#13;&#10; RTAS=/Library/Application\ Support/Digidesign/Plug-Ins/$PRODUCT_NAME.dpm&#13;&#10; if [ -d &quot;$RTAS&quot; ]; then&#13;&#10; rm -r &quot;$RTAS&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$RTAS&quot;&#13;&#10;fi&#13;&#10;&#13;&#10;if [ $copyAAX -gt 0 ]; then&#13;&#10; echo &quot;Copying to AAX folder...&quot;&#13;&#10;&#13;&#10; if [ -d &quot;/Applications/ProTools_3PDev/Plug-Ins&quot; ]; then&#13;&#10; AAX1=&quot;/Applications/ProTools_3PDev/Plug-Ins/$PRODUCT_NAME.aaxplugin&quot;&#13;&#10;&#13;&#10; if [ -d &quot;$AAX1&quot; ]; then&#13;&#10; rm -r &quot;$AAX1&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$AAX1&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; if [ -d &quot;/Library/Application Support/Avid/Audio/Plug-Ins&quot; ]; then&#13;&#10; AAX2=&quot;/Library/Application Support/Avid/Audio/Plug-Ins/$PRODUCT_NAME.aaxplugin&quot;&#13;&#10;&#13;&#10; if [ -d &quot;$AAX2&quot; ]; then&#13;&#10; rm -r &quot;$AAX2&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$AAX2&quot;&#13;&#10; fi&#13;&#10;fi&#13;&#10;">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" osxSDK="default" osxCompatibility="default" osxArchitecture="default"
isDebug="1" optimisation="1" targetName="Dexed"/>
<CONFIGURATION name="Release" osxSDK="default" osxCompatibility="default" osxArchitecture="default"
isDebug="0" optimisation="2" targetName="Dexed"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_core" path="../JUCE/modules"/>
<MODULEPATH id="juce_events" path="../JUCE/modules"/>
<MODULEPATH id="juce_graphics" path="../JUCE/modules"/>
<MODULEPATH id="juce_data_structures" path="../JUCE/modules"/>
<MODULEPATH id="juce_gui_basics" path="../JUCE/modules"/>
<MODULEPATH id="juce_gui_extra" path="../JUCE/modules"/>
<MODULEPATH id="juce_audio_basics" path="../JUCE/modules"/>
<MODULEPATH id="juce_audio_devices" path="../JUCE/modules"/>
<MODULEPATH id="juce_audio_formats" path="../JUCE/modules"/>
<MODULEPATH id="juce_audio_processors" path="../JUCE/modules"/>
<MODULEPATH id="juce_audio_plugin_client" path="../JUCE/modules"/>
<MODULEPATH id="juce_audio_utils" path="../JUCE/modules"/>
</MODULEPATHS>
</XCODE_MAC>
</EXPORTFORMATS>
<MODULES>
<MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_audio_devices" showAllCode="0" useLocalCopy="1"/>
<MODULES id="juce_audio_formats" showAllCode="0" useLocalCopy="1"/>
<MODULES id="juce_audio_plugin_client" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_audio_processors" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_audio_utils" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_core" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_data_structures" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_events" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_graphics" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_gui_basics" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_gui_extra" showAllCode="1" useLocalCopy="1"/>
</MODULES>
<JUCEOPTIONS JUCE_QUICKTIME="disabled"/>
</JUCERPROJECT>

@ -113,10 +113,10 @@ void GlobalEditor::paint (Graphics& g)
void GlobalEditor::resized()
{
algo->setBounds (8, 8, 64, 24);
lfoType->setBounds (144, 40, 96, 24);
lfoType->setBounds (168, 24, 72, 16);
lfoSpeed->setBounds (80, 8, 23, 56);
lfoAmDepth->setBounds (208, 8, 32, 24);
lfoPitchDepth->setBounds (176, 8, 32, 24);
lfoAmDepth->setBounds (216, 40, 32, 24);
lfoPitchDepth->setBounds (184, 40, 32, 24);
lfoDelay->setBounds (104, 8, 23, 56);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
@ -207,7 +207,7 @@ BEGIN_JUCER_METADATA
style="Rotary" textBoxPos="TextBoxLeft" textBoxEditable="0" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<COMBOBOX name="new combo box" id="31018596af3b34e9" memberName="lfoType"
virtualName="" explicitFocusOrder="0" pos="144 40 96 24" editable="0"
virtualName="" explicitFocusOrder="0" pos="168 24 72 16" editable="0"
layout="33" items="TRIANGLE&#10;SAW DOWN&#10;SAW UP&#10;SQUARE&#10;SINE&#10;S&amp;HOLD"
textWhenNonSelected="" textWhenNoItems="(no choices)"/>
<SLIDER name="lfoSpeed" id="b10eaf327ab3bff5" memberName="lfoSpeed" virtualName=""
@ -215,11 +215,11 @@ BEGIN_JUCER_METADATA
style="LinearVertical" textBoxPos="NoTextBox" textBoxEditable="1"
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<SLIDER name="new slider" id="3e95a6206fa4a891" memberName="lfoAmDepth"
virtualName="" explicitFocusOrder="0" pos="208 8 32 24" min="0"
virtualName="" explicitFocusOrder="0" pos="216 40 32 24" min="0"
max="99" int="1" style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1"
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<SLIDER name="new slider" id="6ead769ca786c813" memberName="lfoPitchDepth"
virtualName="" explicitFocusOrder="0" pos="176 8 32 24" min="0"
virtualName="" explicitFocusOrder="0" pos="184 40 32 24" min="0"
max="99" int="1" style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1"
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<SLIDER name="lfoDelay" id="1fce68dc81619ef5" memberName="lfoDelay" virtualName=""

@ -30,53 +30,52 @@
OperatorEditor::OperatorEditor ()
{
addAndMakeVisible (s_egl1 = new Slider ("egl1"));
s_egl1->setRange (0, 99, 0);
s_egl1->setRange (0, 99, 1);
s_egl1->setSliderStyle (Slider::Rotary);
s_egl1->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egl1->addListener (this);
addAndMakeVisible (toggleButton = new ToggleButton ("new toggle button"));
toggleButton->setButtonText (String::empty);
toggleButton->addListener (this);
addAndMakeVisible (s_egl2 = new Slider ("egl2"));
s_egl2->setRange (0, 99, 0);
s_egl2->setRange (0, 99, 1);
s_egl2->setSliderStyle (Slider::Rotary);
s_egl2->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egl2->addListener (this);
addAndMakeVisible (s_egl3 = new Slider ("egl3"));
s_egl3->setRange (0, 99, 0);
s_egl3->setRange (0, 99, 1);
s_egl3->setSliderStyle (Slider::Rotary);
s_egl3->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egl3->addListener (this);
addAndMakeVisible (s_egl4 = new Slider ("egl4"));
s_egl4->setRange (0, 99, 0);
s_egl4->setRange (0, 99, 1);
s_egl4->setSliderStyle (Slider::Rotary);
s_egl4->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egl4->addListener (this);
addAndMakeVisible (s_egv1 = new Slider ("egr1"));
s_egv1->setRange (0, 99, 0);
s_egv1->setRange (0, 99, 1);
s_egv1->setSliderStyle (Slider::Rotary);
s_egv1->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egv1->addListener (this);
addAndMakeVisible (s_egv2 = new Slider ("egr3"));
s_egv2->setRange (0, 99, 0);
s_egv2->setRange (0, 99, 1);
s_egv2->setSliderStyle (Slider::Rotary);
s_egv2->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egv2->addListener (this);
addAndMakeVisible (s_egv3 = new Slider ("egr3"));
s_egv3->setRange (0, 99, 0);
s_egv3->setRange (0, 99, 1);
s_egv3->setSliderStyle (Slider::Rotary);
s_egv3->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egv3->addListener (this);
addAndMakeVisible (s_egv4 = new Slider ("egr4"));
s_egv4->setRange (0, 99, 0);
s_egv4->setRange (0, 99, 1);
s_egv4->setSliderStyle (Slider::Rotary);
s_egv4->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egv4->addListener (this);
@ -86,32 +85,32 @@ OperatorEditor::OperatorEditor ()
opMode->setJustificationType (Justification::centredLeft);
opMode->setTextWhenNothingSelected (String::empty);
opMode->setTextWhenNoChoicesAvailable ("(no choices)");
opMode->addItem ("FIXED", 1);
opMode->addItem ("COARSE", 2);
opMode->addItem ("RATIO", 1);
opMode->addItem ("FIXED", 2);
opMode->addListener (this);
addAndMakeVisible (opId = new Label ("new label",
"OP1"));
opId->setFont (Font (19.60f, Font::plain));
opId->setFont (Font (9.30f, Font::plain));
opId->setJustificationType (Justification::centredLeft);
opId->setEditable (false, false, false);
opId->setColour (TextEditor::textColourId, Colours::black);
opId->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
addAndMakeVisible (opLevel = new Slider ("opLevel"));
opLevel->setRange (0, 99, 0);
opLevel->setRange (0, 99, 1);
opLevel->setSliderStyle (Slider::Rotary);
opLevel->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
opLevel->addListener (this);
addAndMakeVisible (opFine = new Slider ("opFine"));
opFine->setRange (0, 99, 0);
opFine->setRange (0, 99, 1);
opFine->setSliderStyle (Slider::Rotary);
opFine->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
opFine->addListener (this);
addAndMakeVisible (opCoarse = new Slider ("opCoarse"));
opCoarse->setRange (0, 32, 0);
opCoarse->setRange (0, 31, 1);
opCoarse->setSliderStyle (Slider::Rotary);
opCoarse->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
opCoarse->addListener (this);
@ -122,6 +121,21 @@ OperatorEditor::OperatorEditor ()
gain->setTextBoxStyle (Slider::NoTextBox, true, 80, 20);
gain->addListener (this);
addAndMakeVisible (khzDisplay = new Label ("khz",
"1,000 kHz"));
khzDisplay->setFont (Font (16.60f, Font::plain));
khzDisplay->setJustificationType (Justification::centred);
khzDisplay->setEditable (false, false, false);
khzDisplay->setColour (Label::outlineColourId, Colour (0x00000000));
khzDisplay->setColour (TextEditor::textColourId, Colours::black);
khzDisplay->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
addAndMakeVisible (detune = new Slider ("detune"));
detune->setRange (0, 14, 1);
detune->setSliderStyle (Slider::LinearHorizontal);
detune->setTextBoxStyle (Slider::NoTextBox, true, 80, 20);
detune->addListener (this);
//[UserPreSize]
//[/UserPreSize]
@ -153,6 +167,8 @@ OperatorEditor::~OperatorEditor()
opFine = nullptr;
opCoarse = nullptr;
gain = nullptr;
khzDisplay = nullptr;
detune = nullptr;
//[Destructor]. You can add your own custom destruction code here..
@ -172,7 +188,7 @@ void OperatorEditor::paint (Graphics& g)
void OperatorEditor::resized()
{
s_egl1->setBounds (128, 8, 24, 24);
toggleButton->setBounds (0, 0, 24, 24);
toggleButton->setBounds (-8, 56, 24, 24);
s_egl2->setBounds (152, 8, 24, 24);
s_egl3->setBounds (176, 8, 24, 24);
s_egl4->setBounds (200, 8, 24, 24);
@ -180,12 +196,14 @@ void OperatorEditor::resized()
s_egv2->setBounds (152, 40, 24, 24);
s_egv3->setBounds (176, 40, 24, 24);
s_egv4->setBounds (200, 40, 24, 24);
opMode->setBounds (48, 8, 72, 24);
opId->setBounds (0, 8, 47, 24);
opLevel->setBounds (8, 40, 24, 24);
opFine->setBounds (96, 40, 24, 24);
opCoarse->setBounds (72, 40, 24, 24);
opMode->setBounds (40, 48, 80, 16);
opId->setBounds (0, 0, 24, 16);
opLevel->setBounds (0, 32, 32, 40);
opFine->setBounds (96, 24, 24, 24);
opCoarse->setBounds (72, 24, 24, 24);
gain->setBounds (224, 0, 24, 64);
khzDisplay->setBounds (8, 8, 112, 16);
detune->setBounds (32, 24, 40, 24);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
@ -243,11 +261,13 @@ void OperatorEditor::sliderValueChanged (Slider* sliderThatWasMoved)
else if (sliderThatWasMoved == opFine)
{
//[UserSliderCode_opFine] -- add your slider handling code here..
updateFreqDisplay();
//[/UserSliderCode_opFine]
}
else if (sliderThatWasMoved == opCoarse)
{
//[UserSliderCode_opCoarse] -- add your slider handling code here..
updateFreqDisplay();
//[/UserSliderCode_opCoarse]
}
else if (sliderThatWasMoved == gain)
@ -255,24 +275,15 @@ void OperatorEditor::sliderValueChanged (Slider* sliderThatWasMoved)
//[UserSliderCode_gain] -- add your slider handling code here..
//[/UserSliderCode_gain]
}
//[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post]
}
void OperatorEditor::buttonClicked (Button* buttonThatWasClicked)
{
//[UserbuttonClicked_Pre]
//[/UserbuttonClicked_Pre]
if (buttonThatWasClicked == toggleButton)
else if (sliderThatWasMoved == detune)
{
//[UserButtonCode_toggleButton] -- add your button handler code here..
//[/UserButtonCode_toggleButton]
//[UserSliderCode_detune] -- add your slider handling code here..
updateFreqDisplay();
//[/UserSliderCode_detune]
}
//[UserbuttonClicked_Post]
//[/UserbuttonClicked_Post]
//[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post]
}
void OperatorEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
@ -283,6 +294,7 @@ void OperatorEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
if (comboBoxThatHasChanged == opMode)
{
//[UserComboBoxCode_opMode] -- add your combo box handling code here..
updateFreqDisplay();
//[/UserComboBoxCode_opMode]
}
@ -293,10 +305,7 @@ void OperatorEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
//[MiscUserCode] You can add your own definitions of your custom methods or any other code here...
void OperatorEditor::bind(DexedAudioProcessor *parent, int op) {
// TODO: set operator number
int targetNum = op+1;
String text = "op";
@ -320,12 +329,37 @@ void OperatorEditor::bind(DexedAudioProcessor *parent, int op) {
parent->opCtrl[op].opMode->bind(opMode);
parent->opCtrl[op].fine->bind(opFine);
parent->opCtrl[op].coarse->bind(opCoarse);
parent->opCtrl[op].detune->bind(detune);
}
void OperatorEditor::updateGain(float v) {
gain->setValue(v);
}
void OperatorEditor::updateFreqDisplay() {
float freq = opCoarse->getValue();
float fine = opFine->getValue();
String txtFreq;
if (opMode->getSelectedItemIndex() == 0) {
if ( freq == 0 )
freq = 0.5;
txtFreq << "f = " << (freq + ((freq*2) * (fine/100)));
} else {
freq = pow(10,((int)freq)&3);
freq = freq + ((freq*10) * (fine/100));
txtFreq << freq << " Hz";
}
int det = detune->getValue() - 7;
if ( det != 0 ) {
if ( det > 0 )
txtFreq << " +" << det;
else
txtFreq << " " << det;
}
khzDisplay->setText(txtFreq, NotificationType::dontSendNotification);
}
//[/MiscUserCode]
@ -345,64 +379,73 @@ BEGIN_JUCER_METADATA
fixedSize="1" initialWidth="250" initialHeight="70">
<BACKGROUND backgroundColour="ffffff"/>
<SLIDER name="egl1" id="dc070cc41347df47" memberName="s_egl1" virtualName=""
explicitFocusOrder="0" pos="128 8 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="128 8 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<TOGGLEBUTTON name="new toggle button" id="fcdf1076330e4ef6" memberName="toggleButton"
virtualName="" explicitFocusOrder="0" pos="0 0 24 24" buttonText=""
connectedEdges="0" needsCallback="1" radioGroupId="0" state="0"/>
virtualName="" explicitFocusOrder="0" pos="-8 56 24 24" buttonText=""
connectedEdges="0" needsCallback="0" radioGroupId="0" state="0"/>
<SLIDER name="egl2" id="66f5195e9c374029" memberName="s_egl2" virtualName=""
explicitFocusOrder="0" pos="152 8 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="152 8 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="egl3" id="9d57bd53203dcdb4" memberName="s_egl3" virtualName=""
explicitFocusOrder="0" pos="176 8 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="176 8 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="egl4" id="4f7c3ece3ea2cf9c" memberName="s_egl4" virtualName=""
explicitFocusOrder="0" pos="200 8 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="200 8 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="egr1" id="2ca8137d80da46fb" memberName="s_egv1" virtualName=""
explicitFocusOrder="0" pos="128 40 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="128 40 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="egr3" id="4ad6d0c532d15973" memberName="s_egv2" virtualName=""
explicitFocusOrder="0" pos="152 40 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="152 40 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="egr3" id="8a2027f9ede16b4f" memberName="s_egv3" virtualName=""
explicitFocusOrder="0" pos="176 40 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="176 40 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="egr4" id="8c04f1c943d837e8" memberName="s_egv4" virtualName=""
explicitFocusOrder="0" pos="200 40 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="200 40 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<COMBOBOX name="opMode" id="2cf8156bb94cdc40" memberName="opMode" virtualName=""
explicitFocusOrder="0" pos="48 8 72 24" editable="0" layout="33"
items="FIXED&#10;COARSE" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
explicitFocusOrder="0" pos="40 48 80 16" editable="0" layout="33"
items="RATIO&#10;FIXED" textWhenNonSelected="" textWhenNoItems="(no choices)"/>
<LABEL name="new label" id="75765097f6c5c142" memberName="opId" virtualName=""
explicitFocusOrder="0" pos="0 8 47 24" edTextCol="ff000000" edBkgCol="0"
explicitFocusOrder="0" pos="0 0 24 16" edTextCol="ff000000" edBkgCol="0"
labelText="OP1" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="19.600000000000001421"
focusDiscardsChanges="0" fontname="Default font" fontsize="9.3000000000000007105"
bold="0" italic="0" justification="33"/>
<SLIDER name="opLevel" id="f8521c8214fb8993" memberName="opLevel" virtualName=""
explicitFocusOrder="0" pos="8 40 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="0 32 32 40" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="opFine" id="e445aa61bd6cddcb" memberName="opFine" virtualName=""
explicitFocusOrder="0" pos="96 40 24 24" min="0" max="99" int="0"
explicitFocusOrder="0" pos="96 24 24 24" min="0" max="99" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="opCoarse" id="4eec63d30d7488d2" memberName="opCoarse" virtualName=""
explicitFocusOrder="0" pos="72 40 24 24" min="0" max="32" int="0"
explicitFocusOrder="0" pos="72 24 24 24" min="0" max="31" int="1"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="new slider" id="21f21cc5fae8e54b" memberName="gain" virtualName=""
explicitFocusOrder="0" pos="224 0 24 64" min="0" max="1" int="0"
style="LinearVertical" textBoxPos="NoTextBox" textBoxEditable="0"
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
<LABEL name="khz" id="eb961eed8902a6fc" memberName="khzDisplay" virtualName=""
explicitFocusOrder="0" pos="8 8 112 16" outlineCol="0" edTextCol="ff000000"
edBkgCol="0" labelText="1,000 kHz" editableSingleClick="0" editableDoubleClick="0"
focusDiscardsChanges="0" fontname="Default font" fontsize="16.600000000000001421"
bold="0" italic="0" justification="36"/>
<SLIDER name="detune" id="f093ec8defca2fc2" memberName="detune" virtualName=""
explicitFocusOrder="0" pos="32 24 40 24" min="0" max="14" int="1"
style="LinearHorizontal" textBoxPos="NoTextBox" textBoxEditable="0"
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
</JUCER_COMPONENT>
END_JUCER_METADATA

@ -37,7 +37,6 @@
*/
class OperatorEditor : public Component,
public SliderListener,
public ButtonListener,
public ComboBoxListener
{
public:
@ -50,13 +49,12 @@ public:
void bind(DexedAudioProcessor *processor, int num);
void updateGain(float v);
void updateFreqDisplay();
//[/UserMethods]
void paint (Graphics& g);
void resized();
void sliderValueChanged (Slider* sliderThatWasMoved);
void buttonClicked (Button* buttonThatWasClicked);
void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
@ -81,6 +79,8 @@ private:
ScopedPointer<Slider> opFine;
ScopedPointer<Slider> opCoarse;
ScopedPointer<Slider> gain;
ScopedPointer<Label> khzDisplay;
ScopedPointer<Slider> detune;
//==============================================================================

@ -92,6 +92,7 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner
global.setBounds(505,200,250,80);
global.bind(processor);
updateUI();
startTimer(100);
}
@ -101,8 +102,7 @@ DexedAudioProcessorEditor::~DexedAudioProcessorEditor() {
}
//==============================================================================
void DexedAudioProcessorEditor::paint (Graphics& g)
{
void DexedAudioProcessorEditor::paint (Graphics& g) {
g.fillAll (Colours::white);
g.setColour (Colours::black);
g.setColour (Colour (0xb3898989));
@ -157,11 +157,18 @@ void DexedAudioProcessorEditor::timerCallback() {
if ( processor->peekEnvStatus(env) == false )
return;
//TRACE("out %ld %ld %ld %ld %ld %ld", env[0], env[1], env[2], env[3], env[4], env[5]);
for(int i=0;i<6;i++) {
ops[i].updateGain(sqrt(env[i]) / 8000);
}
}
void DexedAudioProcessorEditor::updateUI() {
TRACE("update UI called");
for(int i=0;i<processor->ctrl.size();i++) {
processor->ctrl[i]->updateComponent();
}
for(int i=0;i<6;i++) {
ops[i].updateFreqDisplay();
}
}

@ -59,6 +59,8 @@ public:
void comboBoxChanged (ComboBox* comboBoxThatHasChanged);
OperatorEditor ops[6];
GlobalEditor global;
void updateUI();
};

@ -31,29 +31,18 @@ Ctrl::Ctrl(String name) {
}
void Ctrl::bind(Slider *s) {
/*if ( slider != NULL ) {
slider->removeListener(this);
}*/
slider = s;
updateComponent();
s->addListener(this);
}
void Ctrl::bind(Button *b) {
/*if ( button != NULL ) {
button->removeListener(this);
button = NULL;
}*/
button = b;
updateComponent();
b->addListener(this);
}
void Ctrl::bind(ComboBox *c) {
/*if ( comboBox != NULL ) {
comboBox->removeListener(this);
comboBox = NULL;
}*/
comboBox = c;
updateComponent();
c->addListener(this);
@ -172,7 +161,6 @@ void DexedAudioProcessor::initCtrl() {
// In the Sysex, OP6 comes first, then OP5...
int opTarget = i * 21;
for(int j=0;j<4;j++) {
String opRate;
opRate << "OP" << (i+1) << "-EGR" << (j+1);
@ -203,6 +191,11 @@ void DexedAudioProcessor::initCtrl() {
fine << "OP" << (i+1) << "-FINE";
opCtrl[i].fine = new CtrlInt(fine, 100, opTarget+19);
ctrl.add(opCtrl[i].fine);
String detune;
detune << "OP" << (i+1) << "-DETUNE";
opCtrl[i].detune = new CtrlInt(detune, 15, opTarget+20);
ctrl.add(opCtrl[i].detune);
}
algo = new CtrlInt("Algorithm", 32, 134, true);
@ -307,13 +300,6 @@ void DexedAudioProcessor::unbindUI() {
}
}
void DexedAudioProcessor::updateUI() {
for(int i=0;i<ctrl.size();i++) {
ctrl[i]->updateComponent();
}
}
//==============================================================================
int DexedAudioProcessor::getNumParameters() {
return ctrl.size();
@ -325,25 +311,18 @@ float DexedAudioProcessor::getParameter (int index) {
void DexedAudioProcessor::setParameter (int index, float newValue) {
ctrl[index]->setValuePlugin(newValue);
/*for(int i=0;i<MAX_ACTIVE_NOTES;i++) {
if ( active_note[i].live )
active_note[i].dx7_note->update(patcher.data);
}*/
}
int DexedAudioProcessor::getNumPrograms() {
// there is 16 program, the 17th one is a ghost for saving "unsaved" preset.
// there is 32 program, the 33th one is a ghost for saving "unsaved" preset.
return 32;
}
int DexedAudioProcessor::getCurrentProgram() {
TRACE("%d", currentProgram);
return currentProgram;
}
void DexedAudioProcessor::setCurrentProgram (int index) {
TRACE("%d", index);
/*// VST has a naughty problem of calling setCurrentProgram after a host has loaded
// an edited preset. We ignore the 16th value, since we want to keep the user values
if ( index == 32 ) {
@ -358,10 +337,8 @@ void DexedAudioProcessor::setCurrentProgram (int index) {
index = index > 31 ? 31 : index;
unpackSysex(index);
currentProgram = index;
for(int i=0;i<ctrl.size();i++) {
ctrl[i]->updateComponent();
}
lfo.reset(data + 137);
updateUI();
}
const String DexedAudioProcessor::getProgramName (int index) {
@ -387,29 +364,23 @@ void DexedAudioProcessor::getStateInformation (MemoryBlock& destData) {
// You should use this method to store your parameters in the memory block.
// You could do that either as raw data, or use the XML or ValueTree classes
// as intermediaries to make it easy to save and load complex data.*/
TRACE("getting state with %d", currentProgram);
destData.insert(data, 161, 0);
}
void DexedAudioProcessor::setStateInformation (const void* source, int sizeInBytes) {
// You should use this method to restore your parameters from this memory block,
// whose contents will have been created by the getStateInformation() call.
TRACE("setting state with %d", currentProgram);
memcpy((void *)data, source, sizeInBytes);
updateUI();
}
//==============================================================================
void DexedAudioProcessor::getCurrentProgramStateInformation (MemoryBlock& destData) {
TRACE("getting state with %d", currentProgram);
destData.insert(data, 161, 0);
}
void DexedAudioProcessor::setCurrentProgramStateInformation (const void* source, int sizeInBytes) {
TRACE("setting state with %d", currentProgram);
memcpy((void *)data, source, sizeInBytes);
updateUI();
}

@ -86,6 +86,7 @@ struct OperatorCtrl {
ScopedPointer<CtrlInt> opMode;
ScopedPointer<CtrlInt> coarse;
ScopedPointer<CtrlInt> fine;
ScopedPointer<CtrlInt> detune;
};

@ -30,12 +30,16 @@
//==============================================================================
DexedAudioProcessor::DexedAudioProcessor() {
/*Logger *tmp = Logger::getCurrentLogger();
Logger *tmp = Logger::getCurrentLogger();
if ( tmp == NULL ) {
Logger::setCurrentLogger(FileLogger::createDateStampedLogger("Dexed", "DebugSession-", "log", "DexedAudioProcessor Created"));
}*/
}
TRACE("Hi");
Exp2::init();
Tanh::init();
Sin::init();
currentNote = -1;
workBlock = NULL;
initCtrl();
@ -49,9 +53,6 @@ DexedAudioProcessor::~DexedAudioProcessor() {
//==============================================================================
void DexedAudioProcessor::prepareToPlay(double sampleRate, int samplesPerBlock) {
Freqlut::init(sampleRate);
Exp2::init();
Tanh::init();
Sin::init();
Lfo::init(sampleRate);
PitchEnv::init(sampleRate);
@ -354,6 +355,16 @@ bool DexedAudioProcessor::hasEditor() const {
return true; // (change this to false if you choose to not supply an editor)
}
void DexedAudioProcessor::updateUI() {
AudioProcessorEditor *editor = getActiveEditor();
if ( editor == NULL ) {
TRACE("no editor found");
return;
}
DexedAudioProcessorEditor *dexedEditor = (DexedAudioProcessorEditor *) editor;
dexedEditor->updateUI();
}
AudioProcessorEditor* DexedAudioProcessor::createEditor() {
return new DexedAudioProcessorEditor (this);
}

@ -93,7 +93,7 @@ public :
char data[161];
void unbindUI();
void updateUI();
void processMidiMessage(const uint8_t *buf, int buf_size);
void keydown(uint8_t pitch, uint8_t velo);
@ -113,17 +113,14 @@ public:
//==============================================================================
AudioProcessorEditor* createEditor();
bool hasEditor() const;
void updateUI();
bool peekEnvStatus(int32_t *values);
//==============================================================================
const String getName() const;
int getNumParameters();
float getParameter (int index);
void setParameter (int index, float newValue);
const String getParameterName (int index);
const String getParameterText (int index);
@ -149,9 +146,7 @@ public:
void setStateInformation (const void* data, int sizeInBytes);
void getCurrentProgramStateInformation (MemoryBlock& destData);
void setCurrentProgramStateInformation (const void* data, int sizeInBytes);
//==============================================================================
// this is kept up to date with the midi messages that arrive, and the UI component
// registers with it so it can represent the incoming messages
@ -166,4 +161,5 @@ private:
};
#define TRACE(fmt, ...) DexedAudioProcessor::log(__PRETTY_FUNCTION__,fmt,##__VA_ARGS__)
#endif // PLUGINPROCESSOR_H_INCLUDED

@ -176,6 +176,7 @@ void Dx7Note::init(const char patch[156], int midinote, int velocity) {
fb_shift_ = feedback != 0 ? 8 - feedback : 16;
pitchmoddepth_ = (patch[139] * 165) >> 6;
pitchmodsens_ = pitchmodsenstab[patch[143] & 7];
ampmoddepth_ = (patch[140] * 165) >> 6;
}
void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay,
@ -186,6 +187,9 @@ void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay,
int32_t senslfo = pitchmodsens_ * (lfo_val - (1 << 23));
pitchmod += (((int64_t)pmd) * (int64_t)senslfo) >> 39;
uint32_t amd = ampmoddepth_ * lfo_delay; // should be Q32
// hardcodes a pitchbend range of 3 semitones, TODO make configurable
int pitchbend = ctrls->values_[kControllerPitch];
int32_t pb = (pitchbend - 0x2000) << 9;
@ -193,6 +197,9 @@ void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay,
for (int op = 0; op < 6; op++) {
params_[op].gain[0] = params_[op].gain[1];
int32_t level = env_[op].getsample();
int32_t gain = Exp2::lookup(level - (14 * (1 << 24)));
//int32_t gain = pow(2, 10 + level * (1.0 / (1 << 24)));
params_[op].freq = Freqlut::lookup(basepitch_[op] + pitchmod);
@ -209,13 +216,14 @@ void Dx7Note::keyup() {
}
void Dx7Note::update(const char patch[156], int midinote) {
/* for (int op = 0; op < 6; op++) {
/*int mode = patch[off + 17];
for (int op = 0; op < 6; op++) {
int off = op * 21;
int mode = patch[off + 17];
int coarse = patch[off + 18];
int fine = patch[off + 19];
int detune = patch[off + 20];
basepitch_[op] = osc_freq(midinote, mode, coarse, fine, detune);
}
}/*
for (int i = 0; i < 4; i++) {
rates[i] = patch[126 + i];
levels[i] = patch[130 + i];

@ -58,6 +58,7 @@ class Dx7Note {
int32_t fb_buf_[2];
int32_t fb_shift_;
int ampmoddepth_;
int algorithm_;
int pitchmoddepth_;
int pitchmodsens_;

Loading…
Cancel
Save