Subversion Repositories svn.mios32

Rev

Rev 2308 | Rev 2325 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2308 Rev 2322
Line 1... Line 1...
1
// $Id: seq_core.c 2308 2016-02-14 19:30:07Z tk $
1
// $Id: seq_core.c 2322 2016-03-15 19:08:38Z tk $
2
/*
2
/*
3
 * Sequencer Core Routines
3
 * Sequencer Core Routines
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 89... Line 89...
89
u16 seq_core_trk_soloed;
89
u16 seq_core_trk_soloed;
90
90
91
u8 seq_core_step_update_req;
91
u8 seq_core_step_update_req;
92
92
93
u8 seq_core_global_scale;
93
u8 seq_core_global_scale;
94
u8 seq_core_global_scale_ctrl;
-
 
95
u8 seq_core_global_scale_root;
94
u8 seq_core_global_scale_root;
96
u8 seq_core_global_scale_root_selection;
95
u8 seq_core_global_scale_root_selection;
97
u8 seq_core_keyb_scale_root;
96
u8 seq_core_keyb_scale_root;
98
97
99
u8 seq_core_global_transpose_enabled;
98
u8 seq_core_global_transpose_enabled;
Line 148... Line 147...
148
    seq_core_options.MIXER_LIVE_SEND = 1;
147
    seq_core_options.MIXER_LIVE_SEND = 1;
149
  }
148
  }
150
  seq_core_steps_per_measure = 16-1;
149
  seq_core_steps_per_measure = 16-1;
151
  seq_core_steps_per_pattern = 16-1;
150
  seq_core_steps_per_pattern = 16-1;
152
  seq_core_global_scale = 0;
151
  seq_core_global_scale = 0;
153
  seq_core_global_scale_ctrl = 0; // global
-
 
154
  seq_core_global_scale_root_selection = 0; // from keyboard
152
  seq_core_global_scale_root_selection = 0; // from keyboard
155
  seq_core_keyb_scale_root = 0; // taken if enabled in OPT menu
153
  seq_core_keyb_scale_root = 0; // taken if enabled in OPT menu
156
  seq_core_global_transpose_enabled = 0;
154
  seq_core_global_transpose_enabled = 0;
157
  seq_core_din_sync_pulse_ctr = 0; // used to generate a 1 mS pulse
155
  seq_core_din_sync_pulse_ctr = 0; // used to generate a 1 mS pulse
158
156
Line 1855... Line 1853...
1855
// scale and root selection are for interest when editing the settings -> SEQ_UI_OPT
1853
// scale and root selection are for interest when editing the settings -> SEQ_UI_OPT
1856
// Both modules are calling this function to ensure consistency
1854
// Both modules are calling this function to ensure consistency
1857
/////////////////////////////////////////////////////////////////////////////
1855
/////////////////////////////////////////////////////////////////////////////
1858
s32 SEQ_CORE_FTS_GetScaleAndRoot(u8 *scale, u8 *root_selection, u8 *root)
1856
s32 SEQ_CORE_FTS_GetScaleAndRoot(u8 *scale, u8 *root_selection, u8 *root)
1859
{
1857
{
1860
  if( seq_core_global_scale_ctrl > 0 ) {
-
 
1861
    // scale/root selection from a specific pattern group
-
 
1862
    u8 group = seq_core_global_scale_ctrl-1;
-
 
1863
    *scale = seq_cc_trk[(group*SEQ_CORE_NUM_TRACKS_PER_GROUP)+2].shared.scale;
-
 
1864
    *root_selection = seq_cc_trk[(group*SEQ_CORE_NUM_TRACKS_PER_GROUP)+3].shared.scale_root;
-
 
1865
  } else {
-
 
1866
    // global scale/root selection
1858
  // global scale/root selection
1867
    *scale = seq_core_global_scale;
1859
  *scale = seq_core_global_scale;
1868
    *root_selection = seq_core_global_scale_root_selection;
1860
  *root_selection = seq_core_global_scale_root_selection;
1869
  }
-
 
1870
  *root = (*root_selection == 0) ? seq_core_keyb_scale_root : (*root_selection-1);
1861
  *root = (*root_selection == 0) ? seq_core_keyb_scale_root : (*root_selection-1);
1871
1862
1872
  return 0; // no error
1863
  return 0; // no error
1873
}
1864
}
1874
1865