version 0.1

pull/1/head
asb2m10 11 years ago
parent 45a5c25708
commit 1bff785f0d
  1. 1
      Source/DXLookNFeel.cpp
  2. 3
      Source/DXLookNFeel.h
  3. 18
      Source/GlobalEditor.cpp
  4. 1
      Source/GlobalEditor.h
  5. 44
      Source/OperatorEditor.cpp
  6. 23
      Source/PluginEditor.cpp
  7. 3
      Source/PluginEditor.h
  8. 29
      Source/PluginParam.cpp
  9. 4
      Source/PluginProcessor.cpp
  10. 11
      Source/PluginProcessor.h

@ -21,5 +21,4 @@
#include "DXLookNFeel.h"
DXLookNFeel::DXLookNFeel() {
}

@ -24,7 +24,8 @@
#include "../JuceLibraryCode/JuceHeader.h"
class DXLookNFeel : LookAndFeel_V3 {
class DXLookNFeel : public LookAndFeel_V3 {
public:
DXLookNFeel();
};

@ -66,6 +66,12 @@ GlobalEditor::GlobalEditor ()
lfoPitchDepth->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
lfoPitchDepth->addListener (this);
addAndMakeVisible (lfoDelay = new Slider ("lfoDelay"));
lfoDelay->setRange (0, 99, 1);
lfoDelay->setSliderStyle (Slider::LinearVertical);
lfoDelay->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
lfoDelay->addListener (this);
//[UserPreSize]
//[/UserPreSize]
@ -87,6 +93,7 @@ GlobalEditor::~GlobalEditor()
lfoSpeed = nullptr;
lfoAmDepth = nullptr;
lfoPitchDepth = nullptr;
lfoDelay = nullptr;
//[Destructor]. You can add your own custom destruction code here..
@ -110,6 +117,7 @@ void GlobalEditor::resized()
lfoSpeed->setBounds (80, 8, 23, 56);
lfoAmDepth->setBounds (208, 8, 32, 24);
lfoPitchDepth->setBounds (176, 8, 32, 24);
lfoDelay->setBounds (104, 8, 23, 56);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
@ -139,6 +147,11 @@ void GlobalEditor::sliderValueChanged (Slider* sliderThatWasMoved)
//[UserSliderCode_lfoPitchDepth] -- add your slider handling code here..
//[/UserSliderCode_lfoPitchDepth]
}
else if (sliderThatWasMoved == lfoDelay)
{
//[UserSliderCode_lfoDelay] -- add your slider handling code here..
//[/UserSliderCode_lfoDelay]
}
//[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post]
@ -166,6 +179,7 @@ void GlobalEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
void GlobalEditor::bind(DexedAudioProcessor *parent) {
parent->algo->bind(algo);
parent->lfoRate->bind(lfoSpeed);
parent->lfoDelay->bind(lfoDelay);
parent->lfoWaveform->bind(lfoType);
parent->lfoAmpDepth->bind(lfoAmDepth);
parent->lfoPitchDepth->bind(lfoPitchDepth);
@ -208,6 +222,10 @@ BEGIN_JUCER_METADATA
virtualName="" explicitFocusOrder="0" pos="176 8 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=""
explicitFocusOrder="0" pos="104 8 23 56" min="0" max="99" int="1"
style="LinearVertical" textBoxPos="NoTextBox" textBoxEditable="1"
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
</JUCER_COMPONENT>
END_JUCER_METADATA

@ -67,6 +67,7 @@ private:
ScopedPointer<Slider> lfoSpeed;
ScopedPointer<Slider> lfoAmDepth;
ScopedPointer<Slider> lfoPitchDepth;
ScopedPointer<Slider> lfoDelay;
//==============================================================================

@ -30,7 +30,7 @@
OperatorEditor::OperatorEditor ()
{
addAndMakeVisible (s_egl1 = new Slider ("egl1"));
s_egl1->setRange (0, 10, 0);
s_egl1->setRange (0, 99, 0);
s_egl1->setSliderStyle (Slider::Rotary);
s_egl1->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egl1->addListener (this);
@ -40,43 +40,43 @@ OperatorEditor::OperatorEditor ()
toggleButton->addListener (this);
addAndMakeVisible (s_egl2 = new Slider ("egl2"));
s_egl2->setRange (0, 10, 0);
s_egl2->setRange (0, 99, 0);
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, 10, 0);
s_egl3->setRange (0, 99, 0);
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, 10, 0);
s_egl4->setRange (0, 99, 0);
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, 10, 0);
s_egv1->setRange (0, 99, 0);
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, 10, 0);
s_egv2->setRange (0, 99, 0);
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, 10, 0);
s_egv3->setRange (0, 99, 0);
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, 10, 0);
s_egv4->setRange (0, 99, 0);
s_egv4->setSliderStyle (Slider::Rotary);
s_egv4->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
s_egv4->addListener (this);
@ -99,19 +99,19 @@ OperatorEditor::OperatorEditor ()
opId->setColour (TextEditor::backgroundColourId, Colour (0x00000000));
addAndMakeVisible (opLevel = new Slider ("opLevel"));
opLevel->setRange (0, 10, 0);
opLevel->setRange (0, 99, 0);
opLevel->setSliderStyle (Slider::Rotary);
opLevel->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
opLevel->addListener (this);
addAndMakeVisible (opFine = new Slider ("opFine"));
opFine->setRange (0, 10, 0);
opFine->setRange (0, 99, 0);
opFine->setSliderStyle (Slider::Rotary);
opFine->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
opFine->addListener (this);
addAndMakeVisible (opCoarse = new Slider ("opCoarse"));
opCoarse->setRange (0, 10, 0);
opCoarse->setRange (0, 32, 0);
opCoarse->setSliderStyle (Slider::Rotary);
opCoarse->setTextBoxStyle (Slider::NoTextBox, false, 80, 20);
opCoarse->addListener (this);
@ -345,38 +345,38 @@ 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="10" int="0"
explicitFocusOrder="0" pos="128 8 24 24" min="0" max="99" int="0"
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"/>
<SLIDER name="egl2" id="66f5195e9c374029" memberName="s_egl2" virtualName=""
explicitFocusOrder="0" pos="152 8 24 24" min="0" max="10" int="0"
explicitFocusOrder="0" pos="152 8 24 24" min="0" max="99" int="0"
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="10" int="0"
explicitFocusOrder="0" pos="176 8 24 24" min="0" max="99" int="0"
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="10" int="0"
explicitFocusOrder="0" pos="200 8 24 24" min="0" max="99" int="0"
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="10" int="0"
explicitFocusOrder="0" pos="128 40 24 24" min="0" max="99" int="0"
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="10" int="0"
explicitFocusOrder="0" pos="152 40 24 24" min="0" max="99" int="0"
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="10" int="0"
explicitFocusOrder="0" pos="176 40 24 24" min="0" max="99" int="0"
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="10" int="0"
explicitFocusOrder="0" pos="200 40 24 24" min="0" max="99" int="0"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<COMBOBOX name="opMode" id="2cf8156bb94cdc40" memberName="opMode" virtualName=""
@ -388,15 +388,15 @@ BEGIN_JUCER_METADATA
focusDiscardsChanges="0" fontname="Default font" fontsize="19.600000000000001421"
bold="0" italic="0" justification="33"/>
<SLIDER name="opLevel" id="f8521c8214fb8993" memberName="opLevel" virtualName=""
explicitFocusOrder="0" pos="8 40 24 24" min="0" max="10" int="0"
explicitFocusOrder="0" pos="8 40 24 24" min="0" max="99" int="0"
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="10" int="0"
explicitFocusOrder="0" pos="96 40 24 24" min="0" max="99" int="0"
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="10" int="0"
explicitFocusOrder="0" pos="72 40 24 24" min="0" max="32" int="0"
style="Rotary" textBoxPos="NoTextBox" textBoxEditable="1" textBoxWidth="80"
textBoxHeight="20" skewFactor="1"/>
<SLIDER name="new slider" id="21f21cc5fae8e54b" memberName="gain" virtualName=""

