Added tune knob

pull/1/head
asb2m10 9 years ago
parent 54811aaf7a
commit 4c3c2bab10
  1. 5201
      Builds/MacOSX/Dexed.xcodeproj/project.pbxproj
  2. 22
      Source/GlobalEditor.cpp
  3. 1
      Source/GlobalEditor.h
  4. 2
      Source/PluginData.cpp
  5. 36
      Source/PluginParam.cpp
  6. 2
      Source/PluginProcessor.cpp
  7. 1
      Source/PluginProcessor.h
  8. 2
      Source/msfa/controllers.h
  9. 1
      Source/msfa/dx7note.cc

File diff suppressed because it is too large Load Diff

@ -260,6 +260,12 @@ GlobalEditor::GlobalEditor ()
Image(), 1.000f, Colour (0x00000000), Image(), 1.000f, Colour (0x00000000),
Image(), 1.000f, Colour (0x00000000), Image(), 1.000f, Colour (0x00000000),
Image(), 1.000f, Colour (0x00000000)); Image(), 1.000f, Colour (0x00000000));
addAndMakeVisible (tune = new Slider ("tune"));
tune->setRange (0, 1, 0);
tune->setSliderStyle (Slider::RotaryVerticalDrag);
tune->setTextBoxStyle (Slider::NoTextBox, true, 80, 20);
tune->addListener (this);
//[UserPreSize] //[UserPreSize]
//[/UserPreSize] //[/UserPreSize]
@ -321,6 +327,7 @@ GlobalEditor::~GlobalEditor()
lfoType = nullptr; lfoType = nullptr;
programSelector = nullptr; programSelector = nullptr;
aboutButton = nullptr; aboutButton = nullptr;
tune = nullptr;
//[Destructor]. You can add your own custom destruction code here.. //[Destructor]. You can add your own custom destruction code here..
@ -379,6 +386,7 @@ void GlobalEditor::resized()
lfoType->setBounds (583, 8, 36, 26); lfoType->setBounds (583, 8, 36, 26);
programSelector->setBounds (153, 115, 112, 18); programSelector->setBounds (153, 115, 112, 18);
aboutButton->setBounds (8, 11, 135, 46); aboutButton->setBounds (8, 11, 135, 46);
tune->setBounds (190, 9, 34, 34);
//[UserResized] Add your own custom resize handling here.. //[UserResized] Add your own custom resize handling here..
//[/UserResized] //[/UserResized]
} }
@ -491,6 +499,11 @@ void GlobalEditor::sliderValueChanged (Slider* sliderThatWasMoved)
//[UserSliderCode_output] -- add your slider handling code here.. //[UserSliderCode_output] -- add your slider handling code here..
//[/UserSliderCode_output] //[/UserSliderCode_output]
} }
else if (sliderThatWasMoved == tune)
{
//[UserSliderCode_tune] -- add your slider handling code here..
//[/UserSliderCode_tune]
}
//[UsersliderValueChanged_Post] //[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post] //[/UsersliderValueChanged_Post]
@ -584,14 +597,15 @@ void GlobalEditor::bind(DexedAudioProcessorEditor *edit) {
processor->fxCutoff->bind(cutoff); processor->fxCutoff->bind(cutoff);
processor->fxReso->bind(reso); processor->fxReso->bind(reso);
processor->output->bind(output); processor->output->bind(output);
processor->tune->bind(tune);
algoDisplay->algo = (char *) &(processor->data[134]); algoDisplay->algo = (char *) &(processor->data[134]);
pitchEnvDisplay->pvalues = &(processor->data[126]); pitchEnvDisplay->pvalues = &(processor->data[126]);
editor = edit; editor = edit;
midiMonitor = new MidiMonitor(&(processor->sysexComm)); midiMonitor = new MidiMonitor(&(processor->sysexComm));
addAndMakeVisible(midiMonitor); //addAndMakeVisible(midiMonitor);
midiMonitor->setBounds(155, 21, 80, 45); //midiMonitor->setBounds(155, 21, 80, 45);
repaint(); repaint();
} }
@ -759,6 +773,10 @@ BEGIN_JUCER_METADATA
resourceNormal="" opacityNormal="1" colourNormal="0" resourceOver="" resourceNormal="" opacityNormal="1" colourNormal="0" resourceOver=""
opacityOver="1" colourOver="0" resourceDown="" opacityDown="1" opacityOver="1" colourOver="0" resourceDown="" opacityDown="1"
colourDown="0"/> colourDown="0"/>
<SLIDER name="tune" id="d22c34aa3363a28a" memberName="tune" virtualName=""
explicitFocusOrder="0" pos="190 9 34 34" min="0" max="1" int="0"
style="RotaryVerticalDrag" textBoxPos="NoTextBox" textBoxEditable="0"
textBoxWidth="80" textBoxHeight="20" skewFactor="1"/>
</JUCER_COMPONENT> </JUCER_COMPONENT>
END_JUCER_METADATA END_JUCER_METADATA

@ -113,6 +113,7 @@ private:
ScopedPointer<ComboBoxImage> lfoType; ScopedPointer<ComboBoxImage> lfoType;
ScopedPointer<ProgramSelector> programSelector; ScopedPointer<ProgramSelector> programSelector;
ScopedPointer<ImageButton> aboutButton; ScopedPointer<ImageButton> aboutButton;
ScopedPointer<Slider> tune;
//============================================================================== //==============================================================================

