ScottBillingsley
New member
Currently I am working on a looper project...I am using the teensy 4 with a PCM5102 DAC, 4 line LCD display and SD reader...Two nanos are used to read buttons and control leds.
I have modified play_Sd_Raw.cpp and . h and added settable start position, pause ,loop function and loop lenght..I have also modified output_i2s.cpp to allow speed change by adding
I am now ready to start the next phase..Am I right in amusing this sets the DMA timer...If so, are the left and right channel both controlled by the same DMA channel..
My goal was to add other stored loops that could be called by MIDI while the main loop plays but I see that this would also affect the speed of all loops..Short of
separating the left and right channels, I will have to rethink the variable speed on the main loop..Thanks for any advice...
I have modified play_Sd_Raw.cpp and . h and added settable start position, pause ,loop function and loop lenght..I have also modified output_i2s.cpp to allow speed change by adding
Code:
void AudioOutputI2S::playSpeed(int32_t sampleSpeed){
int32_t fs = sampleSpeed;
// PLL between 27*24 = 648MHz und 54*24=1296MHz
int n1 = 4; //SAI prescaler 4 => (n1*n2) = multiple of 4
int n2 = 1 + (24000000 * 27) / (fs * 256 * n1);
//Serial.println(fs);
// clear SAI1_CLK register locations
CCM_CSCMR1 = (CCM_CSCMR1 & ~(CCM_CSCMR1_SAI1_CLK_SEL_MASK))
| CCM_CSCMR1_SAI1_CLK_SEL(2); // &0x03 // (0,1,2): PLL3PFD0, PLL5, PLL4
CCM_CS1CDR = (CCM_CS1CDR & ~(CCM_CS1CDR_SAI1_CLK_PRED_MASK | CCM_CS1CDR_SAI1_CLK_PODF_MASK))
| CCM_CS1CDR_SAI1_CLK_PRED(n1-1) // &0x07
| CCM_CS1CDR_SAI1_CLK_PODF(n2-1); // &0x3f
}
I am now ready to start the next phase..Am I right in amusing this sets the DMA timer...If so, are the left and right channel both controlled by the same DMA channel..
My goal was to add other stored loops that could be called by MIDI while the main loop plays but I see that this would also affect the speed of all loops..Short of
separating the left and right channels, I will have to rethink the variable speed on the main loop..Thanks for any advice...