Added tune knob

pull/1/head
asb2m10 9 years ago
parent 54811aaf7a
commit 4c3c2bab10
  1. 5199
      Builds/MacOSX/Dexed.xcodeproj/project.pbxproj
  2. 28
      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

@ -63,7 +63,7 @@ public:
class AboutBox : public DialogWindow {
public:
Image about_png;
AboutBox(Component *parent) : DialogWindow("About", Colour(0xFF000000), true) {
setUsingNativeTitleBar(false);
setAlwaysOnTop(true);
@ -71,11 +71,11 @@ public:
setSize(about_png.getWidth(), about_png.getHeight());
centreAroundComponent (parent, getWidth(), getHeight());
}
void closeButtonPressed() {
setVisible (false);
}
void paint(Graphics &g) {
g.drawImage (about_png, 0, 0, about_png.getWidth(), about_png.getHeight(),
0, 0, about_png.getWidth(), about_png.getHeight());
@ -260,6 +260,12 @@ GlobalEditor::GlobalEditor ()
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]
@ -321,6 +327,7 @@ GlobalEditor::~GlobalEditor()
lfoType = nullptr;
programSelector = nullptr;
aboutButton = nullptr;
tune = nullptr;
//[Destructor]. You can add your own custom destruction code here..
@ -379,6 +386,7 @@ void GlobalEditor::resized()
lfoType->setBounds (583, 8, 36, 26);
programSelector->setBounds (153, 115, 112, 18);
aboutButton->setBounds (8, 11, 135, 46);
tune->setBounds (190, 9, 34, 34);
//[UserResized] Add your own custom resize handling here..
//[/UserResized]
}
@ -491,6 +499,11 @@ void GlobalEditor::sliderValueChanged (Slider* sliderThatWasMoved)
//[UserSliderCode_output] -- add your slider handling code here..
//[/UserSliderCode_output]
}
else if (sliderThatWasMoved == tune)
{
//[UserSliderCode_tune] -- add your slider handling code here..
//[/UserSliderCode_tune]
}
//[UsersliderValueChanged_Post]
//[/UsersliderValueChanged_Post]
@ -584,14 +597,15 @@ void GlobalEditor::bind(DexedAudioProcessorEditor *edit) {
processor->fxCutoff->bind(cutoff);
processor->fxReso->bind(reso);
processor->output->bind(output);
processor->tune->bind(tune);
algoDisplay->algo = (char *) &(processor->data[134]);
pitchEnvDisplay->pvalues = &(processor->data[126]);
editor = edit;
midiMonitor = new MidiMonitor(&(processor->sysexComm));
addAndMakeVisible(midiMonitor);
midiMonitor->setBounds(155, 21, 80, 45);
//addAndMakeVisible(midiMonitor);
//midiMonitor->setBounds(155, 21, 80, 45);
repaint();
}
@ -759,6 +773,10 @@ BEGIN_JUCER_METADATA
resourceNormal="" opacityNormal="1" colourNormal="0" resourceOver=""
opacityOver="1" colourOver="0" resourceDown="" opacityDown="1"
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>
END_JUCER_METADATA

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

@ -294,6 +294,7 @@ void DexedAudioProcessor::getStateInformation(MemoryBlock& destData) {
dexedState.setAttribute("currentProgram", currentProgram);
dexedState.setAttribute("monoMode", monoMode);
dexedState.setAttribute("engineType", (int) engineType);
dexedState.setAttribute("masterTune", controllers.masterTune);
char mod_cfg[15];
controllers.wheel.setConfig(mod_cfg);
@ -340,6 +341,7 @@ void DexedAudioProcessor::setStateInformation(const void* source, int sizeInByte
setEngineType(root->getIntAttribute("engineType", 1));
monoMode = root->getIntAttribute("monoMode", 0);
controllers.masterTune = root->getIntAttribute("masterTune", 0);
File possibleCartridge = File(root->getStringAttribute("activeFileCartridge"));
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);
ctrl.add(output);
tune = new CtrlTune("MASTER TUNE ADJ", this);
ctrl.add(tune);
algo = new CtrlDX("ALGORITHM", 32, 134, 1);
ctrl.add(algo);

@ -65,6 +65,7 @@ DexedAudioProcessor::DexedAudioProcessor() {
controllers.values_[kControllerPitchRange] = 3;
controllers.values_[kControllerPitchStep] = 0;
controllers.masterTune = 0;
loadPreference();
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);
break;
}
}
void DexedAudioProcessor::keydown(uint8_t pitch, uint8_t velo) {

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

@ -86,6 +86,8 @@ public:
int foot_cc;
int modwheel_cc;
int masterTune;
FmMod wheel;
FmMod foot;
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 += ctrls->masterTune;
// ==== AMP MOD ====
uint32_t amod_1 = ((int64_t) ampmoddepth_ * (int64_t) lfo_delay) >> 8; // Q24 :D

Loading…
Cancel
Save