diff --git a/bin/data/parametersMidiSync/robbyMolnarSceneParamsSync.xml b/bin/data/parametersMidiSync/robbyMolnarSceneParamsSync.xml
new file mode 100644
index 0000000..f45acd5
--- /dev/null
+++ b/bin/data/parametersMidiSync/robbyMolnarSceneParamsSync.xml
@@ -0,0 +1,18 @@
+
+
+ settings/robbyMolnarSceneParameters/numRectangles
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ settings/robbyMolnarSceneParameters/disarray
+ 1
+ 1
+ 0
+ 0
+ 0
+
+
diff --git a/bin/data/parametersMidiSync/robbyRileySceneParamsSync.xml b/bin/data/parametersMidiSync/robbyRileySceneParamsSync.xml
new file mode 100644
index 0000000..6dc34a6
--- /dev/null
+++ b/bin/data/parametersMidiSync/robbyRileySceneParamsSync.xml
@@ -0,0 +1,10 @@
+
+
+ settings/robbyRileySceneParameters/dent
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
diff --git a/bin/data/parametersMidiSync/triangleSceneParamsSync.xml b/bin/data/parametersMidiSync/triangleSceneParamsSync.xml
new file mode 100644
index 0000000..2dd0fb5
--- /dev/null
+++ b/bin/data/parametersMidiSync/triangleSceneParamsSync.xml
@@ -0,0 +1,10 @@
+
+
+ settings/triangleSceneParameters/numTriangles
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
diff --git a/bin/data/parametersMidiSync/veraAnimatedSceneParamsSync.xml b/bin/data/parametersMidiSync/veraAnimatedSceneParamsSync.xml
new file mode 100644
index 0000000..5e30455
--- /dev/null
+++ b/bin/data/parametersMidiSync/veraAnimatedSceneParamsSync.xml
@@ -0,0 +1,26 @@
+
+
+ settings/veraAnimatedSceneParameters/size
+ 1
+ 0
+ 0
+ 0
+ 0
+
+
+ settings/veraAnimatedSceneParameters/smoothing
+ 1
+ 1
+ 0
+ 0
+ 0
+
+
+ settings/veraAnimatedSceneParameters/opacity
+ 1
+ 2
+ 0
+ 0
+ 0
+
+
diff --git a/d4nSFPCRunner.xcodeproj/project.pbxproj b/d4nSFPCRunner.xcodeproj/project.pbxproj
index ab0dc04..993a65b 100644
--- a/d4nSFPCRunner.xcodeproj/project.pbxproj
+++ b/d4nSFPCRunner.xcodeproj/project.pbxproj
@@ -24,6 +24,17 @@
923871B71BF7CCC900171456 /* triangleScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 923871B31BF7CCC900171456 /* triangleScene.cpp */; };
933A2227713C720CEFF80FD9 /* tinyxml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B40EDA85BEB63E46785BC29 /* tinyxml.cpp */; };
9D44DC88EF9E7991B4A09951 /* tinyxmlerror.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 832BDC407620CDBA568B713D /* tinyxmlerror.cpp */; };
+ B09ABFA31C0FE89C00DF2555 /* ofxParameterMidiSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFA11C0FE89C00DF2555 /* ofxParameterMidiSync.cpp */; };
+ B09ABFD21C0FECDA00DF2555 /* ofxRtMidiIn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFA71C0FECDA00DF2555 /* ofxRtMidiIn.cpp */; };
+ B09ABFD31C0FECDA00DF2555 /* ofxRtMidiOut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFA91C0FECDA00DF2555 /* ofxRtMidiOut.cpp */; };
+ B09ABFD41C0FECDA00DF2555 /* ofxBaseMidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFB61C0FECDA00DF2555 /* ofxBaseMidi.cpp */; };
+ B09ABFD51C0FECDA00DF2555 /* ofxMidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFB81C0FECDA00DF2555 /* ofxMidi.cpp */; };
+ B09ABFD61C0FECDA00DF2555 /* ofxMidiIn.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFBB1C0FECDA00DF2555 /* ofxMidiIn.cpp */; };
+ B09ABFD71C0FECDA00DF2555 /* ofxMidiMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFBD1C0FECDA00DF2555 /* ofxMidiMessage.cpp */; };
+ B09ABFD81C0FECDA00DF2555 /* ofxMidiOut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFBF1C0FECDA00DF2555 /* ofxMidiOut.cpp */; };
+ B09ABFD91C0FECDA00DF2555 /* RtMidi.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B09ABFCF1C0FECDA00DF2555 /* RtMidi.cpp */; };
+ B09ABFDA1C0FECDA00DF2555 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B09ABFD11C0FECDA00DF2555 /* CoreMIDI.framework */; };
+ B09ABFDB1C0FECDA00DF2555 /* CoreMIDI.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = B09ABFD11C0FECDA00DF2555 /* CoreMIDI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
B266578FC55D23BFEBC042E7 /* ofxGuiGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECF8674C7975F1063C5E30CA /* ofxGuiGroup.cpp */; };
B56FE57CC35806596D38118C /* ofxSliderGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 802251BAF1B35B1D67B32FD0 /* ofxSliderGroup.cpp */; };
D5F490E61BF7DE2D00F92C20 /* robbyMolnarScene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5F490E41BF7DE2D00F92C20 /* robbyMolnarScene.cpp */; };
@@ -58,6 +69,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
+ B09ABFDB1C0FECDA00DF2555 /* CoreMIDI.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -97,6 +109,28 @@
923871B41BF7CCC900171456 /* triangleScene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = triangleScene.h; sourceTree = ""; };
923871B81BF7D2C400171456 /* appConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = appConstants.h; path = scenes/appConstants.h; sourceTree = ""; };
9604B925D32EE39065747725 /* ofxBaseGui.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofxBaseGui.cpp; path = ../../../addons/ofxGui/src/ofxBaseGui.cpp; sourceTree = SOURCE_ROOT; };
+ B09ABFA11C0FE89C00DF2555 /* ofxParameterMidiSync.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ofxParameterMidiSync.cpp; sourceTree = ""; };
+ B09ABFA21C0FE89C00DF2555 /* ofxParameterMidiSync.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxParameterMidiSync.h; sourceTree = ""; };
+ B09ABFA71C0FECDA00DF2555 /* ofxRtMidiIn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ofxRtMidiIn.cpp; sourceTree = ""; };
+ B09ABFA81C0FECDA00DF2555 /* ofxRtMidiIn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxRtMidiIn.h; sourceTree = ""; };
+ B09ABFA91C0FECDA00DF2555 /* ofxRtMidiOut.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ofxRtMidiOut.cpp; sourceTree = ""; };
+ B09ABFAA1C0FECDA00DF2555 /* ofxRtMidiOut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxRtMidiOut.h; sourceTree = ""; };
+ B09ABFB61C0FECDA00DF2555 /* ofxBaseMidi.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ofxBaseMidi.cpp; sourceTree = ""; };
+ B09ABFB71C0FECDA00DF2555 /* ofxBaseMidi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxBaseMidi.h; sourceTree = ""; };
+ B09ABFB81C0FECDA00DF2555 /* ofxMidi.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ofxMidi.cpp; sourceTree = ""; };
+ B09ABFB91C0FECDA00DF2555 /* ofxMidi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxMidi.h; sourceTree = ""; };
+ B09ABFBA1C0FECDA00DF2555 /* ofxMidiConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxMidiConstants.h; sourceTree = ""; };
+ B09ABFBB1C0FECDA00DF2555 /* ofxMidiIn.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ofxMidiIn.cpp; sourceTree = ""; };
+ B09ABFBC1C0FECDA00DF2555 /* ofxMidiIn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxMidiIn.h; sourceTree = ""; };
+ B09ABFBD1C0FECDA00DF2555 /* ofxMidiMessage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ofxMidiMessage.cpp; sourceTree = ""; };
+ B09ABFBE1C0FECDA00DF2555 /* ofxMidiMessage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxMidiMessage.h; sourceTree = ""; };
+ B09ABFBF1C0FECDA00DF2555 /* ofxMidiOut.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ofxMidiOut.cpp; sourceTree = ""; };
+ B09ABFC01C0FECDA00DF2555 /* ofxMidiOut.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxMidiOut.h; sourceTree = ""; };
+ B09ABFC11C0FECDA00DF2555 /* ofxMidiTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ofxMidiTypes.h; sourceTree = ""; };
+ B09ABFCE1C0FECDA00DF2555 /* readme */ = {isa = PBXFileReference; lastKnownFileType = text; path = readme; sourceTree = ""; };
+ B09ABFCF1C0FECDA00DF2555 /* RtMidi.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RtMidi.cpp; sourceTree = ""; };
+ B09ABFD01C0FECDA00DF2555 /* RtMidi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtMidi.h; sourceTree = ""; };
+ B09ABFD11C0FECDA00DF2555 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = ../../../../../../System/Library/Frameworks/CoreMIDI.framework; sourceTree = ""; };
B21E7E5F548EEA92F368040B /* tinyxml.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = tinyxml.h; path = ../../../addons/ofxXmlSettings/libs/tinyxml.h; sourceTree = SOURCE_ROOT; };
B87C60311EC1FE841C1ECD89 /* ofxLabel.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = ofxLabel.h; path = ../../../addons/ofxGui/src/ofxLabel.h; sourceTree = SOURCE_ROOT; };
C1F057861BF7B0A5002155BE /* data */ = {isa = PBXFileReference; lastKnownFileType = folder; name = data; path = bin/data; sourceTree = ""; };
@@ -125,6 +159,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ B09ABFDA1C0FECDA00DF2555 /* CoreMIDI.framework in Frameworks */,
E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -273,11 +308,92 @@
name = src;
sourceTree = "";
};
+ B09ABF9F1C0FE89C00DF2555 /* ofxParameterMidiSync */ = {
+ isa = PBXGroup;
+ children = (
+ B09ABFA01C0FE89C00DF2555 /* src */,
+ );
+ name = ofxParameterMidiSync;
+ sourceTree = "";
+ };
+ B09ABFA01C0FE89C00DF2555 /* src */ = {
+ isa = PBXGroup;
+ children = (
+ B09ABFA11C0FE89C00DF2555 /* ofxParameterMidiSync.cpp */,
+ B09ABFA21C0FE89C00DF2555 /* ofxParameterMidiSync.h */,
+ );
+ name = src;
+ path = ../../../addons/ofxParameterMidiSync/src;
+ sourceTree = "";
+ };
+ B09ABFA41C0FECDA00DF2555 /* ofxMidi */ = {
+ isa = PBXGroup;
+ children = (
+ B09ABFA51C0FECDA00DF2555 /* src */,
+ B09ABFC21C0FECDA00DF2555 /* libs */,
+ B09ABFD11C0FECDA00DF2555 /* CoreMIDI.framework */,
+ );
+ name = ofxMidi;
+ sourceTree = "";
+ };
+ B09ABFA51C0FECDA00DF2555 /* src */ = {
+ isa = PBXGroup;
+ children = (
+ B09ABFA61C0FECDA00DF2555 /* desktop */,
+ B09ABFB61C0FECDA00DF2555 /* ofxBaseMidi.cpp */,
+ B09ABFB71C0FECDA00DF2555 /* ofxBaseMidi.h */,
+ B09ABFB81C0FECDA00DF2555 /* ofxMidi.cpp */,
+ B09ABFB91C0FECDA00DF2555 /* ofxMidi.h */,
+ B09ABFBA1C0FECDA00DF2555 /* ofxMidiConstants.h */,
+ B09ABFBB1C0FECDA00DF2555 /* ofxMidiIn.cpp */,
+ B09ABFBC1C0FECDA00DF2555 /* ofxMidiIn.h */,
+ B09ABFBD1C0FECDA00DF2555 /* ofxMidiMessage.cpp */,
+ B09ABFBE1C0FECDA00DF2555 /* ofxMidiMessage.h */,
+ B09ABFBF1C0FECDA00DF2555 /* ofxMidiOut.cpp */,
+ B09ABFC01C0FECDA00DF2555 /* ofxMidiOut.h */,
+ B09ABFC11C0FECDA00DF2555 /* ofxMidiTypes.h */,
+ );
+ name = src;
+ path = ../../../addons/ofxMidi/src;
+ sourceTree = "";
+ };
+ B09ABFA61C0FECDA00DF2555 /* desktop */ = {
+ isa = PBXGroup;
+ children = (
+ B09ABFA71C0FECDA00DF2555 /* ofxRtMidiIn.cpp */,
+ B09ABFA81C0FECDA00DF2555 /* ofxRtMidiIn.h */,
+ B09ABFA91C0FECDA00DF2555 /* ofxRtMidiOut.cpp */,
+ B09ABFAA1C0FECDA00DF2555 /* ofxRtMidiOut.h */,
+ );
+ path = desktop;
+ sourceTree = "";
+ };
+ B09ABFC21C0FECDA00DF2555 /* libs */ = {
+ isa = PBXGroup;
+ children = (
+ B09ABFCD1C0FECDA00DF2555 /* rtmidi */,
+ );
+ name = libs;
+ path = ../../../addons/ofxMidi/libs;
+ sourceTree = "";
+ };
+ B09ABFCD1C0FECDA00DF2555 /* rtmidi */ = {
+ isa = PBXGroup;
+ children = (
+ B09ABFCE1C0FECDA00DF2555 /* readme */,
+ B09ABFCF1C0FECDA00DF2555 /* RtMidi.cpp */,
+ B09ABFD01C0FECDA00DF2555 /* RtMidi.h */,
+ );
+ path = rtmidi;
+ sourceTree = "";
+ };
BB4B014C10F69532006C3DED /* addons */ = {
isa = PBXGroup;
children = (
480A780D8D0308AE4A368801 /* ofxGui */,
1F4FB5C423662B96ADFDCC0B /* ofxXmlSettings */,
+ B09ABF9F1C0FE89C00DF2555 /* ofxParameterMidiSync */,
+ B09ABFA41C0FECDA00DF2555 /* ofxMidi */,
);
name = addons;
sourceTree = "";
@@ -432,26 +548,35 @@
buildActionMask = 2147483647;
files = (
E4B69E200A3A1BDC003C02F2 /* main.cpp in Sources */,
+ B09ABFD61C0FECDA00DF2555 /* ofxMidiIn.cpp in Sources */,
E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */,
856AA354D08AB4B323081444 /* ofxBaseGui.cpp in Sources */,
+ B09ABFD41C0FECDA00DF2555 /* ofxBaseMidi.cpp in Sources */,
5CBB2AB3A60F65431D7B555D /* ofxButton.cpp in Sources */,
D5F490EB1BF7E69B00F92C20 /* robbyRileyScene.cpp in Sources */,
+ B09ABFD81C0FECDA00DF2555 /* ofxMidiOut.cpp in Sources */,
+ B09ABFA31C0FE89C00DF2555 /* ofxParameterMidiSync.cpp in Sources */,
B266578FC55D23BFEBC042E7 /* ofxGuiGroup.cpp in Sources */,
26B248401BF7DA1100C11D04 /* veraAnimatedScene.cpp in Sources */,
85BCD90A1BF7E398004188EE /* yeseulScene.cpp in Sources */,
483908258D00B98B4BE69F07 /* ofxLabel.cpp in Sources */,
F285EB3169F1566CA3D93C20 /* ofxPanel.cpp in Sources */,
+ B09ABFD31C0FECDA00DF2555 /* ofxRtMidiOut.cpp in Sources */,
923871B61BF7CCC900171456 /* exampleScene.cpp in Sources */,
837220E80EB56CD44AD27F2A /* ofxSlider.cpp in Sources */,
923871B71BF7CCC900171456 /* triangleScene.cpp in Sources */,
B56FE57CC35806596D38118C /* ofxSliderGroup.cpp in Sources */,
+ B09ABFD21C0FECDA00DF2555 /* ofxRtMidiIn.cpp in Sources */,
+ B09ABFD51C0FECDA00DF2555 /* ofxMidi.cpp in Sources */,
1CD33E884D9E3358252E82A1 /* ofxToggle.cpp in Sources */,
63B57AC5BF4EF088491E0317 /* ofxXmlSettings.cpp in Sources */,
+ B09ABFD91C0FECDA00DF2555 /* RtMidi.cpp in Sources */,
933A2227713C720CEFF80FD9 /* tinyxml.cpp in Sources */,
9D44DC88EF9E7991B4A09951 /* tinyxmlerror.cpp in Sources */,
923871B51BF7CCC900171456 /* emptyScene.cpp in Sources */,
923871A41BF7993A00171456 /* baseScene.cpp in Sources */,
5A4349E9754D6FA14C0F2A3A /* tinyxmlparser.cpp in Sources */,
+ B09ABFD71C0FECDA00DF2555 /* ofxMidiMessage.cpp in Sources */,
D5F490E61BF7DE2D00F92C20 /* robbyMolnarScene.cpp in Sources */,
923871A61BF7993A00171456 /* sceneManager.cpp in Sources */,
7118B75E1C0519830092084A /* johnWhitneyShader01.cpp in Sources */,
@@ -565,6 +690,7 @@
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_NAME = "$(TARGET_NAME)Debug";
+ USER_HEADER_SEARCH_PATHS = "";
WRAPPER_EXTENSION = app;
};
name = Debug;
@@ -594,6 +720,7 @@
INSTALL_PATH = "$(HOME)/Applications";
LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_NAME = "$(TARGET_NAME)";
+ USER_HEADER_SEARCH_PATHS = "";
WRAPPER_EXTENSION = app;
baseConfigurationReference = E4EB6923138AFD0F00A09F29;
};
diff --git a/src/ofApp.cpp b/src/ofApp.cpp
index 2115b39..f2413b3 100644
--- a/src/ofApp.cpp
+++ b/src/ofApp.cpp
@@ -48,6 +48,10 @@ void ofApp::keyPressed(int key){
SM.mode = DRAW_SIDE_BY_SIDE;
} else if (key == '1'){
SM.mode = DRAW_SINGLE;
+ } else if (key == 'l'){
+ SM.learnMidi();
+ } else if (key == 's'){
+ SM.saveLearnedMidi();
}
}
diff --git a/src/scenes/baseScene.cpp b/src/scenes/baseScene.cpp
index 67ab7a7..2ac033f 100644
--- a/src/scenes/baseScene.cpp
+++ b/src/scenes/baseScene.cpp
@@ -24,6 +24,10 @@ void baseScene::loadCode( string fileName ){
}
+void baseScene::setSceneName(string name){
+ sceneName = name;
+ parameters.setName(name+"Parameters");
+}
string baseScene::getCodeWithParamsReplaced(){
diff --git a/src/scenes/baseScene.h b/src/scenes/baseScene.h
index ee8ad62..0f6a4a9 100644
--- a/src/scenes/baseScene.h
+++ b/src/scenes/baseScene.h
@@ -26,5 +26,6 @@ class baseScene {
ofRectangle dimensions; // this is the dimensions of
// the surface you are drawing into.
-
+ void setSceneName(string name);
+ string sceneName;
};
\ No newline at end of file
diff --git a/src/scenes/emptyScene/emptyScene.cpp b/src/scenes/emptyScene/emptyScene.cpp
index 8ec59c0..8b65b39 100644
--- a/src/scenes/emptyScene/emptyScene.cpp
+++ b/src/scenes/emptyScene/emptyScene.cpp
@@ -8,6 +8,7 @@ void emptyScene::setup(){
// parameters.add(param);
loadCode("emptyScene/exampleCode.cpp");
+ setSceneName("emptyScene");
}
void emptyScene::update(){
diff --git a/src/scenes/exampleScene/exampleScene.cpp b/src/scenes/exampleScene/exampleScene.cpp
index 3e4d159..6a284ba 100644
--- a/src/scenes/exampleScene/exampleScene.cpp
+++ b/src/scenes/exampleScene/exampleScene.cpp
@@ -13,7 +13,7 @@ void exampleScene::setup(){
parameters.add(width);
loadCode("exampleScene/exampleCode.cpp");
-
+ setSceneName("exampleScene");
}
diff --git a/src/scenes/johnWhitneyShader01/johnWhitneyShader01.cpp b/src/scenes/johnWhitneyShader01/johnWhitneyShader01.cpp
index bc68ce4..02119cb 100644
--- a/src/scenes/johnWhitneyShader01/johnWhitneyShader01.cpp
+++ b/src/scenes/johnWhitneyShader01/johnWhitneyShader01.cpp
@@ -10,6 +10,9 @@ void johnWhitneyShader01::setup(){
loadCode("johnWhitneyShader01/exampleCode.cpp");
shader.load("johnWhitneyShader01/shader");
+
+ setSceneName("johnWhitneyShader01");
+
}
void johnWhitneyShader01::update() {
diff --git a/src/scenes/robbyMolnarScene/robbyMolnarScene.cpp b/src/scenes/robbyMolnarScene/robbyMolnarScene.cpp
index 8fa7a0b..624352a 100644
--- a/src/scenes/robbyMolnarScene/robbyMolnarScene.cpp
+++ b/src/scenes/robbyMolnarScene/robbyMolnarScene.cpp
@@ -35,6 +35,7 @@ void veraRect::setup(int numberOfRectangles, float r){
an.push_back(ofRandom(-1, 1));
}
}
+
}
void veraRect::draw(int numRects, float d){
@@ -94,6 +95,8 @@ void robbyMolnarScene::setup(){
v.centerY = space*.5 + centerY - space*3 + space*((int)(i/6));
veraRects.push_back(v);
}
+
+ setSceneName("robbyMolnarScene");
}
void robbyMolnarScene::update(){
diff --git a/src/scenes/robbyRileyScene/robbyRileyScene.cpp b/src/scenes/robbyRileyScene/robbyRileyScene.cpp
index 091e15f..55ca3b7 100644
--- a/src/scenes/robbyRileyScene/robbyRileyScene.cpp
+++ b/src/scenes/robbyRileyScene/robbyRileyScene.cpp
@@ -7,6 +7,7 @@ void robbyRileyScene::setup(){
param.set("dent", 15, -10, 30);
parameters.add(param);
loadCode("robbyRileyScene/code.txt");
+ setSceneName("robbyRileyScene");
}
void robbyRileyScene::update(){
diff --git a/src/scenes/sceneManager.cpp b/src/scenes/sceneManager.cpp
index 863b8ac..98c75d9 100644
--- a/src/scenes/sceneManager.cpp
+++ b/src/scenes/sceneManager.cpp
@@ -45,14 +45,16 @@ void sceneManager::setup(){
currentScene = 0;
scenes[currentScene]->reset();
+
panel = new ofxPanel();
- panel->setup();
+ panel->setup("settings");
panel->add(scenes[currentScene]->parameters);
panel->setPosition(ofGetWidth()-300, 20);
-
+ sync.setup(0,panel->getParameter());
+ sync.load("parametersMidiSync/"+ scenes[currentScene]->sceneName + "ParamsSync.xml");
mode = DRAW_SIDE_BY_SIDE;
}
@@ -64,7 +66,6 @@ void sceneManager::update(){
void sceneManager::draw(){
-
sceneFbo.begin();
ofClear(0,0,0,255);
ofPushStyle();
@@ -91,6 +92,10 @@ void sceneManager::draw(){
panel->draw();
+ sync.drawDebug();
+
+ ofDrawBitmapStringHighlight(scenes[currentScene]->sceneName, 20, 40);
+
}
void sceneManager::advanceScene(){
@@ -102,9 +107,20 @@ void sceneManager::advanceScene(){
delete panel;
panel = new ofxPanel();
- panel->setup();
+ panel->setup("settings");
panel->add(scenes[currentScene]->parameters);
panel->setPosition(ofGetWidth()-300, 20);
+
+ sync.reset();
+ sync.setup(0,panel->getParameter());
+ sync.load("parametersMidiSync/"+ scenes[currentScene]->sceneName + "ParamsSync.xml");
-};
\ No newline at end of file
+}
+void sceneManager::saveLearnedMidi(){
+ sync.save("parametersMidiSync/"+ scenes[currentScene]->sceneName + "ParamsSync.xml");
+}
+void sceneManager::learnMidi(){
+ sync.learn(!sync.isLearning());
+
+}
diff --git a/src/scenes/sceneManager.h b/src/scenes/sceneManager.h
index b115972..ff04963 100644
--- a/src/scenes/sceneManager.h
+++ b/src/scenes/sceneManager.h
@@ -6,7 +6,7 @@
#include "baseScene.h"
#include "ofxGui.h"
#include "appConstants.h"
-
+#include "ofxParameterMidiSync.h"
enum drawMode {
DRAW_SIDE_BY_SIDE, DRAW_SINGLE
@@ -33,5 +33,10 @@ class sceneManager {
ofxPanel * panel;
drawMode mode;
+ ofxParameterMidiSync sync;
+
+ void learnMidi();
+ void saveLearnedMidi();
+
};
\ No newline at end of file
diff --git a/src/scenes/triangleScene/triangleScene.cpp b/src/scenes/triangleScene/triangleScene.cpp
index 10ebc64..a83b50e 100644
--- a/src/scenes/triangleScene/triangleScene.cpp
+++ b/src/scenes/triangleScene/triangleScene.cpp
@@ -13,6 +13,7 @@ void triangleScene::setup(){
numTriangles.set("numTriangles", 5, 0, 100);
parameters.add(numTriangles);
loadCode("triangleScene/triangle.txt");
+ setSceneName("triangleScene");
}
void triangleScene::update(){
diff --git a/src/scenes/veraAnimatedScene/veraAnimatedScene.cpp b/src/scenes/veraAnimatedScene/veraAnimatedScene.cpp
index ed0bbc2..00f7300 100644
--- a/src/scenes/veraAnimatedScene/veraAnimatedScene.cpp
+++ b/src/scenes/veraAnimatedScene/veraAnimatedScene.cpp
@@ -65,6 +65,9 @@ void veraAnimatedScene::setup(){
vols = {0.5,0.6,0.7,0.8,0.9};
ofNoFill();
+
+ setSceneName("veraAnimatedScene");
+
}
void veraAnimatedScene::update(){
diff --git a/src/scenes/yeseulScene/yeseulScene.cpp b/src/scenes/yeseulScene/yeseulScene.cpp
index 5ec2888..911d23a 100644
--- a/src/scenes/yeseulScene/yeseulScene.cpp
+++ b/src/scenes/yeseulScene/yeseulScene.cpp
@@ -14,6 +14,7 @@ void yeseulScene::setup(){
loadCode("exampleScene/exampleCode.cpp");
+ setSceneName("yeseulScene");
}