Subversion Repositories svn.mios32

Rev

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

Rev 2050 Rev 2098
Line 1... Line 1...
1
// $Id: seq_core.c 2050 2014-09-08 19:52:27Z tk $
1
// $Id: seq_core.c 2098 2014-12-07 19:25:03Z tk $
2
/*
2
/*
3
 * Sequencer Core Routines
3
 * Sequencer Core Routines
4
 *
4
 *
5
 * ==========================================================================
5
 * ==========================================================================
6
 *
6
 *
Line 711... Line 711...
711
    if( (bpm_tick % 16) == 0 )
711
    if( (bpm_tick % 16) == 0 )
712
      SEQ_MIDI_ROUTER_SendMIDIClockEvent(0xf8, bpm_tick);
712
      SEQ_MIDI_ROUTER_SendMIDIClockEvent(0xf8, bpm_tick);
713
713
714
    // trigger DIN Sync clock with a special event (0xf9 normaly used for "MIDI tick")
714
    // trigger DIN Sync clock with a special event (0xf9 normaly used for "MIDI tick")
715
    // SEQ_MIDI_PORT_NotifyMIDITx filters it before it will be forwarded to physical ports
715
    // SEQ_MIDI_PORT_NotifyMIDITx filters it before it will be forwarded to physical ports
-
 
716
-
 
717
    {
716
    if( (bpm_tick % SEQ_CV_ClkDividerGet()) == 0 ) {
718
      int clkout;
-
 
719
717
      mios32_midi_package_t p;
720
      mios32_midi_package_t p;
718
      p.ALL = 0;
721
      p.ALL = 0;
719
      p.type = 0x5; // Single-byte system common message
722
      p.type = 0x5; // Single-byte system common message
720
      p.evnt0 = 0xf9;
723
      p.evnt0 = 0xf9;
-
 
724
-
 
725
      u16 *clk_divider = (u16 *)&seq_cv_clkout_divider[0];
-
 
726
      for(clkout=0; clkout<SEQ_CV_NUM_CLKOUT; ++clkout, ++clk_divider) {
-
 
727
    if( *clk_divider && (bpm_tick % *clk_divider) == 0 ) {
-
 
728
      p.evnt1 = clkout; // Transfers the Clock Output
721
      SEQ_MIDI_OUT_Send(0xff, p, SEQ_MIDI_OUT_ClkEvent, bpm_tick, 0);
729
      SEQ_MIDI_OUT_Send(0xff, p, SEQ_MIDI_OUT_ClkEvent, bpm_tick, 0);
-
 
730
    }
-
 
731
      }
722
    }
732
    }
723
733
724
    // send metronome tick on each beat if enabled
734
    // send metronome tick on each beat if enabled
725
    if( seq_core_state.METRONOME && seq_core_metronome_chn && (bpm_tick % 96) == 0 && (seq_core_state.ref_step % 4) == 0 ) {
735
    if( seq_core_state.METRONOME && seq_core_metronome_chn && (bpm_tick % 96) == 0 && (seq_core_state.ref_step % 4) == 0 ) {
726
      mios32_midi_package_t p;
736
      mios32_midi_package_t p;