@ -294,6 +294,7 @@ void DexedAudioProcessor::getStateInformation(MemoryBlock& destData) {
dexedState.setAttribute("currentProgram", currentProgram); dexedState.setAttribute("currentProgram", currentProgram);
dexedState.setAttribute("monoMode", monoMode); dexedState.setAttribute("monoMode", monoMode);
dexedState.setAttribute("engineType", (int) engineType); dexedState.setAttribute("engineType", (int) engineType);
dexedState.setAttribute("masterTune", controllers.masterTune);
char mod_cfg[15]; char mod_cfg[15];
controllers.wheel.setConfig(mod_cfg); controllers.wheel.setConfig(mod_cfg);
@ -340,6 +341,7 @@ void DexedAudioProcessor::setStateInformation(const void* source, int sizeInByte
setEngineType(root->getIntAttribute("engineType", 1)); setEngineType(root->getIntAttribute("engineType", 1));
monoMode = root->getIntAttribute("monoMode", 0); monoMode = root->getIntAttribute("monoMode", 0);
controllers.masterTune = root->getIntAttribute("masterTune", 0);
File possibleCartridge = File(root->getStringAttribute("activeFileCartridge")); File possibleCartridge = File(root->getStringAttribute("activeFileCartridge"));
if ( possibleCartridge.exists() ) if ( possibleCartridge.exists() )

@ -70,6 +70,39 @@ public:
} }
}; };
class CtrlTune : public Ctrl {
public:
DexedAudioProcessor *processor;
CtrlTune(String name, DexedAudioProcessor *owner) : Ctrl(name) {
processor = owner;
}
float getValueHost() {
// meh. good enough for now
int32_t tune = processor->controllers.masterTune / (1.0/12);
tune = (tune >> 11) + 0x2000;
return (float)tune / 0x4000;
}
void setValueHost(float v) {
int32_t tune = (v * 0x4000) - 0x2000;
processor->controllers.masterTune = ((float) (tune << 11)) * (1.0/12);
}
String getValueDisplay() {
String display;
display << (getValueHost() * 2) -1;
return display;
}
void updateComponent() {
if (slider != NULL) {
slider->setValue(getValueHost(), dontSendNotification);
}
}
};
// ************************************************************************ // ************************************************************************
// //
@ -288,6 +321,9 @@ void DexedAudioProcessor::initCtrl() {
output = new CtrlFloat("Output", &fx.uiGain); output = new CtrlFloat("Output", &fx.uiGain);
ctrl.add(output); ctrl.add(output);
tune = new CtrlTune("MASTER TUNE ADJ", this);
ctrl.add(tune);
algo = new CtrlDX("ALGORITHM", 32, 134, 1); algo = new CtrlDX("ALGORITHM", 32, 134, 1);
ctrl.add(algo); ctrl.add(algo);

@ -65,6 +65,7 @@ DexedAudioProcessor::DexedAudioProcessor() {
controllers.values_[kControllerPitchRange] = 3; controllers.values_[kControllerPitchRange] = 3;
controllers.values_[kControllerPitchStep] = 0; controllers.values_[kControllerPitchStep] = 0;
controllers.masterTune = 0;
loadPreference(); loadPreference();
for (int note = 0; note < MAX_ACTIVE_NOTES; ++note) { for (int note = 0; note < MAX_ACTIVE_NOTES; ++note) {
@ -319,7 +320,6 @@ void DexedAudioProcessor::processMidiMessage(const MidiMessage *msg) {
controllers.values_[kControllerPitch] = buf[1] | (buf[2] << 7); controllers.values_[kControllerPitch] = buf[1] | (buf[2] << 7);
break; break;
} }
} }
void DexedAudioProcessor::keydown(uint8_t pitch, uint8_t velo) { void DexedAudioProcessor::keydown(uint8_t pitch, uint8_t velo) {

@ -155,6 +155,7 @@ public :
ScopedPointer<CtrlFloat> fxCutoff; ScopedPointer<CtrlFloat> fxCutoff;
ScopedPointer<CtrlFloat> fxReso; ScopedPointer<CtrlFloat> fxReso;
ScopedPointer<CtrlFloat> output; ScopedPointer<CtrlFloat> output;
ScopedPointer<Ctrl> tune;
void loadCartridge(Cartridge &cart); void loadCartridge(Cartridge &cart);
void setDxValue(int offset, int v); void setDxValue(int offset, int v);

@ -86,6 +86,8 @@ public:
int foot_cc; int foot_cc;
int modwheel_cc; int modwheel_cc;
int masterTune;
FmMod wheel; FmMod wheel;
FmMod foot; FmMod foot;
FmMod breath; FmMod breath;

@ -202,6 +202,7 @@ void Dx7Note::compute(int32_t *buf, int32_t lfo_val, int32_t lfo_delay, const Co
} }
} }
pitch_mod += pb; pitch_mod += pb;
pitch_mod += ctrls->masterTune;
// ==== AMP MOD ==== // ==== AMP MOD ====
uint32_t amod_1 = ((int64_t) ampmoddepth_ * (int64_t) lfo_delay) >> 8; // Q24 :D uint32_t amod_1 = ((int64_t) ampmoddepth_ * (int64_t) lfo_delay) >> 8; // Q24 :D

Loading…
Cancel
Save