Permalink
Browse files

updates having to do with demo mode, and midi channel select

Signed-off-by: Steve Cooley <steve@sc-fa.com>
  • Loading branch information...
stevecooley committed Jun 7, 2011
1 parent dabf8d9 commit f5be861cb8df2d40243b782bf2cbf0f0783bffbb
@@ -13,6 +13,11 @@ template<class T> inline Print &operator <<(Print &obj, T arg) {
http://github.com/stevecooley/beatseqr-software for the latest versions of related software
*/
+/*
+ 2011-04-09 steve cooley
+ added a "demo mode" that disables some functionality. reactivate the functionality by setting "demoMode" to "false" in config.h
+ */
+
#include <SoftwareSerial.h>
@@ -36,7 +41,7 @@ void setup(){
delay(300);
-// Serial << "ZIN,Steve Cooley http://beatseqr.com \r\n";
+ // Serial << "ZIN,Steve Cooley http://beatseqr.com \r\n";
// analog 11?
pinMode(65, INPUT); // play stop button
pinMode(66, INPUT); // voice button mode select?
@@ -72,7 +77,7 @@ void setup(){
lcd.print("?6"); // voice button mode
lcd.print("S"); // select mode by default
- lcd.print("?y1");// move cursor to beginning of line 1
+ lcd.print("?y1");// move cursor to beginning of line 1
lcd.print("bpm:120+0 Sw:0"); // tempo/adjust/swing
// there. now the LCD isn't naked when it boots.
}
@@ -81,6 +86,8 @@ void loop(){
// chase lights are when the step buttons tell you what step you're on when the transport is playing
+
+
process_incoming_serial();
if(chase_lights_status == 1)
@@ -124,3 +131,4 @@ void loop(){
+
@@ -4,11 +4,12 @@
#include "Potentiometer.h"
#include "PString.h"
+boolean demoMode = true;
// Important configuration stuff
-int swingknob = 9;
-int tempoknob = 8;
+int swingknob = 8;
+int tempoknob = 9;
int upper_BPM_number = 201;
int lower_BPM_number = 89;
@@ -198,6 +199,8 @@ Button voice_mode_select = Button(66, PULLUP);
Button slider_mode_select = Button(67, PULLUP);
Button knob_mode_select = Button(68, PULLUP);
+
+
// play / stop
LED transport_led_1 = LED(10);
LED voice_mode_select_LED = LED(11);
@@ -275,6 +278,8 @@ char* pattern_padding;
char* step_padding;
+
+
// custom functions
float mapFloat(float x, float in_min, float in_max, float out_min, float out_max)
@@ -1,11 +1,16 @@
+
+
void run_knob_routine()
{
+
+
+
// int tbutton1 = transport_button_1.uniquePress();
- if(knob_mode_select.uniquePress()){
+ if(knob_mode_select.uniquePress() && (demoMode == false)){
// invalidate that the raw data is what should be transmitting.
@@ -109,7 +114,18 @@ void run_knob_routine()
// debug
// Serial.println(raw_knob_values[1]);
- this_swing = map(raw_knob_values[1], 1, 1024, 200, -1);
+ int upper_swing_value;
+
+ if(demoMode == true)
+ {
+ upper_swing_value = 61;
+ }
+ else
+ {
+ upper_swing_value = 201;
+ }
+
+ this_swing = map(raw_knob_values[1], 1, 1024, upper_swing_value, -1);
if((this_swing >= (last_swing+2)) || (this_swing <= (last_swing-2)))
{
@@ -341,3 +357,4 @@ void run_knob_routine()
+
@@ -5,7 +5,7 @@ void run_voice_select_button_routine()
int alt_button_delay = 150;
// int tbutton1 = transport_button_1.uniquePress();
- if(voice_mode_select.uniquePress())
+ if(voice_mode_select.uniquePress() && (demoMode == false))
{
clear_voice_select_leds();
voice_mode_select_LED.toggle();
@@ -3,7 +3,7 @@ void run_voice_slider_routine()
// slider mode select button
// int tbutton1 = transport_button_1.uniquePress();
- if(slider_mode_select.uniquePress()){
+ if(slider_mode_select.uniquePress() && (demoMode == false)){
@@ -4,7 +4,7 @@
#include "Potentiometer.h"
#include "PString.h"
-const char* firmware_version_number = "4.0";
+const char* firmware_version_number = "4.3";
const char* hardware_version_number = "4.0";
@@ -24,7 +24,7 @@ int vselectval_lowerranges[8] = {
751,
700,
650,
- 605,
+ 610,
576,
550
};
@@ -37,7 +37,7 @@ int vselectval_upperranges[8] = {
750,
690,
645,
- 600,
+ 609,
575
};
@@ -54,7 +54,7 @@ int vselectval_upperranges[8] = {
SoftwareSerial lcd = SoftwareSerial(rxPin, lcdTxPin);
-
+
char N;
int I;
int ByteVar;
@@ -89,15 +89,18 @@ int raw_voice_slider_values[8];
int CC_cleared_to_update_values[8];
int NN_cleared_to_update_values[8];
int VL_cleared_to_update_values[8];
+int MC_cleared_to_update_values[8];
int voice_slider_midivelocity[8];
int voice_slider_midicc[8];
int voice_slider_midinotenum[8] = {
36,37,38,39,40,41,42,43};
+int voice_slider_midichannel[8] = {
+ 1,1,1,1,1,1,1,1};
int last_voice_slider_values[8];
int slider_mode = 1;
-int slider_mode_total = 3;
+int slider_mode_total = 4;
int slider_reset_counter = 0;
const char *slider_message_header = "VL";
int slider_map_low_value = -2;
@@ -160,12 +163,12 @@ int this_tempo;
float last_tempo;
int knob_mode = 1;
-int knob_mode_total = 2;
+int knob_mode_total = 3;
-int raw_knob_values[2];
-int knobs_cleared_to_update[2];
-int knobs_cleared_to_update_values[2];
+int raw_knob_values[3];
+int knobs_cleared_to_update[3];
+int knobs_cleared_to_update_values[3];
@@ -183,6 +186,14 @@ int last_tempo_adjust_value;
int last_mapped_tempo_adjust_value;
float the_tempo_adjust_float_value;
+
+int the_octave_adjust_value;
+int the_mapped_octave_adjust_value;
+int this_octave_adjust_value;
+int last_octave_adjust_value;
+int last_mapped_octave_adjust_value;
+float the_octave_adjust_float_value;
+
/*
Potentiometer transport_button_1 = Potentiometer(11);
Potentiometer transport_button_2 = Potentiometer(12);
@@ -285,6 +296,7 @@ char* step_padding;
float mapFloat(float x, float in_min, float in_max, float out_min, float out_max)
{
-return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
+ return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
+
@@ -11,6 +11,7 @@ void run_knob_routine()
knobs_cleared_to_update[0]=0;
knobs_cleared_to_update[1]=0;
+ knobs_cleared_to_update[2]=0;
/*
lcd.print("?f"); // clear the LCD
@@ -19,9 +20,9 @@ void run_knob_routine()
delay(500);
*/
-// knob_mode_select_LED.toggle();
-// delay(100);
-// knob_mode_select_LED.toggle();
+ // knob_mode_select_LED.toggle();
+ // delay(100);
+ // knob_mode_select_LED.toggle();
knob_mode++;
if(knob_mode > knob_mode_total)
{
@@ -78,7 +79,13 @@ void run_knob_routine()
break;
}
-
+ case 3:
+ {
+ lcd.print("?y0");
+ lcd.print("?x02");
+ lcd.print("octave adj.:");
+ break;
+ }
}
}
@@ -267,7 +274,7 @@ void run_knob_routine()
if((the_tempo_adjust_value >= (last_tempo_adjust_value+10)) || (the_tempo_adjust_value <= (last_tempo_adjust_value-10)))
{
the_mapped_tempo_adjust_value = map(the_tempo_adjust_value, -500, 500, -5, 5);
-
+
// Tempo Adjust
the_serial_message = "ZTA,";
// the_serial_message += raw_knob_values[0];
@@ -334,6 +341,68 @@ void run_knob_routine()
}
}
}
+
+ if(knob_mode == 3) // octave adjust
+
+
+ {
+
+ this_octave_adjust_value = map(raw_knob_values[0], 1, 1024, 512, -512);
+
+ if(this_octave_adjust_value == last_octave_adjust_value)
+ {
+ knobs_cleared_to_update[2] = 1;
+ }
+
+
+ if(knobs_cleared_to_update[2] == 1)
+ {
+ the_octave_adjust_value = this_octave_adjust_value;
+ the_octave_adjust_float_value = round(the_octave_adjust_value/100);
+
+
+ // float send_tempo = map(this_tempo,1,1024,-10.00, 10.00);
+
+
+
+ if((the_octave_adjust_value >= (last_octave_adjust_value+10)) || (the_octave_adjust_value <= (last_octave_adjust_value-10)))
+ {
+
+ the_mapped_octave_adjust_value = map(the_octave_adjust_value, -500, 500, -3, 5);
+
+
+ the_serial_message = "ZOC,";
+ // the_serial_message += raw_knob_values[0];
+ // whew. I don't know why I was so stupid earlier. This seems to work.
+ the_serial_message += the_mapped_octave_adjust_value;
+ the_serial_message += ";";
+ serial_printer(the_serial_message);
+
+
+ lcd.print("?y0");
+ lcd.print("?x14");
+
+ // return the cursor back to the tempo adjust point to continue indicating that
+ // the knob mode is tempo adjust
+ if(the_octave_adjust_value > 0)
+ {
+
+ lcd.print("+");
+
+ }
+
+
+
+ lcd.print(the_mapped_octave_adjust_value);
+ if(the_mapped_octave_adjust_value == 0)
+ {
+ lcd.print(" ");
+ }
+ }
+ // lcd.print("?y0x14");
+
+ }
+ }
}
@@ -348,3 +417,10 @@ void run_knob_routine()
+
+
+
+
+
+
+
@@ -1,6 +1,11 @@
void serial_printer(const char* message)
{
+ // version 4.2 was a continuous serial data stream.
+// Serial.print(message);
+
+// version 4.3 and above is experimentally going back to this format for easier parsing in max/msp... trying to kill roxor, and bring all of the hardware messaging into steppa.
Serial.print(message);
+
// last_serial = message;
return;
Oops, something went wrong.

0 comments on commit f5be861

Please sign in to comment.