@ -31,8 +31,9 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner
: AudioProcessorEditor (ownerFilter),
midiKeyboard (ownerFilter->keyboardState, MidiKeyboardComponent::horizontalKeyboard)
{
LookAndFeel::setDefaultLookAndFeel(&dx_lnf);
// This is where our plugin's editor size is set.
setSize (800, 400);
setSize (765, 380);
processor = ownerFilter;
@ -55,37 +56,40 @@ DexedAudioProcessorEditor::DexedAudioProcessorEditor (DexedAudioProcessor* owner
// OPERATORS
addAndMakeVisible(&(ops[0]));
ops[0].setBounds(20, 40, 250, 80);
ops[0].setBounds(5, 40, 250, 80);
ops[0].bind(processor, 0);
addAndMakeVisible(&(ops[1]));
ops[1].setBounds(270, 40, 250, 80);
ops[1].setBounds(255, 40, 250, 80);
ops[1].bind(processor, 1);
addAndMakeVisible(&(ops[2]));
ops[2].setBounds(520, 40, 250, 80);
ops[2].setBounds(505, 40, 250, 80);
ops[2].bind(processor, 2);
addAndMakeVisible(&(ops[3]));
ops[3].setBounds(20, 120, 250, 80);
ops[3].setBounds(5, 120, 250, 80);
ops[3].bind(processor, 3);
addAndMakeVisible(&(ops[4]));
ops[4].setBounds(270, 120, 250, 80);
ops[4].setBounds(255, 120, 250, 80);
ops[4].bind(processor, 4);
addAndMakeVisible(&(ops[5]));
ops[5].setBounds(520, 120, 250, 80);
ops[5].setBounds(505, 120, 250, 80);
ops[5].bind(processor, 5);
// add the midi keyboard component..
addAndMakeVisible (&midiKeyboard);
// The DX7 is a badass on the bass, keep it that way
midiKeyboard.setLowestVisibleKey(24);
const int keyboardHeight = 90;
midiKeyboard.setBounds (4, getHeight() - keyboardHeight - 4, getWidth() - 8, keyboardHeight);
addAndMakeVisible(&global);
global.setBounds(520,200,250,80);
global.setBounds(505,200,250,80);
global.bind(processor);
startTimer(100);
@ -120,10 +124,9 @@ void DexedAudioProcessorEditor::buttonClicked(Button *buttonThatWasClicked) {
ifstream fp_in;
fp_in.open(f.toRawUTF8(), ifstream::in);
if (fp_in.fail()) {
AlertWindow::showMessageBoxAsync (AlertWindow::InfoIcon,
AlertWindow::showMessageBoxAsync (AlertWindow::WarningIcon,
"Error",
"Unable to open: " + f);
std::cerr << "error opening file" << std::endl;
return;
}
fp_in.read((char *)syx_data, 4104);

@ -25,6 +25,7 @@
#include "PluginProcessor.h"
#include "OperatorEditor.h"
#include "GlobalEditor.h"
#include "DXLookNFeel.h"
//==============================================================================
/**
@ -40,6 +41,8 @@ class DexedAudioProcessorEditor : public AudioProcessorEditor,
MidiKeyboardComponent midiKeyboard;
DXLookNFeel dx_lnf;
public:
DexedAudioProcessorEditor (DexedAudioProcessor* ownerFilter);

@ -92,12 +92,14 @@ float CtrlInt::getValuePlugin() {
}
void CtrlInt::setValuePlugin(float f) {
if ( f >= 1 )
f -= 0.00000001;
setValue((f * steps));
}
void CtrlInt::setValue(int v) {
if ( v >= steps ) {
TRACE("WARNING: value too big %s : %d", label.toRawUTF8(), v);
v = steps-1;
}
value = v;
if ( dxOffset >= 0 ) {
if ( parent != NULL )
@ -212,12 +214,12 @@ void DexedAudioProcessor::initCtrl() {
lfoDelay = new CtrlInt("LFO-Delay", 100, 138);
ctrl.add(lfoDelay);
lfoAmpDepth = new CtrlInt("LFO-AmpDepth", 100, 139);
ctrl.add(lfoAmpDepth);
lfoPitchDepth = new CtrlInt("LFO-PitchDepth", 100, 140);
lfoPitchDepth = new CtrlInt("LFO-PitchDepth", 100, 139);
ctrl.add(lfoPitchDepth);
lfoAmpDepth = new CtrlInt("LFO-AmpDepth", 100, 140);
ctrl.add(lfoAmpDepth);
lfoSync = new CtrlInt("LFO-Sync", 2, 141);
ctrl.add(lfoSync);
@ -236,8 +238,16 @@ int DexedAudioProcessor::importSysex(const char *imported) {
memcpy(patchNames[i], sysex + ((i*128)+118), 11);
for(int j=0;j<10;j++) {
if ( patchNames[i][j] > 127 || patchNames[i][j] < 32 )
patchNames[i][j] = ' ';
char c = (unsigned char)patchNames[i][j];
switch (c) {
case 92: c = 'Y'; break; /* yen */
case 126: c = '>'; break; /* >> */
case 127: c = '<'; break; /* << */
default:
if (c < 32 || c > 127) c = 32;
break;
}
patchNames[i][j] = c;
}
patchNames[i][11] = 0;
}
@ -281,8 +291,6 @@ void DexedAudioProcessor::unpackSysex(int idx) {
data[158] = 1;
data[159] = 1;
data[160] = 1;
TRACE("The LFO is at %d", data[142]);
}
@ -381,7 +389,6 @@ void DexedAudioProcessor::getStateInformation (MemoryBlock& destData) {
// as intermediaries to make it easy to save and load complex data.*/
TRACE("getting state with %d", currentProgram);
destData.insert(data, 161, 0);
}

@ -30,10 +30,10 @@
//==============================================================================
DexedAudioProcessor::DexedAudioProcessor() {
Logger *tmp = Logger::getCurrentLogger();
/*Logger *tmp = Logger::getCurrentLogger();
if ( tmp == NULL ) {
Logger::setCurrentLogger(FileLogger::createDateStampedLogger("Dexed", "DebugSession-", "log", "DexedAudioProcessor Created"));
}
}*/
TRACE("Hi");
currentNote = -1;

@ -94,7 +94,12 @@ public :
void unbindUI();
void updateUI();
void processMidiMessage(const uint8_t *buf, int buf_size);
void keydown(uint8_t pitch, uint8_t velo);
void keyup(uint8_t pitch);
void processSamples(int n_samples, int16_t *buffer);
public:
//==============================================================================
DexedAudioProcessor();
@ -158,10 +163,6 @@ private:
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DexedAudioProcessor)
void processMidiMessage(const uint8_t *buf, int buf_size);
void keydown(uint8_t pitch, uint8_t velo);
void keyup(uint8_t pitch);
void processSamples(int n_samples, int16_t *buffer);
};
#define TRACE(fmt, ...) DexedAudioProcessor::log(__PRETTY_FUNCTION__,fmt,##__VA_ARGS__)

Loading…
Cancel
Save