From 4e8ad1e132566e97ac74fc737d6bcdab8b32645e Mon Sep 17 00:00:00 2001 From: Jakob Bak Date: Thu, 21 Mar 2013 11:35:29 +0100 Subject: [PATCH] update notes to motion.cpp --- software/lib/MMM/Motion.cpp | 2 +- .../MMM/examples/Motion/_6_Bumps/_6_Bumps.ino | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/software/lib/MMM/Motion.cpp b/software/lib/MMM/Motion.cpp index 85dd0f6..eb956be 100644 --- a/software/lib/MMM/Motion.cpp +++ b/software/lib/MMM/Motion.cpp @@ -61,7 +61,7 @@ void Motion::update_mass_spring_damper() { long t = millis(); float dt = (float)(t - tick) / 100.0f; - int xin = analogRead(_s); // may take some time + int xin = analogRead(_s); // may take some time, put: 512 - analogRead(_s); Xin = xin; F = k * (xin - X) - (d * V); diff --git a/software/lib/MMM/examples/Motion/_6_Bumps/_6_Bumps.ino b/software/lib/MMM/examples/Motion/_6_Bumps/_6_Bumps.ino index b75ee4e..ecc0baf 100644 --- a/software/lib/MMM/examples/Motion/_6_Bumps/_6_Bumps.ino +++ b/software/lib/MMM/examples/Motion/_6_Bumps/_6_Bumps.ino @@ -1,5 +1,13 @@ +<<<<<<< HEAD:software/lib/MMM/examples/Motion/_6_Bumps/_6_Bumps.ino //Plucks - four bumps / three notes (400,500,600hz) #define NUM_OSCILLATORS 3 +======= +//plucks - four bumps +//three notes (400,500,600hz) +//can't get Music.setGain1, etc to work only Music.setGain() starts all of them. +#define NUM_OSCILLATORS 3 +#define BIT_DEPTH 8 +>>>>>>> update notes to motion.cpp:software/apps/Modeling/Bumps4/Bumps4.ino #include #include @@ -26,6 +34,7 @@ void loop(){ if (((xold <= 125) && (x > 125)) || ((xold >= 125) && (x < 125))){ Music.setGain1(1.0f); +<<<<<<< HEAD:software/lib/MMM/examples/Motion/_6_Bumps/_6_Bumps.ino } if (((xold <= 375) && (x > 375)) || ((xold >= 375) && (x < 375))){ Music.setGain2(1.0f); @@ -35,6 +44,21 @@ if (((xold <= 625) && (x > 625)) || ((xold >= 625) && (x < 625))){ } if (((xold <= 875) && (x > 875)) || ((xold >= 875) && (x < 875))){ Music.setGain1(1.0f); +======= + Music.setFrequency1(200); +} +if (((xold <= 375) && (x > 375)) || ((xold >= 375) && (x < 375))){ + Music.setGain2(1.0f); + Music.setFrequency2(250); +} +if (((xold <= 625) && (x > 625)) || ((xold >= 625) && (x < 625))){ + Music.setGain3(1.0f); + Music.setFrequency3(300); +} +if (((xold <= 875) && (x > 875)) || ((xold >= 875) && (x < 875))){ + Music.setGain1(1.0f); + Music.setFrequency1(400); +>>>>>>> update notes to motion.cpp:software/apps/Modeling/Bumps4/Bumps4.ino } else{ Music.setGain1(0.995f*Music.getGain1());