void PlayRangeCurrPos(struct Tracker_Windows *window){ struct WBlocks *wblock; Place *place; PlayStopReally(false); wblock=window->wblock; if( ! wblock->isranged) return; root->setfirstpos=false; if(wblock->rangey1==0) root->setfirstpos=true; place=getRangeStartPlace(wblock); pc->seqtime=-Place2STime(wblock->block,place); // printf("playrange, time: %d\n",pc->seqtime); Place *place_start = getRangeStartPlace(wblock); Place *place_end = getRangeEndPlace(wblock); pc->range_duration = Place2STime(wblock->block, place_end) - Place2STime(wblock->block, place_start); pc->is_playing_range = true; PlayBlock(wblock->block,place,true); }
void main(void) { char opt; // Make sure nCS is high before doing anything nCS_HIGH; // Enable user module interrupts SleepTimer_EnableInt(); // Enable global interrutps M8C_EnableGInt; // Start the user modules UART_Start(UART_PARITY_NONE); UART_PutCRLF(); SPIM_Start(SPIM_SPIM_MODE_0 | SPIM_SPIM_MSB_FIRST); SleepTimer_Start(); DAC8_Start(DAC8_FULLPOWER); UART_CPutString("Synthesiszing waveforms\r\n"); WriteBlock(0); WriteBlock(1); WriteBlock(2); WriteBlock(3); while(1) { UART_CPutString("Synthetic wave output is on Port0[4]\r\nCowabunga Dude! Time to catch some waves.\r\n\r\n0. Play block 0\r\n1. Play block 1\r\n2. Play block 2\r\n3. Play block 3\r\n4. Test status register\r\n5. Test byte mode\r\n6. Test sequential mode\r\n"); opt = GetNumber(0, 6); switch (opt) { case 4: while(SPIRAM_StatusRegisterTest()) SleepTimer_SyncWait(4, SleepTimer_WAIT_RELOAD); break; case 5: while(SPIRAM_ByteModeTest()) SleepTimer_SyncWait(4, SleepTimer_WAIT_RELOAD); break; case 6: while(SPIRAM_SequentialModeTest()) SleepTimer_SyncWait(4, SleepTimer_WAIT_RELOAD); break; default: PlayBlock(opt); break; } } }
void PlayBlockFromStart(struct Tracker_Windows *window,bool do_loop){ PlayStopReally(false); root->setfirstpos=true; pc->seqtime=0; { struct WBlocks *wblock=window->wblock; Place place; PlaceSetFirstPos(&place); PlayBlock(wblock->block,&place,do_loop); } }
void PlayBlockCurrPos(struct Tracker_Windows *window){ struct WBlocks *wblock; Place *place; PlayStopReally(false); root->setfirstpos=false; wblock=window->wblock; if(wblock->curr_realline==0) root->setfirstpos=true; place = &wblock->reallines[wblock->curr_realline]->l.p; pc->seqtime = -Place2STime(wblock->block,place); // printf("contblock, time: %d\n",pc->seqtime); PlayBlock(wblock->block,place,true); }