Skip to content

Commit

Permalink
First version of single channel tuning/remapping complete
Browse files Browse the repository at this point in the history
Fixes needed when it comes to architecture, especailly when it comes to GUI - processor interaction.
Some controls are not mapped as parameters.
Parameters do not update their GUI controller.
  • Loading branch information
Taras A. Palczynski III authored and Taras A. Palczynski III committed Apr 12, 2020
1 parent d178b42 commit 1593300
Show file tree
Hide file tree
Showing 20 changed files with 1,008 additions and 198 deletions.
6 changes: 3 additions & 3 deletions Builds/MacOSX/Info-AU.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>0.0.1</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<string>0.0.1</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>
Expand All @@ -41,7 +41,7 @@
<key>subtype</key>
<string>Znof</string>
<key>version</key>
<integer>65536</integer>
<integer>1</integer>
<key>resourceUsage</key>
<dict>
<key>network.client</key>
Expand Down
4 changes: 2 additions & 2 deletions Builds/MacOSX/Info-VST.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>0.0.1</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<string>0.0.1</string>
<key>NSHumanReadableCopyright</key>
<string></string>
<key>NSHighResolutionCapable</key>
Expand Down
74 changes: 62 additions & 12 deletions Builds/MacOSX/Xen MIDI Retuner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@
isa = PBXBuildFile;
fileRef = C3936DB2289AAC287026C989;
};
1B5031CDCA9C3DD30C3E5154 = {
isa = PBXBuildFile;
fileRef = 6FE4377EB7BB52380E101748;
};
075D8B75755FF325E83D6762 = {
isa = PBXBuildFile;
fileRef = 00048E2734552BF26B00F194;
};
7A4148BF5DD461DB551FF938 = {
isa = PBXBuildFile;
fileRef = 3C976980A8AFFAC031E0ACB5;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -816,9 +852,21 @@
name = "AnaMark-Tuning-Library";
sourceTree = "<group>";
};
474B3AFCA7470F35C6888DD9 = {
isa = PBXGroup;
children = (
6FE4377EB7BB52380E101748,
5F34A5DC34DED319D1E7DBB5,
);
name = Components;
sourceTree = "<group>";
};
6792A254C5601E7BA485AE5F = {
isa = PBXGroup;
children = (
474B3AFCA7470F35C6888DD9,
00048E2734552BF26B00F194,
2A3E8FC3B07CEF4001D44ECD,
3C976980A8AFFAC031E0ACB5,
57ED0995A1491A98A5B877D9,
A50287DE07ED2C64E7FCF827,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -1571,6 +1619,8 @@
17372AEC0D5E16E464930928,
03C6F67EAC5A9B746DD0CE67,
C4EECD3F23C1D751C309C5D3,
1B5031CDCA9C3DD30C3E5154,
075D8B75755FF325E83D6762,
7A4148BF5DD461DB551FF938,
B2BC02A9FE7155E80DAE91C0,
A6CD8719005EAB700CB6828F,
Expand Down
6 changes: 3 additions & 3 deletions JuceLibraryCode/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions JuceLibraryCode/JuceHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
163 changes: 163 additions & 0 deletions Source/EditorModules/Components/TransitionCurve.cpp
Original file line number Diff line number Diff line change
@@ -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<float>'s get properly deallocated once the function ends?
Point<float> *startPoint = new Point<float>(horizontalMargin, proportionOfHeight (1.0000f) - verticalMargin);
internalPath1.startNewSubPath(*startPoint);

Point<float> *cubicStartPoint = new Point<float>(jmap(transitionCapped, cubicEnd, 0.0f, (float)horizontalMargin, (float)proportionOfWidth(0.5f)), proportionOfHeight (1.0000f) - verticalMargin);
internalPath1.lineTo(*cubicStartPoint);

Point<float> *cubicWeightLeft = new Point<float>(jmap(transitionToStraight, cubicEnd, 1.0f, (float)proportionOfWidth (0.5000f), (float)horizontalMargin), proportionOfHeight (1.0000f) - verticalMargin);
Point<float> *cubicWeightRight = new Point<float>(jmap(transitionToStraight, cubicEnd, 1.0f, (float)proportionOfWidth (0.5000f), (float)proportionOfWidth(1.0f) - horizontalMargin), verticalMargin);
Point<float> *lineRightStart = new Point<float>(jmap(transitionCapped, cubicEnd, 0.0f, (float)proportionOfWidth(1.0f) - horizontalMargin, (float)proportionOfWidth(0.5f)), verticalMargin);
internalPath1.cubicTo(*cubicWeightLeft, *cubicWeightRight, *lineRightStart);

Point<float> *lineRightEnd = new Point<float>(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<float> intersectionPoint;
while (i.next())
{
const Line<float> 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

<JUCER_COMPONENT documentType="Component" className="TransitionCurve" componentName=""
parentClasses="public Component" constructorParams="" variableInitialisers=""
snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
fixedSize="0" initialWidth="600" initialHeight="400">
<BACKGROUND backgroundColour="323e44"/>
</JUCER_COMPONENT>

END_JUCER_METADATA
*/
#endif


//[EndFile] You can add extra defines here...
//[/EndFile]

Loading

0 comments on commit 1593300

Please sign in to comment.