Subversion Repositories svn.mios32

Rev

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

Rev 2464 Rev 2465
Line 1... Line 1...
1
// $Id: seq_core.c 2464 2016-12-20 18:06:25Z tk $
1
// $Id: seq_core.c 2465 2016-12-20 18:54:40Z tk $
2
/*
2
/*
3
 * Sequencer Core Routines
3
 * Sequencer Core Routines
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 860... Line 860...
860
    ++t->bar;
860
    ++t->bar;
861
      }
861
      }
862
862
863
      u8 mute_this_step = 0;
863
      u8 mute_this_step = 0;
864
      u8 next_step_event = t->state.FIRST_CLK || bpm_tick >= t->timestamp_next_step;
864
      u8 next_step_event = t->state.FIRST_CLK || bpm_tick >= t->timestamp_next_step;
-
 
865
-
 
866
      // step trigger: only play the new step if transposer has a note
-
 
867
      if( tcc->trkmode_flags.STEP_TRG ) {
-
 
868
    if( !t->state.TRIGGER_NEXT_STEP_REQ ) {
-
 
869
      next_step_event = 0;
-
 
870
    }
-
 
871
      }
-
 
872
      t->state.TRIGGER_NEXT_STEP_REQ = 0;
865
873
866
      if( next_step_event ) {
874
      if( next_step_event ) {
867
875
868
    {
876
    {
869
      // calculate step length
877
      // calculate step length
Line 2179... Line 2187...
2179
  for(track=0; track<SEQ_CORE_NUM_TRACKS; ++track, ++t)
2187
  for(track=0; track<SEQ_CORE_NUM_TRACKS; ++track, ++t)
2180
    if( tracks & (1 << track) )
2188
    if( tracks & (1 << track) )
2181
      t->state.SYNC_MEASURE = 1;
2189
      t->state.SYNC_MEASURE = 1;
2182
2190
2183
  MIOS32_IRQ_Enable();
2191
  MIOS32_IRQ_Enable();
-
 
2192
-
 
2193
  return 0; // no error
-
 
2194
}
-
 
2195
-
 
2196
/////////////////////////////////////////////////////////////////////////////
-
 
2197
// Used by the transposer to request the next step in "step trigger" mode
-
 
2198
/////////////////////////////////////////////////////////////////////////////
-
 
2199
s32 SEQ_CORE_StepTriggerReq(u8 bus)
-
 
2200
{
-
 
2201
  u8 track;
-
 
2202
  seq_core_trk_t *t = &seq_core_trk[0];
-
 
2203
  seq_cc_trk_t *tcc = &seq_cc_trk[0];
-
 
2204
-
 
2205
  for(track=0; track<SEQ_CORE_NUM_TRACKS; ++track, ++t, ++tcc) {
-
 
2206
    if( tcc->busasg.bus == bus ) {
-
 
2207
      t->state.TRIGGER_NEXT_STEP_REQ = 1;
-
 
2208
    }
-
 
2209
  }
2184
2210
 
2185
  return 0; // no error
2211
  return 0; // no error
2186
}
2212
}
2187
2213
2188
2214