diff --git a/Builds/MacOSX/Info-AU.plist b/Builds/MacOSX/Info-AU.plist index ca6fcbf..897beee 100644 --- a/Builds/MacOSX/Info-AU.plist +++ b/Builds/MacOSX/Info-AU.plist @@ -18,9 +18,9 @@ CFBundleSignature ???? CFBundleShortVersionString - 1.0.0 + 0.0.1 CFBundleVersion - 1.0.0 + 0.0.1 NSHumanReadableCopyright NSHighResolutionCapable @@ -41,7 +41,7 @@ subtype Znof version - 65536 + 1 resourceUsage network.client diff --git a/Builds/MacOSX/Info-VST.plist b/Builds/MacOSX/Info-VST.plist index f21ffbc..d6967df 100644 --- a/Builds/MacOSX/Info-VST.plist +++ b/Builds/MacOSX/Info-VST.plist @@ -18,9 +18,9 @@ CFBundleSignature ???? CFBundleShortVersionString - 1.0.0 + 0.0.1 CFBundleVersion - 1.0.0 + 0.0.1 NSHumanReadableCopyright NSHighResolutionCapable diff --git a/Builds/MacOSX/Xen MIDI Retuner.xcodeproj/project.pbxproj b/Builds/MacOSX/Xen MIDI Retuner.xcodeproj/project.pbxproj index 69edb4e..0559768 100644 --- a/Builds/MacOSX/Xen MIDI Retuner.xcodeproj/project.pbxproj +++ b/Builds/MacOSX/Xen MIDI Retuner.xcodeproj/project.pbxproj @@ -89,6 +89,14 @@ isa = PBXBuildFile; fileRef = C3936DB2289AAC287026C989; }; + 1B5031CDCA9C3DD30C3E5154 = { + isa = PBXBuildFile; + fileRef = 6FE4377EB7BB52380E101748; + }; + 075D8B75755FF325E83D6762 = { + isa = PBXBuildFile; + fileRef = 00048E2734552BF26B00F194; + }; 7A4148BF5DD461DB551FF938 = { isa = PBXBuildFile; fileRef = 3C976980A8AFFAC031E0ACB5; @@ -201,6 +209,13 @@ isa = PBXBuildFile; fileRef = 3201BBDF6CBDBB944C5CF3EF; }; + 00048E2734552BF26B00F194 = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + name = ConversionModule.cpp; + path = ../../Source/EditorModules/ConversionModule.cpp; + sourceTree = "SOURCE_ROOT"; + }; 02E3E350F5A9FE993AA8E19E = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; @@ -292,6 +307,13 @@ path = "Info-VST.plist"; sourceTree = "SOURCE_ROOT"; }; + 2A3E8FC3B07CEF4001D44ECD = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = ConversionModule.h; + path = ../../Source/EditorModules/ConversionModule.h; + sourceTree = "SOURCE_ROOT"; + }; 3201BBDF6CBDBB944C5CF3EF = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; @@ -432,6 +454,13 @@ path = "../../JuceLibraryCode/include_juce_events.mm"; sourceTree = "SOURCE_ROOT"; }; + 5F34A5DC34DED319D1E7DBB5 = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = TransitionCurve.h; + path = ../../Source/EditorModules/Components/TransitionCurve.h; + sourceTree = "SOURCE_ROOT"; + }; 626DE35A07C14E9C7805A3F2 = { isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; @@ -481,6 +510,13 @@ path = "../../JuceLibraryCode/include_juce_audio_plugin_client_utils.cpp"; sourceTree = "SOURCE_ROOT"; }; + 6FE4377EB7BB52380E101748 = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + name = TransitionCurve.cpp; + path = ../../Source/EditorModules/Components/TransitionCurve.cpp; + sourceTree = "SOURCE_ROOT"; + }; 7192D37C17A7B8FE607A8E52 = { isa = PBXFileReference; lastKnownFileType = wrapper.framework; @@ -816,9 +852,21 @@ name = "AnaMark-Tuning-Library"; sourceTree = ""; }; + 474B3AFCA7470F35C6888DD9 = { + isa = PBXGroup; + children = ( + 6FE4377EB7BB52380E101748, + 5F34A5DC34DED319D1E7DBB5, + ); + name = Components; + sourceTree = ""; + }; 6792A254C5601E7BA485AE5F = { isa = PBXGroup; children = ( + 474B3AFCA7470F35C6888DD9, + 00048E2734552BF26B00F194, + 2A3E8FC3B07CEF4001D44ECD, 3C976980A8AFFAC031E0ACB5, 57ED0995A1491A98A5B877D9, A50287DE07ED2C64E7FCF827, @@ -994,8 +1042,8 @@ "_DEBUG=1", "DEBUG=1", "JUCER_XCODE_MAC_F6D2F4CF=1", - "JUCE_APP_VERSION=1.0.0", - "JUCE_APP_VERSION_HEX=0x10000", + "JUCE_APP_VERSION=0.0.1", + "JUCE_APP_VERSION_HEX=0x1", "JucePlugin_Build_VST=1", "JucePlugin_Build_VST3=0", "JucePlugin_Build_AU=0", @@ -1046,8 +1094,8 @@ "_NDEBUG=1", "NDEBUG=1", "JUCER_XCODE_MAC_F6D2F4CF=1", - "JUCE_APP_VERSION=1.0.0", - "JUCE_APP_VERSION_HEX=0x10000", + "JUCE_APP_VERSION=0.0.1", + "JUCE_APP_VERSION_HEX=0x1", "JucePlugin_Build_VST=1", "JucePlugin_Build_VST3=0", "JucePlugin_Build_AU=0", @@ -1100,8 +1148,8 @@ "_DEBUG=1", "DEBUG=1", "JUCER_XCODE_MAC_F6D2F4CF=1", - "JUCE_APP_VERSION=1.0.0", - "JUCE_APP_VERSION_HEX=0x10000", + "JUCE_APP_VERSION=0.0.1", + "JUCE_APP_VERSION_HEX=0x1", "JucePlugin_Build_VST=0", "JucePlugin_Build_VST3=0", "JucePlugin_Build_AU=1", @@ -1153,8 +1201,8 @@ "_NDEBUG=1", "NDEBUG=1", "JUCER_XCODE_MAC_F6D2F4CF=1", - "JUCE_APP_VERSION=1.0.0", - "JUCE_APP_VERSION_HEX=0x10000", + "JUCE_APP_VERSION=0.0.1", + "JUCE_APP_VERSION_HEX=0x1", "JucePlugin_Build_VST=0", "JucePlugin_Build_VST3=0", "JucePlugin_Build_AU=1", @@ -1206,8 +1254,8 @@ "_DEBUG=1", "DEBUG=1", "JUCER_XCODE_MAC_F6D2F4CF=1", - "JUCE_APP_VERSION=1.0.0", - "JUCE_APP_VERSION_HEX=0x10000", + "JUCE_APP_VERSION=0.0.1", + "JUCE_APP_VERSION_HEX=0x1", "JucePlugin_Build_VST=1", "JucePlugin_Build_VST3=0", "JucePlugin_Build_AU=1", @@ -1252,8 +1300,8 @@ "_NDEBUG=1", "NDEBUG=1", "JUCER_XCODE_MAC_F6D2F4CF=1", - "JUCE_APP_VERSION=1.0.0", - "JUCE_APP_VERSION_HEX=0x10000", + "JUCE_APP_VERSION=0.0.1", + "JUCE_APP_VERSION_HEX=0x1", "JucePlugin_Build_VST=1", "JucePlugin_Build_VST3=0", "JucePlugin_Build_AU=1", @@ -1571,6 +1619,8 @@ 17372AEC0D5E16E464930928, 03C6F67EAC5A9B746DD0CE67, C4EECD3F23C1D751C309C5D3, + 1B5031CDCA9C3DD30C3E5154, + 075D8B75755FF325E83D6762, 7A4148BF5DD461DB551FF938, B2BC02A9FE7155E80DAE91C0, A6CD8719005EAB700CB6828F, diff --git a/JuceLibraryCode/AppConfig.h b/JuceLibraryCode/AppConfig.h index 7758130..db1f81d 100644 --- a/JuceLibraryCode/AppConfig.h +++ b/JuceLibraryCode/AppConfig.h @@ -368,13 +368,13 @@ #define JucePlugin_EditorRequiresKeyboardFocus 1 #endif #ifndef JucePlugin_Version - #define JucePlugin_Version 1.0.0 + #define JucePlugin_Version 0.0.1 #endif #ifndef JucePlugin_VersionCode - #define JucePlugin_VersionCode 0x10000 + #define JucePlugin_VersionCode 0x1 #endif #ifndef JucePlugin_VersionString - #define JucePlugin_VersionString "1.0.0" + #define JucePlugin_VersionString "0.0.1" #endif #ifndef JucePlugin_VSTUniqueID #define JucePlugin_VSTUniqueID JucePlugin_PluginCode diff --git a/JuceLibraryCode/JuceHeader.h b/JuceLibraryCode/JuceHeader.h index 9486551..654b3ad 100644 --- a/JuceLibraryCode/JuceHeader.h +++ b/JuceLibraryCode/JuceHeader.h @@ -50,7 +50,7 @@ namespace ProjectInfo { const char* const projectName = "Xen MIDI Retuner"; const char* const companyName = "Taras Palczynski III"; - const char* const versionString = "1.0.0"; - const int versionNumber = 0x10000; + const char* const versionString = "0.0.1"; + const int versionNumber = 0x1; } #endif diff --git a/Source/EditorModules/Components/TransitionCurve.cpp b/Source/EditorModules/Components/TransitionCurve.cpp new file mode 100644 index 0000000..e79bb2b --- /dev/null +++ b/Source/EditorModules/Components/TransitionCurve.cpp @@ -0,0 +1,163 @@ +/* + ============================================================================== + + This is an automatically generated GUI class created by the Projucer! + + Be careful when adding custom code to these files, as only the code within + the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded + and re-saved. + + Created with Projucer version: 5.4.7 + + ------------------------------------------------------------------------------ + + The Projucer is part of the JUCE library. + Copyright (c) 2017 - ROLI Ltd. + + ============================================================================== +*/ + +//[Headers] You can add your own extra header files here... +//[/Headers] + +#include "TransitionCurve.h" + + +//[MiscUserDefs] You can add your own user definitions and misc code here... +//[/MiscUserDefs] + +//============================================================================== +TransitionCurve::TransitionCurve () +{ + //[Constructor_pre] You can add your own custom stuff here.. + //[/Constructor_pre] + + + //[UserPreSize] + //[/UserPreSize] + + setSize (600, 400); + + + //[Constructor] You can add your own custom stuff here.. + //[/Constructor] +} + +TransitionCurve::~TransitionCurve() +{ + //[Destructor_pre]. You can add your own custom destruction code here.. + //[/Destructor_pre] + + + + //[Destructor]. You can add your own custom destruction code here.. + //[/Destructor] +} + +//============================================================================== +void TransitionCurve::paint (Graphics& g) +{ + //[UserPrePaint] Add your own custom painting code here.. + { + float x = 0, y = 0; + Colour strokeColour = Colour (0xffa52a8d); + //[UserPaintCustomArguments] Customize the painting arguments here.. + //[/UserPaintCustomArguments] + g.setColour (strokeColour); + g.strokePath (internalPath1, PathStrokeType (5.000f, PathStrokeType::curved, PathStrokeType::rounded), AffineTransform::translation(x, y)); + } + //[/UserPrePaint] + + //[UserPaint] Add your own custom painting code here.. + //[/UserPaint] +} + +void TransitionCurve::resized() +{ + //[UserPreResize] Add your own custom resize code here.. + setTransition(0.0f); + //[/UserPreResize] + + //[UserResized] Add your own custom resize handling here.. + //[/UserResized] +} + + + +//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... +void TransitionCurve::setTransition(float transition) +{ + float cubicEnd = 0.75f; + float transitionCapped = jlimit(0.0f, cubicEnd, transition); + float transitionToStraight = jlimit(cubicEnd, 1.0f, transition); + + internalPath1.clear(); + + // TODO: REVIEW: Does these Point's get properly deallocated once the function ends? + Point *startPoint = new Point(horizontalMargin, proportionOfHeight (1.0000f) - verticalMargin); + internalPath1.startNewSubPath(*startPoint); + + Point *cubicStartPoint = new Point(jmap(transitionCapped, cubicEnd, 0.0f, (float)horizontalMargin, (float)proportionOfWidth(0.5f)), proportionOfHeight (1.0000f) - verticalMargin); + internalPath1.lineTo(*cubicStartPoint); + + Point *cubicWeightLeft = new Point(jmap(transitionToStraight, cubicEnd, 1.0f, (float)proportionOfWidth (0.5000f), (float)horizontalMargin), proportionOfHeight (1.0000f) - verticalMargin); + Point *cubicWeightRight = new Point(jmap(transitionToStraight, cubicEnd, 1.0f, (float)proportionOfWidth (0.5000f), (float)proportionOfWidth(1.0f) - horizontalMargin), verticalMargin); + Point *lineRightStart = new Point(jmap(transitionCapped, cubicEnd, 0.0f, (float)proportionOfWidth(1.0f) - horizontalMargin, (float)proportionOfWidth(0.5f)), verticalMargin); + internalPath1.cubicTo(*cubicWeightLeft, *cubicWeightRight, *lineRightStart); + + Point *lineRightEnd = new Point(getWidth() - horizontalMargin, verticalMargin); + internalPath1.lineTo (*lineRightEnd); + + repaint(); +} + +float TransitionCurve::evaluate(float xPercent) +{ + float lineXPoint = jmap(xPercent, 0.0f, 1.0f, (float)horizontalMargin, (float)proportionOfWidth(1.0f) - horizontalMargin); + evaluationLine.setStart(lineXPoint, verticalMargin); + evaluationLine.setEnd(lineXPoint, proportionOfHeight(1.0f) - verticalMargin); + + PathFlatteningIterator i (internalPath1); + + Point intersectionPoint; + while (i.next()) + { + const Line line (i.x1, i.y1, i.x2, i.y2); + + bool intersected = line.intersects(evaluationLine, intersectionPoint); + + if (intersected) break; + } + + // Points origin is top left, but highest point should return 1.0f, not 0.0f. + float evaluation = jmap(intersectionPoint.y, (float)verticalMargin, (float)proportionOfHeight(1.0f) - verticalMargin, 1.0f, 0.0f); + + return evaluation; +} +//[/MiscUserCode] + + +//============================================================================== +#if 0 +/* -- Projucer information section -- + + This is where the Projucer stores the metadata that describe this GUI layout, so + make changes in here at your peril! + +BEGIN_JUCER_METADATA + + + + + +END_JUCER_METADATA +*/ +#endif + + +//[EndFile] You can add extra defines here... +//[/EndFile] + diff --git a/Source/EditorModules/Components/TransitionCurve.h b/Source/EditorModules/Components/TransitionCurve.h new file mode 100644 index 0000000..e986c35 --- /dev/null +++ b/Source/EditorModules/Components/TransitionCurve.h @@ -0,0 +1,73 @@ +/* + ============================================================================== + + This is an automatically generated GUI class created by the Projucer! + + Be careful when adding custom code to these files, as only the code within + the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded + and re-saved. + + Created with Projucer version: 5.4.7 + + ------------------------------------------------------------------------------ + + The Projucer is part of the JUCE library. + Copyright (c) 2017 - ROLI Ltd. + + ============================================================================== +*/ + +#pragma once + +//[Headers] -- You can add your own extra header files here -- +#include +#include +//[/Headers] + + + +//============================================================================== +/** + //[Comments] + An auto-generated component, created by the Projucer. + + Describe your class and how it works here! + //[/Comments] +*/ +class TransitionCurve : public Component +{ +public: + //============================================================================== + TransitionCurve (); + ~TransitionCurve() override; + + //============================================================================== + //[UserMethods] -- You can add your own custom methods in this section. + void setTransition(float transition); + float evaluate(float xPosition); + //[/UserMethods] + + void paint (Graphics& g) override; + void resized() override; + + + +private: + //[UserVariables] -- You can add your own custom variables in this section. + int horizontalMargin = 40; + int verticalMargin = 40; + + Path internalPath1; + Line evaluationLine; + //[/UserVariables] + + //============================================================================== + + + //============================================================================== + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TransitionCurve) +}; + +//[EndFile] You can add extra defines here... +//[/EndFile] + diff --git a/Source/EditorModules/ConversionModule.cpp b/Source/EditorModules/ConversionModule.cpp new file mode 100644 index 0000000..03fabeb --- /dev/null +++ b/Source/EditorModules/ConversionModule.cpp @@ -0,0 +1,181 @@ +/* + ============================================================================== + + This is an automatically generated GUI class created by the Projucer! + + Be careful when adding custom code to these files, as only the code within + the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded + and re-saved. + + Created with Projucer version: 5.4.7 + + ------------------------------------------------------------------------------ + + The Projucer is part of the JUCE library. + Copyright (c) 2017 - ROLI Ltd. + + ============================================================================== +*/ + +//[Headers] You can add your own extra header files here... +//[/Headers] + +#include "ConversionModule.h" + + +//[MiscUserDefs] You can add your own user definitions and misc code here... +//[/MiscUserDefs] + +//============================================================================== +ConversionModule::ConversionModule () +{ + //[Constructor_pre] You can add your own custom stuff here.. + //[/Constructor_pre] + + section_title.reset (new Label ("section_title", + TRANS("Conversion\n"))); + addAndMakeVisible (section_title.get()); + section_title->setFont (Font (22.00f, Font::plain).withTypefaceStyle ("Bold")); + section_title->setJustificationType (Justification::centredTop); + section_title->setEditable (false, false, false); + section_title->setColour (TextEditor::textColourId, Colours::black); + section_title->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + transitionCurve.reset (new TransitionCurve()); + addAndMakeVisible (transitionCurve.get()); + slider.reset (new Slider ("new slider")); + addAndMakeVisible (slider.get()); + slider->setRange (0, 1, 0); + slider->setSliderStyle (Slider::RotaryHorizontalVerticalDrag); + slider->setTextBoxStyle (Slider::NoTextBox, false, 80, 20); + slider->addListener (this); + + slider->setBounds (0, 80, 104, 104); + + label.reset (new Label ("new label", + TRANS("Scale Note Snapping Curve"))); + addAndMakeVisible (label.get()); + label->setFont (Font (15.00f, Font::plain).withTypefaceStyle ("Regular")); + label->setJustificationType (Justification::centred); + label->setEditable (false, false, false); + label->setColour (TextEditor::textColourId, Colours::black); + label->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); + + label->setBounds (0, 40, 104, 40); + + + //[UserPreSize] + //[/UserPreSize] + + setSize (600, 400); + + + //[Constructor] You can add your own custom stuff here.. + //[/Constructor] +} + +ConversionModule::~ConversionModule() +{ + //[Destructor_pre]. You can add your own custom destruction code here.. + //[/Destructor_pre] + + section_title = nullptr; + transitionCurve = nullptr; + slider = nullptr; + label = nullptr; + + + //[Destructor]. You can add your own custom destruction code here.. + //[/Destructor] +} + +//============================================================================== +void ConversionModule::paint (Graphics& g) +{ + //[UserPrePaint] Add your own custom painting code here.. + //[/UserPrePaint] + + //[UserPaint] Add your own custom painting code here.. + //[/UserPaint] +} + +void ConversionModule::resized() +{ + //[UserPreResize] Add your own custom resize code here.. + //[/UserPreResize] + + section_title->setBounds (0, 0, proportionOfWidth (1.0000f), 24); + transitionCurve->setBounds (proportionOfWidth (0.1000f), 32, proportionOfWidth (0.9000f), 208); + //[UserResized] Add your own custom resize handling here.. + //[/UserResized] +} + +void ConversionModule::sliderValueChanged (Slider* sliderThatWasMoved) +{ + //[UsersliderValueChanged_Pre] + //[/UsersliderValueChanged_Pre] + + if (sliderThatWasMoved == slider.get()) + { + //[UserSliderCode_slider] -- add your slider handling code here.. + transitionCurve->setTransition(slider->getValue()); + //[/UserSliderCode_slider] + } + + //[UsersliderValueChanged_Post] + //[/UsersliderValueChanged_Post] +} + + + +//[MiscUserCode] You can add your own definitions of your custom methods or any other code here... +TransitionCurve *ConversionModule::getTransitionCurve() +{ + return &(*transitionCurve); +} +//[/MiscUserCode] + + +//============================================================================== +#if 0 +/* -- Projucer information section -- + + This is where the Projucer stores the metadata that describe this GUI layout, so + make changes in here at your peril! + +BEGIN_JUCER_METADATA + + + + + +END_JUCER_METADATA +*/ +#endif + + +//[EndFile] You can add extra defines here... +//[/EndFile] + diff --git a/Source/EditorModules/ConversionModule.h b/Source/EditorModules/ConversionModule.h new file mode 100644 index 0000000..a0d6b57 --- /dev/null +++ b/Source/EditorModules/ConversionModule.h @@ -0,0 +1,73 @@ +/* + ============================================================================== + + This is an automatically generated GUI class created by the Projucer! + + Be careful when adding custom code to these files, as only the code within + the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded + and re-saved. + + Created with Projucer version: 5.4.7 + + ------------------------------------------------------------------------------ + + The Projucer is part of the JUCE library. + Copyright (c) 2017 - ROLI Ltd. + + ============================================================================== +*/ + +#pragma once + +//[Headers] -- You can add your own extra header files here -- +#include +//[/Headers] + +#include "Components/TransitionCurve.h" + + +//============================================================================== +/** + //[Comments] + An auto-generated component, created by the Projucer. + + Describe your class and how it works here! + //[/Comments] +*/ +class ConversionModule : public Component, + public Slider::Listener +{ +public: + //============================================================================== + ConversionModule (); + ~ConversionModule() override; + + //============================================================================== + //[UserMethods] -- You can add your own custom methods in this section. + TransitionCurve *getTransitionCurve(); + //[/UserMethods] + + void paint (Graphics& g) override; + void resized() override; + void sliderValueChanged (Slider* sliderThatWasMoved) override; + + + +private: + //[UserVariables] -- You can add your own custom variables in this section. + //[/UserVariables] + + //============================================================================== + std::unique_ptr