Exemplo n.º 1
0
/////////////////////////////////////////////////////////////////////////////
// Initialisation
/////////////////////////////////////////////////////////////////////////////
s32 SEQ_Init(u32 mode)
{
  // initialize the Notestack
#if 0
  NOTESTACK_Init(&notestack, NOTESTACK_MODE_PUSH_TOP, &notestack_items[0], NOTESTACK_SIZE);
#else
  // for an arpeggiator we prefer sorted mode
  // activate hold mode as well. Stack will be cleared whenever no note is played anymore
  NOTESTACK_Init(&notestack, NOTESTACK_MODE_SORT_HOLD, &notestack_items[0], NOTESTACK_SIZE);
#endif

  // and the arp counter
  arp_counter = 0;

  // reset sequencer
  SEQ_Reset();

  // init BPM generator
  SEQ_BPM_Init(0);

  SEQ_BPM_PPQN_Set(384);
  SEQ_BPM_Set(120.0);

  return 0; // no error
}
Exemplo n.º 2
0
/////////////////////////////////////////////////////////////////////////////
//! Initialisation
/////////////////////////////////////////////////////////////////////////////
s32 MBNG_SEQ_Init(u32 mode)
{
  if( mode != 0 )
    return -1; // only mode 0 supported

  // init BPM generator
  SEQ_BPM_Init(0);
  SEQ_BPM_Set(120.0);

  // reset sequencer
  MBNG_SEQ_Reset();

  // disable pause after power-on
  MBNG_SEQ_SetPauseMode(0);

  return 0; // no error
}
Exemplo n.º 3
0
void Clocks_Init(void) {
    
    SEQ_BPM_TickSet(0);                                                         // reset sequencer
    
    SEQ_BPM_Init(0);                                                            // initialize SEQ module sequencer
    
    SEQ_BPM_PPQN_Set(VXPPQN);                                                   // set internal clock resolution as per the define (usually 384)
    MClock_SetBPM(100.0);                                                       // Master BPM
    
    
    mClock.status.all = 0;                                                      // bit 7 is run/stop
    mClock.ticked = 0;                                                          // we haven't gotten that far yet
    mClock.timesigu = 4;                                                        // Upper value of the Master Time Signature, min 2
    mClock.timesigl = 4;                                                        // Lower value of the Master Time Signature, min 2
    mClock.res = SEQ_BPM_PPQN_Get();                                            // fill this from the SEQ_BPM module to be safe
    mClock.rt_latency = VXLATENCY;                                              // initialise from define
    
    MClock_Init();                                                              // init the vX master clock
    MClock_Reset();
}
Exemplo n.º 4
0
/////////////////////////////////////////////////////////////////////////////
// Initialisation
/////////////////////////////////////////////////////////////////////////////
s32 SEQ_Init(u32 mode)
{
  // init MIDI file handler
  MID_FILE_Init(0);

  // init MIDI parser module
  MID_PARSER_Init(0);

  // install callback functions
  MID_PARSER_InstallFileCallbacks(&MID_FILE_read, &MID_FILE_eof, &MID_FILE_seek);
  MID_PARSER_InstallEventCallbacks(&SEQ_PlayEvent, &SEQ_PlayMeta);

  // reset sequencer
  SEQ_Reset(0);

  // init BPM generator
  SEQ_BPM_Init(0);

  return 0; // no error
}