Subversion Repositories svn.mios32

Compare Revisions

Ignore whitespace Rev 2531 → Rev 2532

/trunk/apps/sequencers/midibox_seq_v4_lite/core/seq_file_hw.c
211,7 → 211,7
return -1;
 
if( blm8x8_selected ) {
l = 24 + l-1;
l = 32 + l;
}
 
return l; // value is valid
304,24 → 304,27
 
char *word = strtok_r(NULL, separators, &brkt);
 
// M1..M8 -> SR 24..31
// M1..M8 or M1A..M8A -> SR 32..39
// M1B..M8B -> SR40..47
// M1C..M8C -> SR48..55
s32 sr = -1;
u8 blm8x8_selected = 0;
if( word[0] == 'M' ) {
blm8x8_selected = 1;
++word;
s32 m = get_dec(word);
s32 m = word[0] - '0';
s32 blm = word[1] ? (word[1]-'A') : 0;
 
if( m < 1 || m > 8 ) {
if( m < 1 || m > 8 || blm < 0 || blm >= SEQ_BLM8X8_NUM ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid SR value 'M%s'!", parameter, word);
#endif
continue;
}
sr = 24 + m-1;
sr = 32 + blm*8 + m;
} else {
sr = get_dec(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr >= (32 + SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid SR value '%s'!", parameter, word);
#endif
338,12 → 341,12
continue;
}
 
u8 din_value = ((sr-1)<<3) | pin;
u16 din_value = ((sr-1)<<3) | pin;
 
// compatibility with old configurations: if SRIO_NUM_SR hasn't been set to 23 (so that it's still 16)
// then map DIN SR 17..24 to 24..31
// then map DIN SR 17..24 to 32..39
if( !blm8x8_selected && MIOS32_SRIO_ScanNumGet() <= 16 && din_value >= 128 && din_value < 192 ) {
din_value += 56;
din_value += 128;
}
 
#if DEBUG_VERBOSE_LEVEL >= 3
434,24 → 437,27
 
char *word = strtok_r(NULL, separators, &brkt);
 
// M1..M8 -> SR 24..31
// M1..M8 or M1A..M8A -> SR 32..39
// M1B..M8B -> SR40..47
// M1C..M8C -> SR48..55
s32 sr = -1;
u8 blm8x8_selected = 0;
if( word[0] == 'M' ) {
blm8x8_selected = 1;
++word;
s32 m = get_dec(word);
s32 m = word[0] - '0';
s32 blm = word[1] ? (word[1]-'A') : 0;
 
if( m < 1 || m > 8 ) {
if( m < 1 || m > 8 || blm < 0 || blm >= SEQ_BLM8X8_NUM ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid SR value 'M%s'!", parameter, word);
#endif
continue;
}
sr = 24 + m-1;
sr = 32 + blm*8 + m;
} else {
sr = get_dec(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr >= (32 + SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid SR value '%s'!", parameter, word);
#endif
468,12 → 474,12
continue;
}
 
u8 dout_value = ((sr-1)<<3) | pin;
u16 dout_value = ((sr-1)<<3) | pin;
 
// compatibility with old configurations: if SRIO_NUM_SR hasn't been set to 23 (so that it's still 16)
// then map DOUT SR 17..24 to 24..31
// then map DOUT SR 17..24 to 32..39
if( !blm8x8_selected && MIOS32_SRIO_ScanNumGet() <= 16 && dout_value >= 128 && dout_value < 192 ) {
dout_value += 56;
dout_value += 128;
}
 
#if DEBUG_VERBOSE_LEVEL >= 3
633,7 → 639,7
} else if( strcasecmp(parameter, "GP_DIN_L_SR") == 0 || strcasecmp(parameter, "GP_DIN_R_SR") == 0 ) {
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
651,7 → 657,7
} else if( strcasecmp(parameter, "SRIO_NUM_SR") == 0 ) {
char *word = strtok_r(NULL, separators, &brkt);
s32 num_sr = get_dec(word);
if( num_sr < 1 || num_sr > 32 ) {
if( num_sr < 1 || num_sr > MIOS32_SRIO_NUM_SR ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in SRIO_NUM_SR definition: invalid value '%s'!", word);
#endif
675,7 → 681,7
} else if( strcasecmp(parameter, "GP_DOUT_L_SR") == 0 || strcasecmp(parameter, "GP_DOUT_R_SR") == 0 ) {
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
693,7 → 699,7
} else if( strcasecmp(parameter, "POS_DOUT_L_SR") == 0 || strcasecmp(parameter, "POS_DOUT_R_SR") == 0 ) {
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
792,7 → 798,7
#endif
continue;
}
u8 dout_value = ((value-1)<<3) | pin;
u16 dout_value = ((value-1)<<3) | pin;
 
if( strcasecmp(parameter, "COMMON1_PIN") == 0 ) {
seq_hwcfg_bpm_digits.common1_pin = dout_value;
844,7 → 850,7
#endif
continue;
}
u8 dout_value = ((value-1)<<3) | pin;
u16 dout_value = ((value-1)<<3) | pin;
 
if( strcasecmp(parameter, "COMMON1_PIN") == 0 ) {
seq_hwcfg_step_digits.common1_pin = dout_value;
1052,7 → 1058,7
 
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
1064,7 → 1070,7
} else if( strcasecmp(parameter, "CLK_SR") == 0 ) {
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
1078,7 → 1084,7
 
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
/trunk/apps/sequencers/midibox_seq_v4_lite/core/seq_hwcfg.h
28,105 → 28,105
/////////////////////////////////////////////////////////////////////////////
 
typedef struct {
u8 gp_din_l_sr;
u8 gp_din_r_sr;
u16 gp_din_l_sr;
u16 gp_din_r_sr;
 
u8 bar1;
u8 bar2;
u8 bar3;
u8 bar4;
u16 bar1;
u16 bar2;
u16 bar3;
u16 bar4;
 
u8 seq1;
u8 seq2;
u16 seq1;
u16 seq2;
 
u8 load;
u8 save;
u16 load;
u16 save;
 
u8 copy;
u8 paste;
u8 clear;
u8 undo;
u16 copy;
u16 paste;
u16 clear;
u16 undo;
 
u8 master;
u8 tap_tempo;
u8 stop;
u8 play;
u16 master;
u16 tap_tempo;
u16 stop;
u16 play;
 
u8 pause;
u8 metronome;
u8 ext_restart;
u16 pause;
u16 metronome;
u16 ext_restart;
 
u8 trigger;
u8 length;
u8 progression;
u8 groove;
u8 echo;
u8 humanizer;
u8 lfo;
u8 scale;
u16 trigger;
u16 length;
u16 progression;
u16 groove;
u16 echo;
u16 humanizer;
u16 lfo;
u16 scale;
 
u8 mute;
u8 midichn;
u16 mute;
u16 midichn;
 
u8 rec_arm;
u8 rec_step;
u8 rec_live;
u8 rec_poly;
u8 inout_fwd;
u8 transpose;
u16 rec_arm;
u16 rec_step;
u16 rec_live;
u16 rec_poly;
u16 inout_fwd;
u16 transpose;
} seq_hwcfg_button_t;
 
 
typedef struct {
u8 gp_dout_l_sr;
u8 gp_dout_r_sr;
u8 gp_dout_l_sr;
u8 gp_dout_r_sr;
 
u8 pos_dout_l_sr;
u8 pos_dout_r_sr;
u8 pos_dout_l_sr;
u8 pos_dout_r_sr;
 
u8 bar1;
u8 bar2;
u8 bar3;
u8 bar4;
u16 bar1;
u16 bar2;
u16 bar3;
u16 bar4;
 
u8 seq1;
u8 seq2;
u16 seq1;
u16 seq2;
 
u8 load;
u8 save;
u16 load;
u16 save;
 
u8 copy;
u8 paste;
u8 clear;
u8 undo;
u16 copy;
u16 paste;
u16 clear;
u16 undo;
 
u8 master;
u8 tap_tempo;
u8 stop;
u8 play;
u16 master;
u16 tap_tempo;
u16 stop;
u16 play;
 
u8 pause;
u8 metronome;
u8 ext_restart;
u16 pause;
u16 metronome;
u16 ext_restart;
 
u8 trigger;
u8 length;
u8 progression;
u8 groove;
u8 echo;
u8 humanizer;
u8 lfo;
u8 scale;
u16 trigger;
u16 length;
u16 progression;
u16 groove;
u16 echo;
u16 humanizer;
u16 lfo;
u16 scale;
 
u8 mute;
u8 midichn;
u16 mute;
u16 midichn;
 
u8 rec_arm;
u8 rec_step;
u8 rec_live;
u8 rec_poly;
u8 inout_fwd;
u8 transpose;
u16 rec_arm;
u16 rec_step;
u16 rec_live;
u16 rec_poly;
u16 inout_fwd;
u16 transpose;
} seq_hwcfg_led_t;
 
 
140,20 → 140,20
} seq_hwcfg_blm8x8_t;
 
typedef struct {
u8 enabled;
u8 segments_sr;
u8 common1_pin;
u8 common2_pin;
u8 common3_pin;
u8 common4_pin;
u8 enabled;
u8 segments_sr;
u16 common1_pin;
u16 common2_pin;
u16 common3_pin;
u16 common4_pin;
} seq_hwcfg_bpm_digits_t;
 
typedef struct {
u8 enabled;
u8 segments_sr;
u8 common1_pin;
u8 common2_pin;
u8 common3_pin;
u8 enabled;
u8 segments_sr;
u16 common1_pin;
u16 common2_pin;
u16 common3_pin;
} seq_hwcfg_step_digits_t;
 
typedef struct {
/trunk/apps/sequencers/midibox_seq_v4/core/app.c
422,7 → 422,7
void APP_SEQ_BLM8X8_NotifyToggle(u8 blm, u32 pin, u32 pin_value)
{
if( app_din_testmode ) {
DEBUG_MSG("[DIN_TESTMODE] BLM8x8%c Pin M%d D%d %s\n", 'A'+blm, (pin>>3)+1, pin&7, pin_value ? "depressed" : "pressed");
DEBUG_MSG("[DIN_TESTMODE] BLM8x8 Pin M%d%c D%d %s\n", (pin>>3)+1, 'A'+blm, pin&7, pin_value ? "depressed" : "pressed");
}
 
#ifndef MBSEQV4L
440,7 → 440,7
}
SEQ_UI_Button_Handler(pin, pin_value);
} else {
SEQ_UI_Button_Handler(pin + 184, pin_value);
SEQ_UI_Button_Handler(blm*64 + pin + 256, pin_value);
}
}
 
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_trklive.c
1,4 → 1,4
// $Id: seq_ui_pmute.c 759 2009-10-25 22:10:11Z tk $
// $Id$
/*
* Live Play Page
*
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_pattern_remix.c
===================================================================
--- trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_pattern_remix.c (revision 2531)
+++ trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_pattern_remix.c (revision 2532)
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_pattern_remix.c
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_inssel.c
===================================================================
--- trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_inssel.c (revision 0)
+++ trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_inssel.c (revision 2532)
@@ -0,0 +1,201 @@
+// $Id$
+/*
+ * Instrument selection page
+ *
+ * ==========================================================================
+ *
+ * Copyright (C) 2008 Thorsten Klose (tk@midibox.org)
+ * Licensed for personal non-commercial use only.
+ * All other rights reserved.
+ *
+ * ==========================================================================
+ */
+
+/////////////////////////////////////////////////////////////////////////////
+// Include files
+/////////////////////////////////////////////////////////////////////////////
+
+#include <mios32.h>
+#include "seq_lcd.h"
+#include "seq_ui.h"
+#include "seq_hwcfg.h"
+
+#include "seq_trg.h"
+#include "seq_cc.h"
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Local LED handler function
+/////////////////////////////////////////////////////////////////////////////
+static s32 LED_Handler(u16 *gp_leds)
+{
+ if( ui_cursor_flash ) // if flashing flag active: no LED flag set
+ return 0;
+
+ *gp_leds = 1 << ui_selected_instrument;
+
+ return 0; // no error
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Local encoder callback function
+// Should return:
+// 1 if value has been changed
+// 0 if value hasn't been changed
+// -1 if invalid or unsupported encoder
+/////////////////////////////////////////////////////////////////////////////
+static s32 Encoder_Handler(seq_ui_encoder_t encoder, s32 incrementer)
+{
+ u8 visible_track = SEQ_UI_VisibleTrackGet();
+
+ if( encoder <= SEQ_UI_ENCODER_GP16 ) {
+ // select new layer/instrument
+
+ if( encoder >= SEQ_TRG_NumInstrumentsGet(visible_track) )
+ return -1;
+ ui_selected_instrument = encoder;
+
+ if( seq_hwcfg_button_beh.ins_sel ) {
+ // if toggle function active: jump back to previous menu
+ // this is especially useful for the emulated MBSEQ, where we can only click on a single button
+ // (trigger gets deactivated when clicking on GP button or moving encoder)
+ seq_ui_button_state.INS_SEL = 0;
+ SEQ_UI_PageSet(ui_inssel_prev_page);
+ }
+
+ return 1; // value changed
+ } else if( encoder == SEQ_UI_ENCODER_Datawheel ) {
+ return SEQ_UI_Var8_Inc(&ui_selected_instrument, 0, SEQ_TRG_NumInstrumentsGet(visible_track)-1, incrementer);
+ }
+
+ return -1; // invalid or unsupported encoder
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Local button callback function
+// Should return:
+// 1 if value has been changed
+// 0 if value hasn't been changed
+// -1 if invalid or unsupported button
+/////////////////////////////////////////////////////////////////////////////
+s32 SEQ_UI_INSSEL_Button_Handler(seq_ui_button_t button, s32 depressed)
+{
+ if( depressed ) return 0; // ignore when button depressed
+
+#if 0
+ // leads to: comparison is always true due to limited range of data type
+ if( button >= SEQ_UI_BUTTON_GP1 && button <= SEQ_UI_BUTTON_GP16 ) {
+#else
+ if( button <= SEQ_UI_BUTTON_GP16 ) {
+#endif
+ // -> same handling like for encoders
+ return Encoder_Handler(button, 0);
+ }
+
+ switch( button ) {
+ case SEQ_UI_BUTTON_Select:
+ return -1; // unsupported (yet)
+
+ case SEQ_UI_BUTTON_Right:
+ case SEQ_UI_BUTTON_Up:
+ if( depressed ) return 0; // ignore when button depressed
+ return Encoder_Handler(SEQ_UI_ENCODER_Datawheel, 1);
+
+ case SEQ_UI_BUTTON_Left:
+ case SEQ_UI_BUTTON_Down:
+ if( depressed ) return 0; // ignore when button depressed
+ return Encoder_Handler(SEQ_UI_ENCODER_Datawheel, -1);
+ }
+
+ return -1; // invalid or unsupported button
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Local Display Handler function
+// IN: <high_prio>: if set, a high-priority LCD update is requested
+/////////////////////////////////////////////////////////////////////////////
+static s32 LCD_Handler(u8 high_prio)
+{
+ // layout drum mode (lower line shows drum labels):
+ // 00000000001111111111222222222233333333330000000000111111111122222222223333333333
+ // 01234567890123456789012345678901234567890123456789012345678901234567890123456789
+ // <--------------------------------------><-------------------------------------->
+ // Select Drum Instrument:
+ // BD SD LT MT HT CP MA RS CB CY OH CH Smp1 Smp2 Smp3 Smp4
+ // ...horizontal VU meters...
+
+ u8 visible_track = SEQ_UI_VisibleTrackGet();
+ u8 event_mode = SEQ_CC_Get(visible_track, SEQ_CC_MIDI_EVENT_MODE);
+
+ if( high_prio ) {
+ ///////////////////////////////////////////////////////////////////////////
+ // frequently update VU meters
+
+ SEQ_LCD_CursorSet(0, 1);
+
+ if( event_mode == SEQ_EVENT_MODE_Drum ) {
+ u8 drum;
+ u8 num_instruments = SEQ_TRG_NumInstrumentsGet(visible_track);
+ for(drum=0; drum<num_instruments; ++drum) {
+ if( seq_core_trk[visible_track].layer_muted & (1 << drum) )
+ SEQ_LCD_PrintString("Mute ");
+ else
+ SEQ_LCD_PrintHBar((seq_layer_vu_meter[drum] >> 3) & 0xf);
+ }
+ } else {
+ seq_core_trk_t *t = &seq_core_trk[visible_track];
+ u16 mask = 1 << visible_track;
+
+ if( seq_core_trk_muted & mask ) {
+ SEQ_LCD_PrintString("Mute ");
+ } else {
+ SEQ_LCD_PrintHBar(t->vu_meter >> 3);
+ }
+ }
+
+ return 0; // no error
+ }
+
+ u8 num_instruments = SEQ_TRG_NumInstrumentsGet(visible_track);
+
+ ///////////////////////////////////////////////////////////////////////////
+ SEQ_LCD_CursorSet(0, 0);
+
+ int i;
+ for(i=0; i<num_instruments; ++i) {
+ if( i == ui_selected_instrument && ui_cursor_flash ) {
+ SEQ_LCD_PrintSpaces(5);
+ } else {
+ if( event_mode == SEQ_EVENT_MODE_Drum ) {
+ SEQ_LCD_PrintTrackDrum(visible_track, i, (char *)seq_core_trk[visible_track].name);
+ } else {
+ SEQ_LCD_PrintFormattedString("INS%2d", i+1);
+ }
+ }
+ }
+
+ SEQ_LCD_PrintSpaces(80 - (5*num_instruments));
+
+ return 0; // no error
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// Initialisation
+/////////////////////////////////////////////////////////////////////////////
+s32 SEQ_UI_INSSEL_Init(u32 mode)
+{
+ // install callback routines
+ SEQ_UI_InstallButtonCallback(SEQ_UI_INSSEL_Button_Handler);
+ SEQ_UI_InstallEncoderCallback(Encoder_Handler);
+ SEQ_UI_InstallLEDCallback(LED_Handler);
+ SEQ_UI_InstallLCDCallback(LCD_Handler);
+
+ // we want to show horizontal VU meters
+ SEQ_LCD_InitSpecialChars(SEQ_LCD_CHARSET_HBars);
+
+ return 0; // no error
+}
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_inssel.c
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_pages.c
===================================================================
--- trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_pages.c (revision 2531)
+++ trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_pages.c (revision 2532)
@@ -47,10 +47,10 @@
{ "STEPSEL", "StpS.", "Step Selection ", 3, (void *)&SEQ_UI_STEPSEL_Init },
{ "TRGSEL", "TrgS.", "Trigger Selection ", 4, (void *)&SEQ_UI_TRGSEL_Init },
{ "PARSEL", "ParS.", "Param. Selection ", 5, (void *)&SEQ_UI_PARSEL_Init },
- { "TRACKSEL", "TrkS.", "Track Selection ", 6, (void *)&SEQ_UI_TRACKSEL_Init },
- { "BPM_PRESETS", "BpmP.", "BPM Presets ", 7, (void *)&SEQ_UI_BPM_PRESETS_Init },
+ { "INSEL", "InsS.", "Inst. Selection ", 6, (void *)&SEQ_UI_INSSEL_Init },
+ { "TRACKSEL", "TrkS.", "Track Selection ", 7, (void *)&SEQ_UI_TRACKSEL_Init },
+ { "BPM_PRESETS", "BpmP.", "BPM Presets ", 8, (void *)&SEQ_UI_BPM_PRESETS_Init },
- { "RES1", "Res1 ", "Reserved page #1 ", 8, (void *)&SEQ_UI_TODO_Init },
{ "RES2", "Res2 ", "Reserved page #2 ", 9, (void *)&SEQ_UI_TODO_Init },
{ "RES3", "Res3 ", "Reserved page #3 ", 10, (void *)&SEQ_UI_TODO_Init },
{ "RES4", "Res4 ", "Reserved page #4 ", 11, (void *)&SEQ_UI_TODO_Init },
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_pages.h
31,10 → 31,10
SEQ_UI_PAGE_STEPSEL = 3,
SEQ_UI_PAGE_TRGSEL = 4,
SEQ_UI_PAGE_PARSEL = 5,
SEQ_UI_PAGE_TRACKSEL = 6,
SEQ_UI_PAGE_BPM_PRESETS = 7,
SEQ_UI_PAGE_INSSEL = 6,
SEQ_UI_PAGE_TRACKSEL = 7,
SEQ_UI_PAGE_BPM_PRESETS = 8,
 
SEQ_UI_PAGE_DIRECT_RESERVED1 = 8,
SEQ_UI_PAGE_DIRECT_RESERVED2 = 9,
SEQ_UI_PAGE_DIRECT_RESERVED3 = 10,
SEQ_UI_PAGE_DIRECT_RESERVED4 = 11,
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_stepsel.c
135,7 → 135,7
// 0 if value hasn't been changed
// -1 if invalid or unsupported button
/////////////////////////////////////////////////////////////////////////////
static s32 Button_Handler(seq_ui_button_t button, s32 depressed)
s32 SEQ_UI_STEPSEL_Button_Handler(seq_ui_button_t button, s32 depressed)
{
if( depressed ) return 0; // ignore when button depressed
 
318,7 → 318,7
s32 SEQ_UI_STEPSEL_Init(u32 mode)
{
// install callback routines
SEQ_UI_InstallButtonCallback(Button_Handler);
SEQ_UI_InstallButtonCallback(SEQ_UI_STEPSEL_Button_Handler);
SEQ_UI_InstallEncoderCallback(Encoder_Handler);
SEQ_UI_InstallLEDCallback(LED_Handler);
SEQ_UI_InstallLCDCallback(LCD_Handler);
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_trgsel.c
34,8 → 34,9
 
u8 visible_track = SEQ_UI_VisibleTrackGet();
u8 event_mode = SEQ_CC_Get(visible_track, SEQ_CC_MIDI_EVENT_MODE);
u8 selbuttons_available = seq_hwcfg_blm8x8.dout_gp_mapping == 3;
 
if( event_mode == SEQ_EVENT_MODE_Drum )
if( event_mode == SEQ_EVENT_MODE_Drum && !selbuttons_available )
*gp_leds = 1 << ui_selected_instrument;
else
*gp_leds = 1 << ui_selected_trg_layer;
55,11 → 56,12
{
u8 visible_track = SEQ_UI_VisibleTrackGet();
u8 event_mode = SEQ_CC_Get(visible_track, SEQ_CC_MIDI_EVENT_MODE);
u8 selbuttons_available = seq_hwcfg_blm8x8.dout_gp_mapping == 3;
 
if( encoder <= SEQ_UI_ENCODER_GP16 ) {
// select new layer/instrument
 
if( event_mode == SEQ_EVENT_MODE_Drum ) {
if( event_mode == SEQ_EVENT_MODE_Drum && !selbuttons_available ) {
if( encoder >= SEQ_TRG_NumInstrumentsGet(visible_track) )
return -1;
ui_selected_instrument = encoder;
69,7 → 71,7
ui_selected_trg_layer = encoder;
}
 
if( seq_hwcfg_button_beh.par_layer ) {
if( seq_hwcfg_button_beh.trg_layer ) {
// if toggle function active: jump back to previous menu
// this is especially useful for the emulated MBSEQ, where we can only click on a single button
// (trigger gets deactivated when clicking on GP button or moving encoder)
79,7 → 81,7
 
return 1; // value changed
} else if( encoder == SEQ_UI_ENCODER_Datawheel ) {
if( event_mode == SEQ_EVENT_MODE_Drum ) {
if( event_mode == SEQ_EVENT_MODE_Drum && !selbuttons_available ) {
return SEQ_UI_Var8_Inc(&ui_selected_instrument, 0, SEQ_TRG_NumInstrumentsGet(visible_track)-1, incrementer);
} else {
return SEQ_UI_Var8_Inc(&ui_selected_trg_layer, 0, SEQ_TRG_NumLayersGet(visible_track)-1, incrementer);
97,7 → 99,7
// 0 if value hasn't been changed
// -1 if invalid or unsupported button
/////////////////////////////////////////////////////////////////////////////
static s32 Button_Handler(seq_ui_button_t button, s32 depressed)
s32 SEQ_UI_TRGSEL_Button_Handler(seq_ui_button_t button, s32 depressed)
{
if( depressed ) return 0; // ignore when button depressed
 
153,26 → 155,29
 
u8 visible_track = SEQ_UI_VisibleTrackGet();
u8 event_mode = SEQ_CC_Get(visible_track, SEQ_CC_MIDI_EVENT_MODE);
u8 selbuttons_available = seq_hwcfg_blm8x8.dout_gp_mapping == 3;
 
if( high_prio && event_mode == SEQ_EVENT_MODE_Drum ) {
///////////////////////////////////////////////////////////////////////////
// frequently update VU meters
if( high_prio ) {
if( event_mode == SEQ_EVENT_MODE_Drum && !selbuttons_available ) {
///////////////////////////////////////////////////////////////////////////
// frequently update VU meters
 
SEQ_LCD_CursorSet(0, 1);
SEQ_LCD_CursorSet(0, 1);
 
u8 drum;
u8 num_instruments = SEQ_TRG_NumInstrumentsGet(visible_track);
for(drum=0; drum<num_instruments; ++drum) {
if( seq_core_trk[visible_track].layer_muted & (1 << drum) )
SEQ_LCD_PrintString("Mute ");
else
SEQ_LCD_PrintHBar((seq_layer_vu_meter[drum] >> 3) & 0xf);
u8 drum;
u8 num_instruments = SEQ_TRG_NumInstrumentsGet(visible_track);
for(drum=0; drum<num_instruments; ++drum) {
if( seq_core_trk[visible_track].layer_muted & (1 << drum) )
SEQ_LCD_PrintString("Mute ");
else
SEQ_LCD_PrintHBar((seq_layer_vu_meter[drum] >> 3) & 0xf);
}
}
 
return 0; // no error
}
 
if( event_mode == SEQ_EVENT_MODE_Drum ) {
if( event_mode == SEQ_EVENT_MODE_Drum && !selbuttons_available ) {
u8 num_instruments = SEQ_TRG_NumInstrumentsGet(visible_track);
 
///////////////////////////////////////////////////////////////////////////
231,7 → 236,7
s32 SEQ_UI_TRGSEL_Init(u32 mode)
{
// install callback routines
SEQ_UI_InstallButtonCallback(Button_Handler);
SEQ_UI_InstallButtonCallback(SEQ_UI_TRGSEL_Button_Handler);
SEQ_UI_InstallEncoderCallback(Encoder_Handler);
SEQ_UI_InstallLEDCallback(LED_Handler);
SEQ_UI_InstallLCDCallback(LCD_Handler);
/trunk/apps/sequencers/midibox_seq_v4/core/seq_hwcfg.c
111,6 → 111,7
.mute = ((( 4 -1)<<3)+ 1),
.pattern = ((( 4 -1)<<3)+ 2),
.song = ((( 4 -1)<<3)+ 3),
.phrase = ((( 0 -1)<<3)+ 0),
 
// SR ignore Pin
.solo = ((( 4 -1)<<3)+ 4),
152,6 → 153,7
.utility = (((14 -1)<<3)+ 1),
.step_view = (((13 -1)<<3)+ 7),
.par_layer_sel = ((( 2 -1)<<3)+ 2),
.ins_sel = ((( 0 -1)<<3)+ 0),
.trg_layer_sel = ((( 2 -1)<<3)+ 3),
.track_sel = ((( 2 -1)<<3)+ 4),
 
172,6 → 174,7
.utility = ((( 2 -1)<<3)+ 1),
.step_view = ((( 2 -1)<<3)+ 2),
.par_layer_sel = ((( 0 -1)<<3)+ 0),
.ins_sel = ((( 0 -1)<<3)+ 0),
.trg_layer_sel = ((( 2 -1)<<3)+ 3),
.track_sel = ((( 2 -1)<<3)+ 4),
 
233,6 → 236,7
.loop = 1,
.follow = 1,
.bookmark = 1,
.mute = 1,
#if defined(MIOS32_FAMILY_EMULATION) && !defined(MIOS32_BOARD_IPAD)
.scrub = 1,
.menu = 1,
239,6 → 243,7
.step_view = 1,
.trg_layer = 1,
.par_layer = 1,
.ins_sel = 1,
.track_sel = 1,
.tempo_preset = 1,
#else
247,6 → 252,7
.step_view = 0,
.trg_layer = 0,
.par_layer = 0,
.ins_sel = 0,
.track_sel = 0,
.tempo_preset = 0,
#endif
295,6 → 301,7
.mute = ((( 2 -1)<<3)+ 1),
.pattern = ((( 2 -1)<<3)+ 2),
.song = ((( 2 -1)<<3)+ 3),
.phrase = ((( 0 -1)<<3)+ 0),
 
// SR ignore Pin
.solo = ((( 2 -1)<<3)+ 4),
345,6 → 352,7
// SR ignore Pin
.step_view = (((14 -1)<<3)+ 5),
.par_layer_sel = (((14 -1)<<3)+ 1),
.ins_sel = ((( 0 -1)<<3)+ 0),
.trg_layer_sel = (((14 -1)<<3)+ 2),
.track_sel = (((14 -1)<<3)+ 3),
 
388,6 → 396,7
// SR ignore Pin
.step_view = ((( 0 -1)<<3)+ 0),
.par_layer_sel = ((( 0 -1)<<3)+ 0),
.ins_sel = ((( 0 -1)<<3)+ 0),
.trg_layer_sel = ((( 0 -1)<<3)+ 0),
.track_sel = ((( 0 -1)<<3)+ 0),
 
/trunk/apps/sequencers/midibox_seq_v4/core/seq_hwcfg.h
44,95 → 44,97
/////////////////////////////////////////////////////////////////////////////
 
typedef struct {
u8 down;
u8 up;
u8 left;
u8 right;
u16 down;
u16 up;
u16 left;
u16 right;
 
u8 scrub;
u8 metronome;
u8 record;
u8 jam_live;
u8 jam_step;
u8 live;
u16 scrub;
u16 metronome;
u16 record;
u16 jam_live;
u16 jam_step;
u16 live;
 
u8 stop;
u8 pause;
u8 play;
u8 rew;
u8 fwd;
u8 loop;
u8 follow;
u16 stop;
u16 pause;
u16 play;
u16 rew;
u16 fwd;
u16 loop;
u16 follow;
 
u8 menu;
u8 select;
u8 exit;
u8 bookmark;
u16 menu;
u16 select;
u16 exit;
u16 bookmark;
 
u8 track[SEQ_HWCFG_NUM_TRACK];
u16 track[SEQ_HWCFG_NUM_TRACK];
 
u8 direct_track[SEQ_HWCFG_NUM_DIRECT_TRACK];
u16 direct_track[SEQ_HWCFG_NUM_DIRECT_TRACK];
 
u8 par_layer[SEQ_HWCFG_NUM_PAR_LAYER];
u16 par_layer[SEQ_HWCFG_NUM_PAR_LAYER];
 
u8 direct_bookmark[SEQ_HWCFG_NUM_DIRECT_BOOKMARK];
u16 direct_bookmark[SEQ_HWCFG_NUM_DIRECT_BOOKMARK];
 
u8 edit;
u8 mute;
u8 pattern;
u8 song;
u16 edit;
u16 mute;
u16 pattern;
u16 song;
u16 phrase;
 
u8 solo;
u8 fast;
u8 fast2;
u8 all;
u16 solo;
u16 fast;
u16 fast2;
u16 all;
 
u8 gp[SEQ_HWCFG_NUM_GP];
u16 gp[SEQ_HWCFG_NUM_GP];
 
u8 group[SEQ_HWCFG_NUM_GROUP];
u16 group[SEQ_HWCFG_NUM_GROUP];
 
u8 trg_layer[SEQ_HWCFG_NUM_TRG_LAYER];
u16 trg_layer[SEQ_HWCFG_NUM_TRG_LAYER];
 
u8 utility;
u8 step_view;
u8 trg_layer_sel;
u8 par_layer_sel;
u8 track_sel;
u16 utility;
u16 step_view;
u16 trg_layer_sel;
u16 par_layer_sel;
u16 ins_sel;
u16 track_sel;
 
u8 tap_tempo;
u8 tempo_preset;
u8 ext_restart;
u16 tap_tempo;
u16 tempo_preset;
u16 ext_restart;
 
u8 copy;
u8 paste;
u8 clear;
u8 undo;
u8 move;
u8 scroll;
u16 copy;
u16 paste;
u16 clear;
u16 undo;
u16 move;
u16 scroll;
 
u8 mixer;
u16 mixer;
 
u8 save;
u8 save_all;
u16 save;
u16 save_all;
 
u8 track_mode;
u8 track_groove;
u8 track_length;
u8 track_direction;
u8 track_morph;
u8 track_transpose;
u8 fx;
u16 track_mode;
u16 track_groove;
u16 track_length;
u16 track_direction;
u16 track_morph;
u16 track_transpose;
u16 fx;
 
u8 mute_all_tracks;
u8 mute_track_layers;
u8 mute_all_tracks_and_layers;
u8 unmute_all_tracks;
u8 unmute_track_layers;
u8 unmute_all_tracks_and_layers;
u16 mute_all_tracks;
u16 mute_track_layers;
u16 mute_all_tracks_and_layers;
u16 unmute_all_tracks;
u16 unmute_track_layers;
u16 unmute_all_tracks_and_layers;
 
u8 footswitch;
u8 enc_btn_fwd;
u8 pattern_remix;
u16 footswitch;
u16 enc_btn_fwd;
u16 pattern_remix;
} seq_hwcfg_button_t;
 
 
148,9 → 150,11
u32 scrub:1;
u32 menu:1;
u32 bookmark:1;
u32 mute:1;
u32 step_view:1;
u32 trg_layer:1;
u32 par_layer:1;
u32 ins_sel:1;
u32 track_sel:1;
u32 tempo_preset:1;
} seq_hwcfg_button_beh_t;
157,93 → 161,95
 
 
typedef struct {
u8 gp_dout_l_sr;
u8 gp_dout_r_sr;
u8 gp_dout_l2_sr;
u8 gp_dout_r2_sr;
u8 tracks_dout_l_sr;
u8 tracks_dout_r_sr;
u16 gp_dout_l_sr;
u16 gp_dout_r_sr;
u16 gp_dout_l2_sr;
u16 gp_dout_r2_sr;
u16 tracks_dout_l_sr;
u16 tracks_dout_r_sr;
 
u8 track[SEQ_HWCFG_NUM_TRACK];
u16 track[SEQ_HWCFG_NUM_TRACK];
 
u8 par_layer[SEQ_HWCFG_NUM_PAR_LAYER];
u16 par_layer[SEQ_HWCFG_NUM_PAR_LAYER];
 
u8 beat;
u8 measure;
u16 beat;
u16 measure;
 
u8 midi_in_combined;
u8 midi_out_combined;
u16 midi_in_combined;
u16 midi_out_combined;
 
u8 edit;
u8 mute;
u8 pattern;
u8 song;
u16 edit;
u16 mute;
u16 pattern;
u16 song;
u16 phrase;
 
u8 solo;
u8 fast;
u8 fast2;
u8 all;
u16 solo;
u16 fast;
u16 fast2;
u16 all;
 
u8 group[SEQ_HWCFG_NUM_GROUP];
u16 group[SEQ_HWCFG_NUM_GROUP];
 
u8 trg_layer[SEQ_HWCFG_NUM_TRG_LAYER];
u16 trg_layer[SEQ_HWCFG_NUM_TRG_LAYER];
 
u8 play;
u8 stop;
u8 pause;
u8 rew;
u8 fwd;
u8 loop;
u8 follow;
u16 play;
u16 stop;
u16 pause;
u16 rew;
u16 fwd;
u16 loop;
u16 follow;
 
u8 exit;
u8 select;
u8 menu;
u8 bookmark;
u8 scrub;
u8 metronome;
u16 exit;
u16 select;
u16 menu;
u16 bookmark;
u16 scrub;
u16 metronome;
 
u8 utility;
u8 copy;
u8 paste;
u8 clear;
u8 undo;
u8 move;
u8 scroll;
u16 utility;
u16 copy;
u16 paste;
u16 clear;
u16 undo;
u16 move;
u16 scroll;
 
u8 record;
u8 live;
u8 jam_live;
u8 jam_step;
u16 record;
u16 live;
u16 jam_live;
u16 jam_step;
 
u8 step_view;
u8 trg_layer_sel;
u8 par_layer_sel;
u8 track_sel;
u16 step_view;
u16 trg_layer_sel;
u16 par_layer_sel;
u16 ins_sel;
u16 track_sel;
 
u8 tap_tempo;
u8 tempo_preset;
u8 ext_restart;
u16 tap_tempo;
u16 tempo_preset;
u16 ext_restart;
 
u8 down;
u8 up;
u16 down;
u16 up;
 
u8 mixer;
u16 mixer;
 
u8 track_mode;
u8 track_groove;
u8 track_length;
u8 track_direction;
u8 track_transpose;
u8 track_morph;
u8 fx;
u16 track_mode;
u16 track_groove;
u16 track_length;
u16 track_direction;
u16 track_transpose;
u16 track_morph;
u16 fx;
 
u8 mute_all_tracks;
u8 mute_track_layers;
u8 mute_all_tracks_and_layers;
u8 unmute_all_tracks;
u8 unmute_track_layers;
u8 unmute_all_tracks_and_layers;
u16 mute_all_tracks;
u16 mute_track_layers;
u16 mute_all_tracks_and_layers;
u16 unmute_all_tracks;
u16 unmute_track_layers;
u16 unmute_all_tracks_and_layers;
} seq_hwcfg_led_t;
 
 
270,12 → 276,12
} seq_hwcfg_blm8x8_t;
 
typedef struct {
u8 enabled;
u8 segments_sr;
u8 common1_pin;
u8 common2_pin;
u8 common3_pin;
u8 common4_pin;
u8 enabled;
u8 segments_sr;
u16 common1_pin;
u16 common2_pin;
u16 common3_pin;
u16 common4_pin;
} seq_hwcfg_bpm_digits_t;
 
typedef struct {
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui.c
68,6 → 68,8
u8 ui_selected_step_view;
u8 ui_selected_step;
u8 ui_selected_item;
u8 ui_selected_bookmark;
u8 ui_selected_phrase;
u16 ui_selected_gp_buttons;
 
u8 ui_selected_item;
80,6 → 82,10
seq_ui_page_t ui_stepview_prev_page;
seq_ui_page_t ui_trglayer_prev_page;
seq_ui_page_t ui_parlayer_prev_page;
seq_ui_page_t ui_inssel_prev_page;
seq_ui_page_t ui_tracksel_prev_page;
seq_ui_page_t ui_bookmarks_prev_page;
seq_ui_page_t ui_mute_prev_page;
 
volatile u8 ui_cursor_flash;
volatile u8 ui_cursor_flash_overrun_ctr;
109,6 → 115,8
 
seq_ui_bookmark_t seq_ui_bookmarks[SEQ_UI_BOOKMARKS_NUM];
 
seq_ui_sel_view_t seq_ui_sel_view;
 
mios32_sys_time_t seq_play_timer;
 
 
139,9 → 147,6
 
static u16 ui_gp_leds;
 
static u16 ui_select_leds_green;
static u16 ui_select_leds_red;
 
#define UI_MSG_MAX_CHAR 31
static char ui_msg[2][UI_MSG_MAX_CHAR];
static u16 ui_msg_ctr;
149,8 → 154,6
 
static u16 ui_delayed_action_ctr;
 
static seq_ui_page_t ui_page_before_bookmark;
 
static u8 seq_ui_track_setup_visible_track;
static seq_ui_track_setup_t seq_ui_track_setup[SEQ_CORE_NUM_TRACKS];
 
181,6 → 184,8
ui_selected_step_view = 0;
ui_selected_step = 0;
ui_selected_item = 0;
ui_selected_bookmark = 0;
ui_selected_phrase = 0;
ui_selected_gp_buttons = 0;
 
seq_ui_options.ALL = 0;
198,13 → 203,11
 
ui_song_edit_pos = 0;
 
seq_ui_sel_view = SEQ_UI_SEL_VIEW_NONE;
 
// visible GP pattern
ui_gp_leds = 0x0000;
 
// select LEDs
ui_select_leds_green = 0x0000;
ui_select_leds_red = 0x0000;
 
// misc
seq_ui_backup_req = 0;
seq_ui_format_req = 0;
217,7 → 220,7
SEQ_UI_PageSet(SEQ_UI_PAGE_EDIT);
 
// finally init bookmarks
ui_page_before_bookmark = SEQ_UI_PAGE_EDIT;
ui_bookmarks_prev_page = SEQ_UI_PAGE_EDIT;
for(i=0; i<SEQ_UI_BOOKMARKS_NUM; ++i) {
char buffer[10];
seq_ui_bookmark_t *bm = (seq_ui_bookmark_t *)&seq_ui_bookmarks[i];
1182,6 → 1185,9
 
static s32 SEQ_UI_Button_Bookmark(s32 depressed)
{
if( !depressed )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_BOOKMARKS;
 
if( seq_hwcfg_button_beh.bookmark ) {
if( depressed ) return -1; // ignore when button depressed
if( !seq_ui_button_state.BOOKMARK ) // due to page change: button going to be set, clear other toggle buttons
1198,11 → 1204,11
 
if( seq_ui_button_state.BOOKMARK ) {
if( ui_page != SEQ_UI_PAGE_BOOKMARKS )
ui_page_before_bookmark = ui_page;
ui_bookmarks_prev_page = ui_page;
SEQ_UI_PageSet(SEQ_UI_PAGE_BOOKMARKS);
} else {
if( ui_page == SEQ_UI_PAGE_BOOKMARKS )
SEQ_UI_PageSet(ui_page_before_bookmark);
SEQ_UI_PageSet(ui_bookmarks_prev_page);
}
 
return 0; // no error
1212,7 → 1218,7
static s32 SEQ_UI_Button_DirectBookmark(s32 depressed, u32 bookmark_button)
{
if( !depressed )
ui_page_before_bookmark = ui_page;
ui_bookmarks_prev_page = ui_page;
 
return SEQ_UI_BOOKMARKS_Button_Handler(bookmark_button, depressed);
}
1289,11 → 1295,33
 
static s32 SEQ_UI_Button_Mute(s32 depressed)
{
if( !depressed )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_MUTE;
 
seq_ui_button_state.MUTE_PRESSED = depressed ? 0 : 1;
 
#if 0
// doesn't really work since MUTE button also selects layer mutes when pressed
//
if( seq_hwcfg_button_beh.mute ) {
if( depressed ) return -1; // ignore when button depressed
 
ui_mute_prev_page = ui_page;
SEQ_UI_PageSet(SEQ_UI_PAGE_MUTE);
} else {
if( seq_ui_button_state.MUTE_PRESSED ) {
ui_mute_prev_page = ui_page;
SEQ_UI_PageSet(SEQ_UI_PAGE_MUTE);
} else {
if( ui_page == SEQ_UI_PAGE_MUTE )
SEQ_UI_PageSet(ui_mute_prev_page);
}
}
#else
if( depressed ) return -1; // ignore when button depressed
 
SEQ_UI_PageSet(SEQ_UI_PAGE_MUTE);
#endif
 
return 0; // no error
}
1311,19 → 1339,18
 
static s32 SEQ_UI_Button_Pattern_Remix(s32 depressed)
{
if ( ui_page == SEQ_UI_PAGE_PATTERN_RMX ) {
if ( ui_page == SEQ_UI_PAGE_PATTERN_RMX ) {
#ifndef MIOS32_FAMILY_EMULATION
// to avoid race conditions using the same button(any other way of solving that?)
vTaskDelay(60);
// to avoid race conditions using the same button(any other way of solving that?)
vTaskDelay(60);
#endif
// a trick to use the same button with 2 functionalitys
ui_button_callback(SEQ_UI_BUTTON_Edit, depressed);
} else {
SEQ_UI_PageSet(SEQ_UI_PAGE_PATTERN_RMX);
}
return 0; // no error
// a trick to use the same button with 2 functionalitys
ui_button_callback(SEQ_UI_BUTTON_Edit, depressed);
} else {
SEQ_UI_PageSet(SEQ_UI_PAGE_PATTERN_RMX);
}
 
return 0; // no error
}
 
1338,6 → 1365,20
return 0; // no error
}
 
static s32 SEQ_UI_Button_Phrase(s32 depressed)
{
if( !depressed )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_PHRASE;
 
seq_ui_button_state.PHRASE_PRESSED = depressed ? 0 : 1;
 
if( depressed ) return -1; // ignore when button depressed
 
SEQ_UI_PageSet(SEQ_UI_PAGE_SONG);
 
return 0; // no error
}
 
static s32 SEQ_UI_Button_Solo(s32 depressed)
{
if( seq_hwcfg_button_beh.solo ) {
1354,6 → 1395,8
if( !seq_ui_button_state.SOLO )
seq_core_trk_soloed = 0;
 
SEQ_UI_Msg(SEQ_UI_MSG_USER, 1000, "Solo", seq_ui_button_state.SOLO ? " on " : " off");
 
return 0; // no error
}
 
1410,6 → 1453,9
// static seq_ui_page_t prev_page = SEQ_UI_PAGE_NONE;
// also used by seq_ui_stepsel
if( !depressed )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_STEPS;
 
if( seq_hwcfg_button_beh.step_view ) {
if( depressed ) return -1; // ignore when button depressed
if( !seq_ui_button_state.STEP_VIEW ) // due to page change: button going to be set, clear other toggle buttons
1480,7 → 1526,8
 
static s32 SEQ_UI_Button_TrackSel(s32 depressed)
{
static seq_ui_page_t prev_page = SEQ_UI_PAGE_NONE;
if( !depressed )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_TRACKS;
 
if( seq_hwcfg_button_beh.track_sel ) {
if( depressed ) return -1; // ignore when button depressed
1492,11 → 1539,11
}
 
if( seq_ui_button_state.TRACK_SEL ) {
prev_page = ui_page;
ui_tracksel_prev_page = ui_page;
SEQ_UI_PageSet(SEQ_UI_PAGE_TRACKSEL);
} else {
if( ui_page == SEQ_UI_PAGE_TRACKSEL )
SEQ_UI_PageSet(prev_page);
SEQ_UI_PageSet(ui_tracksel_prev_page);
}
 
return 0; // no error
1564,26 → 1611,81
return 0; // no error
}
 
static s32 SEQ_UI_Button_DirectTrack(s32 depressed, u32 track_button)
static s32 SEQ_UI_Button_DirectTrack(s32 depressed, u32 sel_button)
{
static u16 button_state = 0xffff; // all 16 buttons depressed
 
if( track_button >= 16 ) return -2; // max. 16 direct track buttons
if( sel_button >= 16 ) return -2; // max. 16 direct track buttons
 
if( depressed ) {
button_state |= (1 << track_button);
button_state |= (1 << sel_button);
return 0; // no error
}
 
button_state &= ~(1 << track_button);
button_state &= ~(1 << sel_button);
 
if( button_state == (~(1 << track_button) & 0xffff) ) {
// if only one select button pressed: radio-button function (1 of 16)
ui_selected_tracks = 1 << track_button;
ui_selected_group = track_button / 4;
u8 visible_track = SEQ_UI_VisibleTrackGet();
u8 selbuttons_available = seq_hwcfg_blm8x8.dout_gp_mapping == 3;
 
if( selbuttons_available ) {
// for selection buttons of Antilog PCB
switch( seq_ui_sel_view ) {
case SEQ_UI_SEL_VIEW_BOOKMARKS:
SEQ_UI_BOOKMARKS_Button_Handler((seq_ui_button_t)sel_button, depressed);
break;
case SEQ_UI_SEL_VIEW_STEPS:
SEQ_UI_STEPSEL_Button_Handler((seq_ui_button_t)sel_button, depressed);
break;
case SEQ_UI_SEL_VIEW_TRACKS: {
if( button_state == (~(1 << sel_button) & 0xffff) ) {
// if only one select button pressed: radio-button function (1 of 16)
ui_selected_tracks = 1 << sel_button;
ui_selected_group = sel_button / 4;
} else {
// if more than one select button pressed: toggle function (16 of 16)
ui_selected_tracks ^= 1 << sel_button;
}
} break;
case SEQ_UI_SEL_VIEW_PAR:
SEQ_UI_PARSEL_Button_Handler((seq_ui_button_t)sel_button, depressed);
break;
case SEQ_UI_SEL_VIEW_TRG:
SEQ_UI_TRGSEL_Button_Handler((seq_ui_button_t)sel_button, depressed);
break;
case SEQ_UI_SEL_VIEW_INS:
SEQ_UI_INSSEL_Button_Handler((seq_ui_button_t)sel_button, depressed);
break;
case SEQ_UI_SEL_VIEW_MUTE: {
u16 mask = 1 << sel_button;
u16 *mute_flags = seq_ui_button_state.MUTE_PRESSED ? &seq_core_trk[visible_track].layer_muted : &seq_core_trk_muted;
portENTER_CRITICAL();
if( *mute_flags & mask ) {
*mute_flags &= ~mask;
} else {
*mute_flags |= mask;
}
portEXIT_CRITICAL();
} break;
case SEQ_UI_SEL_VIEW_PHRASE: {
ui_selected_phrase = sel_button;
ui_song_edit_pos = ui_selected_phrase << 3;
 
// set song position and fetch patterns
SEQ_SONG_PosSet(ui_song_edit_pos);
SEQ_SONG_FetchPos(0, 0);
ui_song_edit_pos = SEQ_SONG_PosGet();
} break;
}
} else {
// if more than one select button pressed: toggle function (16 of 16)
ui_selected_tracks ^= 1 << track_button;
// common behaviour
if( button_state == (~(1 << sel_button) & 0xffff) ) {
// if only one select button pressed: radio-button function (1 of 16)
ui_selected_tracks = 1 << sel_button;
ui_selected_group = sel_button / 4;
} else {
// if more than one select button pressed: toggle function (16 of 16)
ui_selected_tracks ^= 1 << sel_button;
}
}
 
// set/clear encoder fast function if required
1597,6 → 1699,9
// static seq_ui_page_t prev_page = SEQ_UI_PAGE_NONE;
// also used by seq_ui_parsel.c
 
if( !depressed )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_PAR;
 
if( seq_hwcfg_button_beh.par_layer ) {
if( depressed ) return -1; // ignore when button depressed
if( !seq_ui_button_state.PAR_LAYER_SEL ) // due to page change: button going to be set, clear other toggle buttons
1710,6 → 1815,9
// static seq_ui_page_t prev_page = SEQ_UI_PAGE_NONE;
// also used by seq_ui_trgsel.c
 
if( !depressed )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_TRG;
 
if( seq_hwcfg_button_beh.trg_layer ) {
if( depressed ) return -1; // ignore when button depressed
if( !seq_ui_button_state.TRG_LAYER_SEL ) // due to page change: button going to be set, clear other toggle buttons
1807,6 → 1915,36
}
 
 
static s32 SEQ_UI_Button_InsSel(s32 depressed)
{
// static seq_ui_page_t prev_page = SEQ_UI_PAGE_NONE;
// also used by seq_ui_insel.c
 
if( !depressed )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_INS;
 
if( seq_hwcfg_button_beh.ins_sel ) {
if( depressed ) return -1; // ignore when button depressed
if( !seq_ui_button_state.INS_SEL ) // due to page change: button going to be set, clear other toggle buttons
seq_ui_button_state.PAGE_CHANGE_BUTTON_FLAGS = 0;
seq_ui_button_state.INS_SEL ^= 1; // toggle TRGSEL status (will also be released once GP button has been pressed)
} else {
seq_ui_button_state.INS_SEL = depressed ? 0 : 1;
}
 
if( seq_ui_button_state.INS_SEL ) {
if( ui_page != SEQ_UI_PAGE_INSSEL ) {
ui_inssel_prev_page = ui_page;
SEQ_UI_PageSet(SEQ_UI_PAGE_INSSEL);
}
} else {
if( ui_page == SEQ_UI_PAGE_INSSEL )
SEQ_UI_PageSet(ui_inssel_prev_page);
}
 
return 0; // no error
}
 
static s32 SEQ_UI_Button_Mixer(s32 depressed)
{
if( depressed ) return -1; // ignore when button depressed
2091,6 → 2229,8
return SEQ_UI_Button_TrgLayer(pin_value, i);
if( pin == seq_hwcfg_button.trg_layer_sel )
return SEQ_UI_Button_TrgLayerSel(pin_value);
if( pin == seq_hwcfg_button.ins_sel )
return SEQ_UI_Button_InsSel(pin_value);
 
if( pin == seq_hwcfg_button.left )
return SEQ_UI_Button_Left(pin_value);
2169,6 → 2309,8
return SEQ_UI_Button_Pattern(pin_value);
if( pin == seq_hwcfg_button.song )
return SEQ_UI_Button_Song(pin_value);
if( pin == seq_hwcfg_button.phrase )
return SEQ_UI_Button_Phrase(pin_value);
 
if( pin == seq_hwcfg_button.solo )
return SEQ_UI_Button_Solo(pin_value);
2834,7 → 2976,7
SEQ_LED_PinSet(seq_hwcfg_led.track[3], (selected_tracks & (1 << 3)));
}
 
SEQ_LED_PinSet(seq_hwcfg_led.track_sel, ui_page == SEQ_UI_PAGE_TRACKSEL);
SEQ_LED_PinSet(seq_hwcfg_led.track_sel, ui_page == SEQ_UI_PAGE_TRACKSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_TRACKS);
// parameter layer LEDs
// in song page: layer buttons are used to select the cursor position
2847,7 → 2989,7
SEQ_LED_PinSet(seq_hwcfg_led.par_layer[1], (ui_selected_par_layer == 1));
SEQ_LED_PinSet(seq_hwcfg_led.par_layer[2], (ui_selected_par_layer >= 2) || seq_ui_button_state.PAR_LAYER_SEL);
}
SEQ_LED_PinSet(seq_hwcfg_led.par_layer_sel, ui_page == SEQ_UI_PAGE_PARSEL);
SEQ_LED_PinSet(seq_hwcfg_led.par_layer_sel, ui_page == SEQ_UI_PAGE_PARSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_PAR);
// group LEDs
// in song page: track and group buttons are used to select the cursor position
2867,16 → 3009,20
SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[0], (ui_selected_trg_layer == 0));
SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[1], (ui_selected_trg_layer == 1));
SEQ_LED_PinSet(seq_hwcfg_led.trg_layer[2], (ui_selected_trg_layer >= 2) || seq_ui_button_state.TRG_LAYER_SEL);
SEQ_LED_PinSet(seq_hwcfg_led.trg_layer_sel, ui_page == SEQ_UI_PAGE_TRGSEL);
SEQ_LED_PinSet(seq_hwcfg_led.trg_layer_sel, ui_page == SEQ_UI_PAGE_TRGSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_TRG);
 
// instrument layer LEDs
SEQ_LED_PinSet(seq_hwcfg_led.ins_sel, ui_page == SEQ_UI_PAGE_INSSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_INS);
// remaining LEDs
SEQ_LED_PinSet(seq_hwcfg_led.edit, ui_page == SEQ_UI_PAGE_EDIT);
SEQ_LED_PinSet(seq_hwcfg_led.mute, ui_page == SEQ_UI_PAGE_MUTE);
SEQ_LED_PinSet(seq_hwcfg_led.mute, ui_page == SEQ_UI_PAGE_MUTE || seq_ui_sel_view == SEQ_UI_SEL_VIEW_MUTE);
SEQ_LED_PinSet(seq_hwcfg_led.pattern, ui_page == SEQ_UI_PAGE_PATTERN);
if( SEQ_SONG_ActiveGet() )
SEQ_LED_PinSet(seq_hwcfg_led.song, 1);
else
SEQ_LED_PinSet(seq_hwcfg_led.song, ui_cursor_flash ? 0 : (ui_page == SEQ_UI_PAGE_SONG));
SEQ_LED_PinSet(seq_hwcfg_led.phrase, seq_ui_button_state.PHRASE_PRESSED || seq_ui_sel_view == SEQ_UI_SEL_VIEW_PHRASE);
SEQ_LED_PinSet(seq_hwcfg_led.mixer, ui_page == SEQ_UI_PAGE_MIXER);
 
SEQ_LED_PinSet(seq_hwcfg_led.track_mode, ui_page == SEQ_UI_PAGE_TRKMODE);
2904,11 → 3050,11
SEQ_LED_PinSet(seq_hwcfg_led.loop, seq_core_state.LOOP);
SEQ_LED_PinSet(seq_hwcfg_led.follow, seq_core_state.FOLLOW);
SEQ_LED_PinSet(seq_hwcfg_led.step_view, ui_page == SEQ_UI_PAGE_STEPSEL);
SEQ_LED_PinSet(seq_hwcfg_led.step_view, ui_page == SEQ_UI_PAGE_STEPSEL || seq_ui_sel_view == SEQ_UI_SEL_VIEW_STEPS);
 
SEQ_LED_PinSet(seq_hwcfg_led.select, seq_ui_button_state.SELECT_PRESSED);
SEQ_LED_PinSet(seq_hwcfg_led.menu, seq_ui_button_state.MENU_PRESSED);
SEQ_LED_PinSet(seq_hwcfg_led.bookmark, ui_page == SEQ_UI_PAGE_BOOKMARKS);
SEQ_LED_PinSet(seq_hwcfg_led.bookmark, ui_page == SEQ_UI_PAGE_BOOKMARKS || seq_ui_sel_view == SEQ_UI_SEL_VIEW_BOOKMARKS);
 
// handle double functions
if( seq_ui_button_state.MENU_PRESSED ) {
3156,7 → 3302,6
}
}
 
 
if( seq_hwcfg_blm8x8.enabled ) {
if( seq_hwcfg_blm8x8.dout_gp_mapping == 1 ) {
// for wilba's frontpanel
3202,6 → 3347,10
} else if( seq_hwcfg_blm8x8.dout_gp_mapping == 3 ) {
// for Antilog frontpanel
 
// default view
if( seq_ui_sel_view == SEQ_UI_SEL_VIEW_NONE )
seq_ui_sel_view = SEQ_UI_SEL_VIEW_TRACKS;
 
// BLM_X DOUT -> GP LED mapping
// left/right half offsets; green,red
// 0 = 8,9 1 = 11,10 2 = 13,12 3 = 15,14
3293,21 → 3442,73
// BLM_X DOUT -> Select LED mapping
// like above, just next SR
 
u16 select_leds_green = 0x0000;
u16 select_leds_red = 0x0000;
 
switch( seq_ui_sel_view ) {
case SEQ_UI_SEL_VIEW_BOOKMARKS:
select_leds_green = 1 << ui_selected_bookmark;
break;
case SEQ_UI_SEL_VIEW_STEPS: {
int num_steps = SEQ_TRG_NumStepsGet(visible_track);
 
if( num_steps > 128 )
select_leds_green = 1 << ui_selected_step_view;
else if( num_steps > 64 )
select_leds_green = 3 << (2*ui_selected_step_view);
else
select_leds_green = 15 << (4*ui_selected_step_view);
 
if( sequencer_running ) {
u8 played_step_view = (seq_core_trk[visible_track].step / 16);
if( num_steps > 128 )
select_leds_red = 1 << played_step_view;
else if( num_steps > 64 )
select_leds_red = 3 << (2*played_step_view);
else
select_leds_red = 15 << (4*played_step_view);
}
} break;
case SEQ_UI_SEL_VIEW_TRACKS:
select_leds_green = ui_selected_tracks;
break;
case SEQ_UI_SEL_VIEW_PAR:
select_leds_green = 1 << ui_selected_par_layer;
break;
case SEQ_UI_SEL_VIEW_TRG:
select_leds_green = 1 << ui_selected_trg_layer;
break;
case SEQ_UI_SEL_VIEW_INS:
select_leds_green = 1 << ui_selected_instrument;
break;
case SEQ_UI_SEL_VIEW_MUTE:
if( seq_ui_button_state.MUTE_PRESSED ) {
select_leds_green = seq_core_trk[visible_track].layer_muted | seq_core_trk[visible_track].layer_muted_from_midi;
} else {
select_leds_green = seq_core_trk_muted;
}
break;
case SEQ_UI_SEL_VIEW_PHRASE:
select_leds_green = 1 << ui_selected_phrase;
break;
}
 
 
// Select row, first quarter
{
u8 value = 0;
 
if( ui_select_leds_green & (1 << 0) ) value |= (1 << 0);
if( ui_select_leds_red & (1 << 0) ) value |= (1 << 1);
if( select_leds_green & (1 << 0) ) value |= (1 << 0);
if( select_leds_red & (1 << 0) ) value |= (1 << 1);
 
if( ui_select_leds_green & (1 << 1) ) value |= (1 << 3);
if( ui_select_leds_red & (1 << 1) ) value |= (1 << 2);
if( select_leds_green & (1 << 1) ) value |= (1 << 3);
if( select_leds_red & (1 << 1) ) value |= (1 << 2);
 
if( ui_select_leds_green & (1 << 2) ) value |= (1 << 5);
if( ui_select_leds_red & (1 << 2) ) value |= (1 << 4);
if( select_leds_green & (1 << 2) ) value |= (1 << 5);
if( select_leds_red & (1 << 2) ) value |= (1 << 4);
 
if( ui_select_leds_green & (1 << 3) ) value |= (1 << 7);
if( ui_select_leds_red & (1 << 3) ) value |= (1 << 6);
if( select_leds_green & (1 << 3) ) value |= (1 << 7);
if( select_leds_red & (1 << 3) ) value |= (1 << 6);
 
seq_blm8x8_led_row[0][2] = value;
}
3316,17 → 3517,17
{
u8 value = 0;
 
if( ui_select_leds_green & (1 << 4) ) value |= (1 << 0);
if( ui_select_leds_red & (1 << 4) ) value |= (1 << 1);
if( select_leds_green & (1 << 4) ) value |= (1 << 0);
if( select_leds_red & (1 << 4) ) value |= (1 << 1);
 
if( ui_select_leds_green & (1 << 5) ) value |= (1 << 3);
if( ui_select_leds_red & (1 << 5) ) value |= (1 << 2);
if( select_leds_green & (1 << 5) ) value |= (1 << 3);
if( select_leds_red & (1 << 5) ) value |= (1 << 2);
 
if( ui_select_leds_green & (1 << 6) ) value |= (1 << 5);
if( ui_select_leds_red & (1 << 6) ) value |= (1 << 4);
if( select_leds_green & (1 << 6) ) value |= (1 << 5);
if( select_leds_red & (1 << 6) ) value |= (1 << 4);
 
if( ui_select_leds_green & (1 << 7) ) value |= (1 << 7);
if( ui_select_leds_red & (1 << 7) ) value |= (1 << 6);
if( select_leds_green & (1 << 7) ) value |= (1 << 7);
if( select_leds_red & (1 << 7) ) value |= (1 << 6);
 
seq_blm8x8_led_row[0][6] = value;
}
3335,17 → 3536,17
{
u8 value = 0;
 
if( ui_select_leds_green & (1 << 8) ) value |= (1 << 0);
if( ui_select_leds_red & (1 << 8) ) value |= (1 << 1);
if( select_leds_green & (1 << 8) ) value |= (1 << 0);
if( select_leds_red & (1 << 8) ) value |= (1 << 1);
 
if( ui_select_leds_green & (1 << 9) ) value |= (1 << 3);
if( ui_select_leds_red & (1 << 9) ) value |= (1 << 2);
if( select_leds_green & (1 << 9) ) value |= (1 << 3);
if( select_leds_red & (1 << 9) ) value |= (1 << 2);
 
if( ui_select_leds_green & (1 << 10) ) value |= (1 << 5);
if( ui_select_leds_red & (1 << 10) ) value |= (1 << 4);
if( select_leds_green & (1 << 10) ) value |= (1 << 5);
if( select_leds_red & (1 << 10) ) value |= (1 << 4);
 
if( ui_select_leds_green & (1 << 11) ) value |= (1 << 7);
if( ui_select_leds_red & (1 << 11) ) value |= (1 << 6);
if( select_leds_green & (1 << 11) ) value |= (1 << 7);
if( select_leds_red & (1 << 11) ) value |= (1 << 6);
 
seq_blm8x8_led_row[1][2] = value;
}
3354,17 → 3555,17
{
u8 value = 0;
 
if( ui_select_leds_green & (1 << 12) ) value |= (1 << 0);
if( ui_select_leds_red & (1 << 12) ) value |= (1 << 1);
if( select_leds_green & (1 << 12) ) value |= (1 << 0);
if( select_leds_red & (1 << 12) ) value |= (1 << 1);
 
if( ui_select_leds_green & (1 << 13) ) value |= (1 << 3);
if( ui_select_leds_red & (1 << 13) ) value |= (1 << 2);
if( select_leds_green & (1 << 13) ) value |= (1 << 3);
if( select_leds_red & (1 << 13) ) value |= (1 << 2);
 
if( ui_select_leds_green & (1 << 14) ) value |= (1 << 5);
if( ui_select_leds_red & (1 << 14) ) value |= (1 << 4);
if( select_leds_green & (1 << 14) ) value |= (1 << 5);
if( select_leds_red & (1 << 14) ) value |= (1 << 4);
 
if( ui_select_leds_green & (1 << 15) ) value |= (1 << 7);
if( ui_select_leds_red & (1 << 15) ) value |= (1 << 6);
if( select_leds_green & (1 << 15) ) value |= (1 << 7);
if( select_leds_red & (1 << 15) ) value |= (1 << 6);
 
seq_blm8x8_led_row[1][6] = value;
}
4102,7 → 4303,7
bm->flags.METRONOME = seq_core_state.METRONOME;
bm->flags.LOOP = seq_core_state.LOOP;
bm->flags.FOLLOW = seq_core_state.FOLLOW;
bm->page = (u8)ui_page_before_bookmark;
bm->page = (u8)ui_bookmarks_prev_page;
bm->group = ui_selected_group;
bm->par_layer = ui_selected_par_layer;
bm->trg_layer = ui_selected_trg_layer;
/trunk/apps/sequencers/midibox_seq_v4/core/seq_blm8x8.c
18,6 → 18,7
#include <mios32.h>
 
#include "seq_blm8x8.h"
#include "seq_hwcfg.h"
 
 
/////////////////////////////////////////////////////////////////////////////
121,12 → 122,17
u8 sr = config->button_din_sr - 1;
 
// ensure that change won't be propagated to normal DIN handler
MIOS32_DIN_SRChangedGetAndClear(sr, 0xff);
u8 sr_value = MIOS32_DIN_SRGet(sr);
if( blm == 2 && seq_hwcfg_blm8x8.dout_gp_mapping == 3 ) {
// only first 4 bits are used by matrix
MIOS32_DIN_SRChangedGetAndClear(sr, 0x0f);
sr_value |= 0xf0;
} else {
MIOS32_DIN_SRChangedGetAndClear(sr, 0xff);
}
 
// cheap debounce handling. ignore any changes if debounce_ctr > 0
if( !seq_blm8x8_debounce_ctr ) {
u8 sr_value = MIOS32_DIN_SRGet(sr);
 
// *** set change notification and new value. should not be interrupted ***
MIOS32_IRQ_Disable();
 
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui.h
49,6 → 49,7
u32 STEP_VIEW:1;
u32 PAR_LAYER_SEL:1;
u32 TRG_LAYER_SEL:1;
u32 INS_SEL:1;
u32 TRACK_SEL:1;
u32 TEMPO_PRESET:1;
u32 BOOKMARK:1;
62,6 → 63,7
u32 MUTE_PRESSED:1;
u32 PATTERN_PRESSED:1;
u32 SONG_PRESSED:1;
u32 PHRASE_PRESSED:1;
u32 FAST_ENCODERS:1;
u32 FAST2_ENCODERS:1;
u32 SOLO:1;
175,6 → 177,19
} seq_ui_edit_datawheel_mode_t;
#define SEQ_UI_EDIT_DATAWHEEL_MODE_NUM 5
 
typedef enum {
SEQ_UI_SEL_VIEW_NONE = 0,
SEQ_UI_SEL_VIEW_BOOKMARKS,
SEQ_UI_SEL_VIEW_STEPS,
SEQ_UI_SEL_VIEW_TRACKS,
SEQ_UI_SEL_VIEW_PAR,
SEQ_UI_SEL_VIEW_TRG,
SEQ_UI_SEL_VIEW_INS,
SEQ_UI_SEL_VIEW_MUTE,
SEQ_UI_SEL_VIEW_PHRASE
} seq_ui_sel_view_t;
 
 
typedef union {
u8 ALL;
 
315,6 → 330,7
extern s32 SEQ_UI_STEPSEL_Init(u32 mode);
extern s32 SEQ_UI_TRGSEL_Init(u32 mode);
extern s32 SEQ_UI_PARSEL_Init(u32 mode);
extern s32 SEQ_UI_INSSEL_Init(u32 mode);
extern s32 SEQ_UI_TRACKSEL_Init(u32 mode);
extern s32 SEQ_UI_BPM_PRESETS_Init(u32 mode);
extern s32 SEQ_UI_EDIT_Init(u32 mode);
424,6 → 440,10
extern s32 SEQ_UI_Bookmark_Restore(u8 bookmark);
 
extern s32 SEQ_UI_BOOKMARKS_Button_Handler(seq_ui_button_t button, s32 depressed);
extern s32 SEQ_UI_STEPSEL_Button_Handler(seq_ui_button_t button, s32 depressed);
extern s32 SEQ_UI_PARSEL_Button_Handler(seq_ui_button_t button, s32 depressed);
extern s32 SEQ_UI_TRGSEL_Button_Handler(seq_ui_button_t button, s32 depressed);
extern s32 SEQ_UI_INSSEL_Button_Handler(seq_ui_button_t button, s32 depressed);
 
 
/////////////////////////////////////////////////////////////////////////////
443,6 → 463,8
extern u8 ui_selected_step_view;
extern u8 ui_selected_step;
extern u8 ui_selected_item;
extern u8 ui_selected_bookmark;
extern u8 ui_selected_phrase;
extern u16 ui_selected_gp_buttons;
 
extern u16 ui_hold_msg_ctr;
453,6 → 475,10
extern seq_ui_page_t ui_stepview_prev_page;
extern seq_ui_page_t ui_trglayer_prev_page;
extern seq_ui_page_t ui_parlayer_prev_page;
extern seq_ui_page_t ui_inssel_prev_page;
extern seq_ui_page_t ui_tracksel_prev_page;
extern seq_ui_page_t ui_bookmarks_prev_page;
extern seq_ui_page_t ui_mute_prev_page;
 
extern volatile u8 ui_cursor_flash;
extern volatile u8 ui_cursor_flash_overrun_ctr;
482,6 → 508,8
extern seq_ui_edit_view_t seq_ui_edit_view;
extern seq_ui_edit_datawheel_mode_t seq_ui_edit_datawheel_mode;
 
extern seq_ui_sel_view_t seq_ui_sel_view;
 
extern seq_ui_options_t seq_ui_options;
 
extern seq_ui_bookmark_t seq_ui_bookmarks[SEQ_UI_BOOKMARKS_NUM];
/trunk/apps/sequencers/midibox_seq_v4/core/seq_led.c
55,26 → 55,27
if( SEQ_FILE_HW_Valid() ) {
return 0;
} else {
pin += 184;
pin += 256;
}
}
#else
if( pin < 184 )
if( pin < 256 )
return MIOS32_DOUT_PinSet(pin, value);
#endif
 
if( pin >= 184 && pin < 248 ) {
if( seq_hwcfg_blm8x8.dout_gp_mapping == 2 && !SEQ_FILE_HW_Valid() ) {
// MBSEQ V4L SRIO Board
if( pin >= 216 ) {
pin = (pin & 0xf8) | (7 - (pin&7));
}
u8 sr = (pin-256) / 8;
 
if( sr >= (SEQ_BLM8X8_NUM*8) )
return -1; // SR disabled
 
if( seq_hwcfg_blm8x8.dout_gp_mapping == 2 && !SEQ_FILE_HW_Valid() ) {
// MBSEQ V4L SRIO Board
if( sr >= 4 && sr <= 7 ) {
pin = (pin & 0xf8) | (7 - (pin&7));
}
 
return SEQ_BLM8X8_LEDSet(0, pin-184, value);
}
 
return -1; // pin not available
return SEQ_BLM8X8_LEDSet(sr / 8, pin % 64, value);
}
 
 
84,7 → 85,7
/////////////////////////////////////////////////////////////////////////////
s32 SEQ_LED_SRSet(u32 sr, u8 value)
{
if( sr >= 128 )
if( sr >= (32 + SEQ_BLM8X8_NUM*8) )
return -1; // SR disabled
 
#ifdef MBSEQV4L
95,25 → 96,23
if( SEQ_FILE_HW_Valid() ) {
return 0;
} else {
sr += 23;
sr += 32;
}
}
 
#else
if( sr < 23 )
if( sr < 32 )
return MIOS32_DOUT_SRSet(sr, value);
#endif
 
if( sr >= 23 && sr < 31 ) {
if( seq_hwcfg_blm8x8.dout_gp_mapping == 2 && sr >= 27 ) {
// MBSEQ V4L SRIO Board
value = mios32_dout_reverse_tab[value];
}
sr -= 32;
 
return SEQ_BLM8X8_LEDSRSet(0, sr-23, value);
if( seq_hwcfg_blm8x8.dout_gp_mapping == 2 && sr >= 4 && sr <= 7 ) {
// MBSEQ V4L SRIO Board
value = mios32_dout_reverse_tab[value];
}
 
return -1; // SR not available
return SEQ_BLM8X8_LEDSRSet(sr / 8, sr % 8, value);
}
 
/////////////////////////////////////////////////////////////////////////////
122,29 → 121,27
/////////////////////////////////////////////////////////////////////////////
s32 SEQ_LED_SRGet(u32 sr)
{
if( sr >= 128 )
return 0; // SR disabled
if( sr >= (32 + SEQ_BLM8X8_NUM*8) )
return 0; // SR not available... return 0
 
#ifdef MBSEQV4L
if( sr < 8 )
return BLM_CHEAPO_DOUT_SRGet(sr);
#else
if( sr < 23 )
if( sr < 32 )
return MIOS32_DOUT_SRGet(sr);
#endif
 
if( sr >= 23 && sr < 31 ) {
u8 value = SEQ_BLM8X8_LEDSRGet(0, sr-23);
sr -= 32;
 
if( seq_hwcfg_blm8x8.dout_gp_mapping == 2 && sr >= 27 ) {
// MBSEQ V4L SRIO Board
value = mios32_dout_reverse_tab[value];
}
u8 value = SEQ_BLM8X8_LEDSRGet(sr / 8, sr % 8);
 
return value;
if( seq_hwcfg_blm8x8.dout_gp_mapping == 2 && sr >= 4 && sr <= 7 ) {
// MBSEQ V4L SRIO Board
value = mios32_dout_reverse_tab[value];
}
 
return 0; // SR not available... return 0
return value;
}
 
 
/trunk/apps/sequencers/midibox_seq_v4/core/seq_file_hw.c
213,7 → 213,7
return -1;
 
if( blm8x8_selected ) {
l = 24 + l-1;
l = 32 + l;
}
 
return l; // value is valid
362,6 → 362,8
seq_hwcfg_button_beh.follow = flag;
} else if( strcasecmp(parameter, "MENU") == 0 ) {
seq_hwcfg_button_beh.menu = flag;
} else if( strcasecmp(parameter, "MUTE") == 0 ) {
seq_hwcfg_button_beh.mute = flag;
} else if( strcasecmp(parameter, "BOOKMARK") == 0 ) {
seq_hwcfg_button_beh.bookmark = flag;
} else if( strcasecmp(parameter, "STEP_VIEW") == 0 ) {
370,6 → 372,8
seq_hwcfg_button_beh.trg_layer = flag;
} else if( strcasecmp(parameter, "PAR_LAYER") == 0 ) {
seq_hwcfg_button_beh.par_layer = flag;
} else if( strcasecmp(parameter, "INS_SEL") == 0 ) {
seq_hwcfg_button_beh.ins_sel = flag;
} else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
seq_hwcfg_button_beh.track_sel = flag;
} else if( strcasecmp(parameter, "TEMPO_PRESET") == 0 ) {
391,24 → 395,27
 
char *word = strtok_r(NULL, separators, &brkt);
 
// M1..M8 -> SR 24..31
// M1..M8 or M1A..M8A -> SR 32..39
// M1B..M8B -> SR40..47
// M1C..M8C -> SR48..55
s32 sr = -1;
u8 blm8x8_selected = 0;
if( word[0] == 'M' ) {
blm8x8_selected = 1;
++word;
s32 m = get_dec(word);
s32 m = word[0] - '0';
s32 blm = word[1] ? (word[1]-'A') : 0;
 
if( m < 1 || m > 8 ) {
if( m < 1 || m > 8 || blm < 0 || blm >= SEQ_BLM8X8_NUM ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid SR value 'M%s'!", parameter, word);
#endif
continue;
}
sr = 24 + m-1;
sr = 32 + blm*8 + m;
} else {
sr = get_dec(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr >= (32 + SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in BUTTON_%s definition: invalid SR value '%s'!", parameter, word);
#endif
425,12 → 432,12
continue;
}
 
u8 din_value = ((sr-1)<<3) | pin;
u16 din_value = ((sr-1)<<3) | pin;
 
// compatibility with old configurations: if SRIO_NUM_SR hasn't been set to 23 (so that it's still 16)
// then map DIN SR 17..24 to 24..31
// then map DIN SR 17..24 to 32..39
if( !blm8x8_selected && MIOS32_SRIO_ScanNumGet() <= 16 && din_value >= 128 && din_value < 192 ) {
din_value += 56;
din_value += 128;
}
 
#if DEBUG_VERBOSE_LEVEL >= 3
493,6 → 500,8
seq_hwcfg_button.pattern = din_value;
} else if( strcasecmp(parameter, "SONG") == 0 ) {
seq_hwcfg_button.song = din_value;
} else if( strcasecmp(parameter, "PHRASE") == 0 ) {
seq_hwcfg_button.phrase = din_value;
} else if( strcasecmp(parameter, "SOLO") == 0 ) {
seq_hwcfg_button.solo = din_value;
} else if( strcasecmp(parameter, "FAST2") == 0 ) {
516,6 → 525,8
seq_hwcfg_button.trg_layer_sel = din_value;
} else if( strcasecmp(parameter, "PAR_LAYER_SEL") == 0 ) {
seq_hwcfg_button.par_layer_sel = din_value;
} else if( strcasecmp(parameter, "INS_SEL") == 0 ) {
seq_hwcfg_button.ins_sel = din_value;
} else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
seq_hwcfg_button.track_sel = din_value;
} else if( strcasecmp(parameter, "TAP_TEMPO") == 0 ) {
612,24 → 623,27
 
char *word = strtok_r(NULL, separators, &brkt);
 
// M1..M8 -> SR 24..31
// M1..M8 or M1A..M8A -> SR 32..39
// M1B..M8B -> SR40..47
// M1C..M8C -> SR48..55
s32 sr = -1;
u8 blm8x8_selected = 0;
if( word[0] == 'M' ) {
blm8x8_selected = 1;
++word;
s32 m = get_dec(word);
s32 m = word[0] - '0';
s32 blm = word[1] ? (word[1]-'A') : 0;
 
if( m < 1 || m > 8 ) {
if( m < 1 || m > 8 || blm < 0 || blm >= SEQ_BLM8X8_NUM ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid SR value 'M%s'!", parameter, word);
#endif
continue;
}
sr = 24 + m-1;
sr = 32 + blm*8 + m;
} else {
sr = get_dec(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr >= (32 + SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in LED_%s definition: invalid SR value '%s'!", parameter, word);
#endif
646,12 → 660,12
continue;
}
 
u8 dout_value = ((sr-1)<<3) | pin;
u16 dout_value = ((sr-1)<<3) | pin;
 
// compatibility with old configurations: if SRIO_NUM_SR hasn't been set to 23 (so that it's still 16)
// then map DOUT SR 17..24 to 24..31
// then map DOUT SR 17..24 to 32..39
if( !blm8x8_selected && MIOS32_SRIO_ScanNumGet() <= 16 && dout_value >= 128 && dout_value < 192 ) {
dout_value += 56;
dout_value += 128;
}
 
#if DEBUG_VERBOSE_LEVEL >= 3
680,6 → 694,8
seq_hwcfg_led.pattern = dout_value;
} else if( strcasecmp(parameter, "SONG") == 0 ) {
seq_hwcfg_led.song = dout_value;
} else if( strcasecmp(parameter, "PHRASE") == 0 ) {
seq_hwcfg_led.phrase = dout_value;
} else if( strcasecmp(parameter, "SOLO") == 0 ) {
seq_hwcfg_led.solo = dout_value;
} else if( strcasecmp(parameter, "FAST2") == 0 ) {
748,6 → 764,8
seq_hwcfg_led.trg_layer_sel = dout_value;
} else if( strcasecmp(parameter, "PAR_LAYER_SEL") == 0 ) {
seq_hwcfg_led.par_layer_sel = dout_value;
} else if( strcasecmp(parameter, "INS_SEL") == 0 ) {
seq_hwcfg_led.ins_sel = dout_value;
} else if( strcasecmp(parameter, "TRACK_SEL") == 0 ) {
seq_hwcfg_led.track_sel = dout_value;
} else if( strcasecmp(parameter, "TAP_TEMPO") == 0 ) {
897,7 → 915,7
} else if( strcasecmp(parameter, "TRACKS_DOUT_L_SR") == 0 || strcasecmp(parameter, "TRACKS_DOUT_R_SR") == 0 ) {
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
941,7 → 959,7
 
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in GP_DOUT_%s definition: invalid SR value '%s'!", parameter, word);
#endif
1043,9 → 1061,19
////////////////////////////////////////////////////////////////////////////////////////////
// BLM8X8_
////////////////////////////////////////////////////////////////////////////////////////////
} else if( strncasecmp(parameter, "BLM8X8_", 7) == 0 ) {
parameter += 7;
} else if( strncasecmp(parameter, "BLM8X8_", 7) == 0 ||
strncasecmp(parameter, "BLM8X8A_", 8) == 0 ||
strncasecmp(parameter, "BLM8X8B_", 8) == 0 ||
strncasecmp(parameter, "BLM8X8C_", 8) == 0 ) {
int blm = 0;
if( parameter[6] >= 'A' && parameter[6] <= 'C' ) {
blm = parameter[6] - 'A';
parameter += 8;
} else {
parameter += 7;
}
 
 
char *word = strtok_r(NULL, separators, &brkt);
s32 value = get_dec(word);
if( value < 0 ) {
1059,9 → 1087,7
DEBUG_MSG("[SEQ_FILE_HW] BLM8X8_%s: %d", parameter, value);
#endif
 
int blm = 0; // TODO: multiple BLMs
 
if( strcasecmp(parameter, "ENABLED") == 0 ) {
if( blm == 0 && strcasecmp(parameter, "ENABLED") == 0 ) {
seq_hwcfg_blm8x8.enabled = value;
} else if( strcasecmp(parameter, "DOUT_CATHODES_SR") == 0 ) {
seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
1079,7 → 1105,7
seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
config.led_dout_sr = value;
SEQ_BLM8X8_ConfigSet(blm, config);
} else if( strcasecmp(parameter, "DOUT_GP_MAPPING") == 0 ) {
} else if( blm == 0 && strcasecmp(parameter, "DOUT_GP_MAPPING") == 0 ) {
seq_hwcfg_blm8x8.dout_gp_mapping = value;
} else if( strcasecmp(parameter, "DIN_SR") == 0 ) {
seq_blm8x8_config_t config = SEQ_BLM8X8_ConfigGet(blm);
1127,7 → 1153,7
#endif
continue;
}
u8 dout_value = ((value-1)<<3) | pin;
u16 dout_value = ((value-1)<<3) | pin;
 
if( strcasecmp(parameter, "COMMON1_PIN") == 0 ) {
seq_hwcfg_bpm_digits.common1_pin = dout_value;
1179,7 → 1205,7
#endif
continue;
}
u8 dout_value = ((value-1)<<3) | pin;
u16 dout_value = ((value-1)<<3) | pin;
 
if( strcasecmp(parameter, "COMMON1_PIN") == 0 ) {
seq_hwcfg_step_digits.common1_pin = dout_value;
1387,7 → 1413,7
 
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
1399,7 → 1425,7
} else if( strcasecmp(parameter, "CLK_SR") == 0 ) {
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
1413,7 → 1439,7
 
char *word = strtok_r(NULL, separators, &brkt);
s32 sr = get_sr(word);
if( sr < 0 || sr > 32 ) {
if( sr < 0 || sr > (32+SEQ_BLM8X8_NUM*8) ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[SEQ_FILE_HW] ERROR in %s definition: invalid SR value '%s'!", parameter, word);
#endif
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_midimon.c
1,4 → 1,4
// $Id: seq_ui_pmute.c 607 2009-06-19 21:43:41Z tk $
// $Id$
/*
* MIDI Monitor Page
*
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_fx_dupl.c
===================================================================
--- trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_fx_dupl.c (revision 2531)
+++ trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_fx_dupl.c (revision 2532)
@@ -1,4 +1,4 @@
-// $Id: seq_ui_fx_limit.c 1142 2011-02-17 23:19:36Z tk $
+// $Id$
/*
* Duplicate Note Fx page
*
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_fx_dupl.c
Property changes:
Added: svn:keywords
## -0,0 +1 ##
+Id
\ No newline at end of property
Index: trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_song.c
===================================================================
--- trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_song.c (revision 2531)
+++ trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_song.c (revision 2532)
@@ -663,9 +663,9 @@
switch( ui_selected_item ) {
case ITEM_POS:
- ui_song_edit_pos = (u8)button << 3;
+ ui_selected_phrase = (u8)button;
+ ui_song_edit_pos = ui_selected_phrase << 3;
-
// send to external
SEQ_MIDI_IN_ExtCtrlSend(SEQ_MIDI_IN_EXT_CTRL_PHRASE, ui_song_edit_pos >> 3, 0);
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_parsel.c
80,7 → 80,7
// 0 if value hasn't been changed
// -1 if invalid or unsupported gp_button
/////////////////////////////////////////////////////////////////////////////
static s32 Button_Handler(seq_ui_button_t button, s32 depressed)
s32 SEQ_UI_PARSEL_Button_Handler(seq_ui_button_t button, s32 depressed)
{
if( depressed ) return 0; // ignore when button depressed
 
181,7 → 181,7
s32 SEQ_UI_PARSEL_Init(u32 mode)
{
// install callback routines
SEQ_UI_InstallButtonCallback(Button_Handler);
SEQ_UI_InstallButtonCallback(SEQ_UI_PARSEL_Button_Handler);
SEQ_UI_InstallEncoderCallback(Encoder_Handler);
SEQ_UI_InstallLEDCallback(LED_Handler);
SEQ_UI_InstallLCDCallback(LCD_Handler);
/trunk/apps/sequencers/midibox_seq_v4/core/seq_ui_bookmarks.c
31,7 → 31,6
// Local variables
/////////////////////////////////////////////////////////////////////////////
 
static u8 last_bookmark = 0;
static u8 store_state;
 
/////////////////////////////////////////////////////////////////////////////
48,7 → 47,7
if( ui_cursor_flash ) // if flashing flag active: no LED flag set
return 0;
 
*gp_leds = (1 << last_bookmark);
*gp_leds = (1 << ui_selected_bookmark);
 
return 0; // no error
}
69,8 → 68,8
#else
if( encoder <= SEQ_UI_ENCODER_GP16 ) {
#endif
last_bookmark = encoder;
SEQ_UI_Bookmark_Restore(last_bookmark);
ui_selected_bookmark = encoder;
SEQ_UI_Bookmark_Restore(ui_selected_bookmark);
return 1;
}
 
98,11 → 97,11
if( depressed ) {
SEQ_UI_UnInstallDelayedActionCallback(Button_StoreRequest);
if( store_state == 1 ) { // depressed within 1 second: select bookmark
SEQ_UI_Bookmark_Restore(last_bookmark);
SEQ_UI_Bookmark_Restore(ui_selected_bookmark);
}
return 0;
}
last_bookmark = button;
ui_selected_bookmark = button;
store_state = 1;
SEQ_UI_InstallDelayedActionCallback(Button_StoreRequest, 500, 0);
 
153,7 → 152,7
break; // just to ensure...
seq_ui_bookmark_t *bm = (seq_ui_bookmark_t *)&seq_ui_bookmarks[i];
 
if( ui_cursor_flash && (i == last_bookmark) )
if( ui_cursor_flash && (i == ui_selected_bookmark) )
SEQ_LCD_PrintSpaces(5);
else
SEQ_LCD_PrintStringPadded(bm->name, 5);
186,7 → 185,7
static void Button_StoreRequest(u32 state)
{
if( store_state == 1 ) {
SEQ_UI_Msg(last_bookmark >= 8 ? SEQ_UI_MSG_DELAYED_ACTION_R : SEQ_UI_MSG_DELAYED_ACTION, 2001,
SEQ_UI_Msg(ui_selected_bookmark >= 8 ? SEQ_UI_MSG_DELAYED_ACTION_R : SEQ_UI_MSG_DELAYED_ACTION, 2001,
"Hold Button", "to store Bookmark!");
SEQ_UI_InstallDelayedActionCallback(Button_StoreRequest, 2000, 0);
store_state = 2;
193,9 → 192,9
} else {
store_state = 0;
// store into selected slot
SEQ_UI_Bookmark_Store(last_bookmark);
SEQ_UI_Bookmark_Store(ui_selected_bookmark);
 
SEQ_UI_Msg(last_bookmark >= 8 ? SEQ_UI_MSG_USER_R : SEQ_UI_MSG_USER, 2000,
SEQ_UI_Msg(ui_selected_bookmark >= 8 ? SEQ_UI_MSG_USER_R : SEQ_UI_MSG_USER, 2000,
"Storing", "Bookmark!");
#if !defined(MIOS32_FAMILY_EMULATION)
// this yield ensures, that the display will be updated before storing the file
203,16 → 202,16
#endif
// and store file
MUTEX_SDCARD_TAKE;
s32 error = SEQ_FILE_BM_Write(seq_file_session_name, (last_bookmark < 8) ? 1 : 0);
s32 error = SEQ_FILE_BM_Write(seq_file_session_name, (ui_selected_bookmark < 8) ? 1 : 0);
MUTEX_SDCARD_GIVE;
if( error < 0 )
SEQ_UI_SDCardErrMsg(2000, error);
else {
// return to bookmarked page
SEQ_UI_PageSet((seq_ui_page_t)seq_ui_bookmarks[last_bookmark].page);
SEQ_UI_PageSet((seq_ui_page_t)seq_ui_bookmarks[ui_selected_bookmark].page);
 
// and print message
SEQ_UI_Msg(last_bookmark >= 8 ? SEQ_UI_MSG_USER_R : SEQ_UI_MSG_USER, 2000,
SEQ_UI_Msg(ui_selected_bookmark >= 8 ? SEQ_UI_MSG_USER_R : SEQ_UI_MSG_USER, 2000,
"Bookmark", "stored!");
}
}
/trunk/apps/sequencers/midibox_seq_v4/Makefile
67,6 → 67,7
core/seq_ui_stepsel.c \
core/seq_ui_trgsel.c \
core/seq_ui_parsel.c \
core/seq_ui_inssel.c \
core/seq_ui_tracksel.c \
core/seq_ui_trklive.c \
core/seq_cv.c \
/trunk/apps/sequencers/midibox_seq_v4/hwcfg/wilba_tpd/MBSEQ_HW.V4
420,6 → 420,7
LED_MUTE M6 3
LED_PATTERN M6 2
LED_SONG M7 3
LED_PHRASE 0 0
 
# SR Pin
LED_SOLO M6 1
470,6 → 471,7
LED_STEP_VIEW M3 1
LED_PAR_LAYER_SEL 0 0
LED_TRG_LAYER_SEL 0 0
LED_INS_SEL 0 0
LED_TRACK_SEL 0 0
 
# SR Pin
552,6 → 554,7
BUTTON_MUTE M6 2
BUTTON_PATTERN M6 3
BUTTON_SONG M7 2
BUTTON_PHRASE 0 0
 
# SR Pin
BUTTON_SOLO M6 4
628,6 → 631,7
# SR Pin
BUTTON_PAR_LAYER_SEL 0 0
BUTTON_TRG_LAYER_SEL 0 0
BUTTON_INS_SEL 0 0
 
# SR Pin
BUTTON_UTILITY M3 2
717,6 → 721,7
BUTTON_BEH_FOLLOW 1
BUTTON_BEH_SCRUB 0
BUTTON_BEH_MENU 0
BUTTON_BEH_MUTE 1
BUTTON_BEH_BOOKMARK 1
BUTTON_BEH_STEP_VIEW 0
BUTTON_BEH_TRG_LAYER 0
/trunk/apps/sequencers/midibox_seq_v4/hwcfg/standard_v4/MBSEQ_HW.V4
419,6 → 419,7
LED_MUTE 2 1
LED_PATTERN 2 2
LED_SONG 2 3
LED_PHRASE 0 0
 
# SR Pin
LED_SOLO 2 4
469,6 → 470,7
LED_STEP_VIEW 0 0
LED_PAR_LAYER_SEL 0 0
LED_TRG_LAYER_SEL 0 0
LED_INS_SEL 0 0
LED_TRACK_SEL 0 0
 
# SR Pin
554,6 → 556,7
BUTTON_MUTE 4 1
BUTTON_PATTERN 4 2
BUTTON_SONG 4 3
BUTTON_PHRASE 0 0
 
# SR Pin
BUTTON_SOLO 4 4
625,7 → 628,8
BUTTON_TRG_LAYER_SEL 2 3
BUTTON_TRACK_SEL 2 4
 
BUTTON_PAR_LAYER_SEL 0 0
BUTTON_PAR_LAYER_SEL 0 0
BUTTON_INS_SEL 0 0
 
# SR Pin
BUTTON_PATTERN_RMX 0 0
712,6 → 716,7
BUTTON_BEH_FOLLOW 1
BUTTON_BEH_SCRUB 0
BUTTON_BEH_MENU 0
BUTTON_BEH_MUTE 1
BUTTON_BEH_BOOKMARK 1
BUTTON_BEH_STEP_VIEW 0
BUTTON_BEH_TRG_LAYER 0
/trunk/apps/sequencers/midibox_seq_v4/hwcfg/antilog/MBSEQ_HW.V4
256,6 → 256,21
BLM8X8_DIN_SR 2
 
 
# second Matrix
BLM8X8B_DOUT_CATHODES_SR 3
BLM8X8B_DOUT_CATHODES_INV_MASK 0xff
BLM8X8B_DOUT_ANODES_INV_MASK 0xff
BLM8X8B_DOUT_LED_SR 4
BLM8X8B_DIN_SR 5
 
# third Matrix
BLM8X8C_DOUT_CATHODES_SR 5
BLM8X8C_DOUT_CATHODES_INV_MASK 0x00
BLM8X8C_DOUT_ANODES_INV_MASK 0x00
BLM8X8C_DOUT_LED_SR 6
BLM8X8C_DIN_SR 7
 
 
##################################################
# Optional BPM digits
##################################################
407,8 → 422,8
LED_PAR_LAYER_C 0 0
 
# SR Pin
LED_BEAT 0 0
LED_MEASURE 0 0
LED_BEAT M5A 4
LED_MEASURE M5A 5
 
# SR Pin
LED_MIDI_IN_COMBINED 0 0
415,16 → 430,17
LED_MIDI_OUT_COMBINED 0 0
 
# SR Pin
LED_EDIT 0 0
LED_MUTE 0 0
LED_PATTERN 0 0
LED_SONG 0 0
LED_EDIT M8B 0
LED_MUTE M7C 3
LED_PATTERN M8B 3
LED_SONG M8B 5
LED_PHRASE M7C 2
 
# SR Pin
LED_SOLO 0 0
LED_FAST 0 0
LED_SOLO M2C 1
LED_FAST M8A 3
LED_FAST2 0 0
LED_ALL 0 0
LED_ALL M8A 5
 
# SR Pin
LED_GROUP1 0 0
438,38 → 454,39
LED_TRG_LAYER_C 0 0
 
# SR Pin
LED_PLAY 0 0
LED_STOP 0 0
LED_PAUSE 0 0
LED_REW 0 0
LED_FWD 0 0
LED_LOOP 0 0
LED_PLAY M5C 0
LED_STOP M4C 0
LED_PAUSE M6C 0
LED_REW M2C 0
LED_FWD M3C 0
LED_LOOP M4C 1
LED_FOLLOW 0 0
 
# SR Pin
LED_EXIT 0 0
LED_SELECT 0 0
LED_MENU 0 0
LED_BOOKMARK 0 0
LED_EXIT M4B 5
LED_SELECT M8A 7
LED_MENU M4B 7
LED_BOOKMARK M1C 2
LED_SCRUB 0 0
LED_METRONOME 0 0
LED_RECORD 0 0
LED_METRONOME M3C 1
LED_RECORD M5C 1
LED_JAM_LIVE 0 0
LED_JAM_STEP 0 0
LED_LIVE 0 0
LED_UTILITY 0 0
LED_COPY 0 0
LED_PASTE 0 0
LED_CLEAR 0 0
LED_LIVE M6C 1
LED_UTILITY M8B 7
LED_COPY M4A 0
LED_PASTE M4A 3
LED_CLEAR M4A 5
LED_UNDO 0 0
LED_MOVE 0 0
LED_SCROLL 0 0
LED_MOVE M4A 7
LED_SCROLL M8A 0
 
# SR Pin
LED_STEP_VIEW 0 0
LED_PAR_LAYER_SEL 0 0
LED_TRG_LAYER_SEL 0 0
LED_TRACK_SEL 0 0
LED_STEP_VIEW M1C 3
LED_PAR_LAYER_SEL M1C 5
LED_TRG_LAYER_SEL M7C 5
LED_INS_SEL M7C 4
LED_TRACK_SEL M1C 4
 
# SR Pin
LED_TAP_TEMPO 0 0
477,8 → 494,8
LED_EXT_RESTART 0 0
 
# SR Pin
LED_DOWN 0 0
LED_UP 0 0
LED_DOWN M4B 0
LED_UP M4B 3
 
# SR Pin
LED_MIXER 0 0
504,142 → 521,136
##################################################
# Button assignments to DIN pins
# SR = 0: Button disabled
# SR = 1..23: directly triggered from DIN pin
# SR = M1..M8: triggered from a 8x8 button matrix
# SR = 1..32: directly triggered from DIN pin
# SR = M1A..M8A: triggered from the first 8x8 button matrix
# SR = M1B..M8B: triggered from the second 8x8 button matrix
# SR = M1B..M8B: triggered from the third 8x8 button matrix
##################################################
 
# SR Pin
BUTTON_DOWN M4 2
BUTTON_UP M4 3
BUTTON_DOWN M4B 0
BUTTON_UP M4B 1
BUTTON_LEFT 0 0
BUTTON_RIGHT 0 0
 
# SR Pin
BUTTON_SCRUB M4 4
BUTTON_METRONOME M4 5
BUTTON_SCRUB 0 0
BUTTON_METRONOME M3C 1
BUTTON_TAP_TEMPO 0 0
BUTTON_JAM_LIVE 0 0
BUTTON_JAM_STEP 0 0
 
# SR Pin
BUTTON_STOP M3 5
BUTTON_PAUSE M2 4
BUTTON_PLAY M2 5
BUTTON_REW M3 4
BUTTON_FWD M1 4
BUTTON_LOOP 0 0
BUTTON_STOP M4C 0
BUTTON_PAUSE M6C 0
BUTTON_PLAY M5C 0
BUTTON_REW M2C 0
BUTTON_FWD M3C 0
BUTTON_LOOP M4C 1
BUTTON_FOLLOW 0 0
 
# SR Pin
BUTTON_MENU M7 5
BUTTON_SELECT M8 4
BUTTON_EXIT M8 5
BUTTON_MENU M4B 3
BUTTON_SELECT M8A 7
BUTTON_EXIT M4B 2
 
# SR Pin
BUTTON_TRACK1 M7 6
BUTTON_TRACK2 M7 7
BUTTON_TRACK3 M5 6
BUTTON_TRACK4 M5 7
BUTTON_TRACK1 0 0
BUTTON_TRACK2 0 0
BUTTON_TRACK3 0 0
BUTTON_TRACK4 0 0
 
# SR Pin
BUTTON_PAR_LAYER_A M4 6
BUTTON_PAR_LAYER_B M4 7
BUTTON_PAR_LAYER_C M3 6
BUTTON_PAR_LAYER_A 0 0
BUTTON_PAR_LAYER_B 0 0
BUTTON_PAR_LAYER_C 0 0
 
# SR Pin
BUTTON_EDIT M5 3
BUTTON_MUTE M6 2
BUTTON_PATTERN M6 3
BUTTON_SONG M7 2
BUTTON_EDIT M8B 4
BUTTON_MUTE M7C 1
BUTTON_PATTERN M8B 5
BUTTON_SONG M8B 6
BUTTON_PHRASE M7C 0
 
# SR Pin
BUTTON_SOLO M6 4
BUTTON_FAST M6 5
BUTTON_SOLO M2C 1
BUTTON_FAST M8A 5
BUTTON_FAST2 0 0
BUTTON_ALL M7 4
BUTTON_ALL M8A 6
 
# SR Pin
BUTTON_GP1 M5 0
BUTTON_GP2 M5 1
BUTTON_GP3 M6 0
BUTTON_GP4 M6 1
BUTTON_GP5 M7 0
BUTTON_GP6 M7 1
BUTTON_GP7 M8 0
BUTTON_GP8 M8 1
BUTTON_GP9 M4 0
BUTTON_GP10 M4 1
BUTTON_GP11 M3 0
BUTTON_GP12 M3 1
BUTTON_GP13 M2 0
BUTTON_GP14 M2 1
BUTTON_GP15 M1 0
BUTTON_GP16 M1 1
BUTTON_GP1 M2A 0
BUTTON_GP2 M2A 1
BUTTON_GP3 M2A 2
BUTTON_GP4 M2A 3
BUTTON_GP5 M6A 4
BUTTON_GP6 M6A 5
BUTTON_GP7 M6A 6
BUTTON_GP8 M6A 7
BUTTON_GP9 M2B 0
BUTTON_GP10 M2B 1
BUTTON_GP11 M2B 2
BUTTON_GP12 M2B 3
BUTTON_GP13 M6B 4
BUTTON_GP14 M6B 5
BUTTON_GP15 M6B 6
BUTTON_GP16 M6B 7
 
# SR Pin
BUTTON_GROUP1 M8 6
BUTTON_GROUP2 M8 7
BUTTON_GROUP3 M6 6
BUTTON_GROUP4 M6 7
BUTTON_GROUP1 0 0
BUTTON_GROUP2 0 0
BUTTON_GROUP3 0 0
BUTTON_GROUP4 0 0
 
# alternative (individual) track selection buttons
# LEDs have to be assigned to TRACKS_DOUT_L_SR and TRACKS_DOUT_R_SR
# For Antilog design: these are the selection buttons, TRACKS_DOUT_* ignored (we use predefined BLM8X8_DOUT_GP_MAPPING 3)
# SR Pin
BUTTON_DIRECT_TRACK1 0 0
BUTTON_DIRECT_TRACK2 0 0
BUTTON_DIRECT_TRACK3 0 0
BUTTON_DIRECT_TRACK4 0 0
BUTTON_DIRECT_TRACK5 0 0
BUTTON_DIRECT_TRACK6 0 0
BUTTON_DIRECT_TRACK7 0 0
BUTTON_DIRECT_TRACK8 0 0
BUTTON_DIRECT_TRACK9 0 0
BUTTON_DIRECT_TRACK10 0 0
BUTTON_DIRECT_TRACK11 0 0
BUTTON_DIRECT_TRACK12 0 0
BUTTON_DIRECT_TRACK13 0 0
BUTTON_DIRECT_TRACK14 0 0
BUTTON_DIRECT_TRACK15 0 0
BUTTON_DIRECT_TRACK16 0 0
BUTTON_DIRECT_TRACK1 M3A 0
BUTTON_DIRECT_TRACK2 M3A 1
BUTTON_DIRECT_TRACK3 M3A 2
BUTTON_DIRECT_TRACK4 M3A 3
BUTTON_DIRECT_TRACK5 M7A 4
BUTTON_DIRECT_TRACK6 M7A 5
BUTTON_DIRECT_TRACK7 M7A 6
BUTTON_DIRECT_TRACK8 M7A 7
BUTTON_DIRECT_TRACK9 M3B 0
BUTTON_DIRECT_TRACK10 M3B 1
BUTTON_DIRECT_TRACK11 M3B 2
BUTTON_DIRECT_TRACK12 M3B 3
BUTTON_DIRECT_TRACK13 M7B 4
BUTTON_DIRECT_TRACK14 M7B 5
BUTTON_DIRECT_TRACK15 M7B 6
BUTTON_DIRECT_TRACK16 M7B 7
 
# SR Pin
BUTTON_TRG_LAYER_A M2 6
BUTTON_TRG_LAYER_B M2 7
BUTTON_TRG_LAYER_C M1 6
BUTTON_TRG_LAYER_A 0 0
BUTTON_TRG_LAYER_B 0 0
BUTTON_TRG_LAYER_C 0 0
 
 
# Following button functions are usually assigned to Fx
# buttons, or to dedicated (labeled) buttons
# In Wilba's frontpanel layout:
# F1 is located at SR M3 Pin 3
# F2 is located at SR M2 Pin 2
# F3 is located at SR M2 Pin 3
# F4 is located at SR M1 Pin 2
# and there are dedicated buttons for Copy/Paste/Clear/Utility/StepView
 
# SR Pin
BUTTON_TRACK_SEL M3 3
BUTTON_LIVE M2 2
BUTTON_RECORD M2 3
BUTTON_SAVE_ALL M1 2
BUTTON_TRACK_SEL M1C 2
BUTTON_LIVE M6C 1
BUTTON_RECORD M5C 1
BUTTON_SAVE_ALL 0 0
 
 
# SR Pin
BUTTON_PAR_LAYER_SEL 0 0
BUTTON_TRG_LAYER_SEL 0 0
BUTTON_PAR_LAYER_SEL M1C 3
BUTTON_TRG_LAYER_SEL M7C 3
BUTTON_INS_SEL M7C 2
 
# SR Pin
BUTTON_UTILITY M3 2
BUTTON_COPY M7 3
BUTTON_PASTE M8 2
BUTTON_CLEAR M8 3
BUTTON_UTILITY M8B 7
BUTTON_COPY M4A 0
BUTTON_PASTE M4A 1
BUTTON_CLEAR M4A 2
BUTTON_UNDO 0 0
BUTTON_MOVE 0 0
BUTTON_SCROLL 0 0
BUTTON_BOOKMARK 0 0
BUTTON_MOVE M4A 3
BUTTON_SCROLL M8A 4
BUTTON_BOOKMARK M1C 0
 
# SR Pin
BUTTON_STEP_VIEW M5 5
BUTTON_STEP_VIEW M1C 1
 
# SR Pin
BUTTON_EXT_RESTART 0 0
716,10 → 727,12
BUTTON_BEH_FOLLOW 1
BUTTON_BEH_SCRUB 0
BUTTON_BEH_MENU 0
BUTTON_BEH_BOOKMARK 1
BUTTON_BEH_MUTE 0
BUTTON_BEH_BOOKMARK 0
BUTTON_BEH_STEP_VIEW 0
BUTTON_BEH_TRG_LAYER 0
BUTTON_BEH_PAR_LAYER 0
BUTTON_BEH_INS_SEL 0
BUTTON_BEH_TRACK_SEL 0
BUTTON_BEH_TEMPO_PRESET 0
 
/trunk/apps/sequencers/midibox_seq_v4/hwcfg/tk/MBSEQ_HW.V4
419,6 → 419,7
LED_MUTE 2 1
LED_PATTERN 2 2
LED_SONG 2 3
LED_PHRASE 0 0
 
# SR Pin
LED_SOLO 2 4
469,6 → 470,7
LED_STEP_VIEW 0 0
LED_PAR_LAYER_SEL 0 0
LED_TRG_LAYER_SEL 0 0
LED_INS_SEL 0 0
LED_TRACK_SEL 0 0
 
# SR Pin
554,6 → 556,7
BUTTON_MUTE 4 1
BUTTON_PATTERN 4 2
BUTTON_SONG 4 3
BUTTON_PHRASE 0 0
 
# SR Pin
BUTTON_SOLO 4 4
625,7 → 628,8
BUTTON_TRG_LAYER_SEL 2 3
BUTTON_TRACK_SEL 2 4
 
BUTTON_PAR_LAYER_SEL 0 0
BUTTON_PAR_LAYER_SEL 0 0
BUTTON_INS_SEL 0 0
 
# SR Pin
BUTTON_PATTERN_RMX 0 0
712,6 → 716,7
BUTTON_BEH_FOLLOW 1
BUTTON_BEH_SCRUB 0
BUTTON_BEH_MENU 0
BUTTON_BEH_MUTE 1
BUTTON_BEH_BOOKMARK 1
BUTTON_BEH_STEP_VIEW 0
BUTTON_BEH_TRG_LAYER 0
/trunk/apps/sequencers/midibox_seq_v4/hwcfg/wilba/MBSEQ_HW.V4
419,6 → 419,7
LED_MUTE M6 3
LED_PATTERN M6 2
LED_SONG M7 3
LED_PHRASE 0 0
 
# SR Pin
LED_SOLO M6 1
469,6 → 470,7
LED_STEP_VIEW M3 1
LED_PAR_LAYER_SEL 0 0
LED_TRG_LAYER_SEL 0 0
LED_INS_SEL 0 0
LED_TRACK_SEL 0 0
 
# SR Pin
551,6 → 553,7
BUTTON_MUTE M6 2
BUTTON_PATTERN M6 3
BUTTON_SONG M7 2
BUTTON_PHRASE 0 0
 
# SR Pin
BUTTON_SOLO M6 4
627,6 → 630,7
# SR Pin
BUTTON_PAR_LAYER_SEL 0 0
BUTTON_TRG_LAYER_SEL 0 0
BUTTON_INS_SEL 0 0
 
# SR Pin
BUTTON_UTILITY M3 2
716,6 → 720,7
BUTTON_BEH_FOLLOW 1
BUTTON_BEH_SCRUB 0
BUTTON_BEH_MENU 0
BUTTON_BEH_MUTE 1
BUTTON_BEH_BOOKMARK 1
BUTTON_BEH_STEP_VIEW 0
BUTTON_BEH_TRG_LAYER 0