Subversion Repositories svn.mios32

Rev

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

Rev 1788 Rev 1794
Line 1... Line 1...
1
// $Id: seq_core.c 1788 2013-05-19 21:12:18Z tk $
1
// $Id: seq_core.c 1794 2013-05-31 19:25:43Z tk $
2
/*
2
/*
3
 * Sequencer Core Routines
3
 * Sequencer Core Routines
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 126... Line 126...
126
static float seq_core_bpm_sweep_inc;
126
static float seq_core_bpm_sweep_inc;
127
127
128
128
129
/////////////////////////////////////////////////////////////////////////////
129
/////////////////////////////////////////////////////////////////////////////
130
// Initialisation
130
// Initialisation
-
 
131
// \param mode if 0: clear all parameters, if 1: don't clear global parameters which are stored in the MBSEQ_GC.V4 file
131
/////////////////////////////////////////////////////////////////////////////
132
/////////////////////////////////////////////////////////////////////////////
132
s32 SEQ_CORE_Init(u32 mode)
133
s32 SEQ_CORE_Init(u32 mode)
133
{
134
{
134
  int i;
135
  int i;
135
136
136
  seq_core_timestamp_ms = 0;
137
  seq_core_timestamp_ms = 0;
137
  seq_core_trk_muted = 0;
138
  seq_core_trk_muted = 0;
138
  seq_core_slaveclk_mute = SEQ_CORE_SLAVECLK_MUTE_Off;
139
  seq_core_slaveclk_mute = SEQ_CORE_SLAVECLK_MUTE_Off;
139
  seq_core_options.ALL = 0;
140
  seq_core_options.ALL = 0;
-
 
141
  if( mode == 0 ) {
-
 
142
    seq_core_options.INIT_CC = 64;
140
  seq_core_options.PASTE_CLR_ALL = 1;
143
    seq_core_options.PASTE_CLR_ALL = 1;
-
 
144
    seq_core_options.PATTERN_MIXER_MAP_COUPLING = 0;
-
 
145
  }
141
  seq_core_steps_per_measure = 16-1;
146
  seq_core_steps_per_measure = 16-1;
142
  seq_core_steps_per_pattern = 16-1;
147
  seq_core_steps_per_pattern = 16-1;
143
  seq_core_global_scale = 0;
148
  seq_core_global_scale = 0;
144
  seq_core_global_scale_ctrl = 0; // global
149
  seq_core_global_scale_ctrl = 0; // global
145
  seq_core_global_scale_root_selection = 0; // from keyboard
150
  seq_core_global_scale_root_selection = 0; // from keyboard
146
  seq_core_keyb_scale_root = 0; // taken if enabled in OPT menu
151
  seq_core_keyb_scale_root = 0; // taken if enabled in OPT menu
147
  seq_core_global_transpose_enabled = 0;
152
  seq_core_global_transpose_enabled = 0;
148
  seq_core_din_sync_pulse_ctr = 0; // used to generate a 1 mS pulse
153
  seq_core_din_sync_pulse_ctr = 0; // used to generate a 1 mS pulse
149
154
-
 
155
  if( mode == 0 ) {
150
  seq_core_metronome_port = DEFAULT;
156
    seq_core_metronome_port = DEFAULT;
151
  seq_core_metronome_chn = 10;
157
    seq_core_metronome_chn = 10;
152
  seq_core_metronome_note_m = 0x25; // C#1
158
    seq_core_metronome_note_m = 0x25; // C#1
153
  seq_core_metronome_note_b = 0x25; // C#1
159
    seq_core_metronome_note_b = 0x25; // C#1
-
 
160
  }
154
161
155
  seq_core_bpm_preset_num = 13; // 140.0
162
  seq_core_bpm_preset_num = 13; // 140.0
156
  for(i=0; i<SEQ_CORE_NUM_BPM_PRESETS; ++i) {
163
  for(i=0; i<SEQ_CORE_NUM_BPM_PRESETS; ++i) {
157
    seq_core_bpm_preset_tempo[i] = 75.0 + 5.0*i;
164
    seq_core_bpm_preset_tempo[i] = 75.0 + 5.0*i;
158
    seq_core_bpm_preset_ramp[i] = 0.0;
165
    seq_core_bpm_preset_ramp[i] = 0.0;