I don't think I've destroyed anything, though I'm prepared to be proved wrong :) I've probably explained myself poorly, though...
The 1024 point FFT is done on 1024 points taken from 8 consecutive blocks, as before. However, what I've improved...
Does the ARM library give API access to each of those individual stages? I had a quick look and didn’t spot anything, but could easily have missed it, there was a lot of terminology that went way over my head :)
To my mind an extra 12ms of...
To a large extent, I don't. I'm not even sure it's mathematically feasible to compute a partial FFT with only some of the data available, and finish it later... Someone with maths skillz will no doubt be along to clear that up :)
The original...
Hi folks
I've been tinkering with the FFT code in the audio library, and think I've made some improvements:
processing is now spread across update() calls, so the peak CPU load has dropped (slightly)
works with smaller values of...
Hi there. OK, some clues there.
Arduino Library Manager isn't showing TeensyVariablePlayback version 1.1.0 as available - I've asked the repo owner to release it, which I think is what's needed. It is possible to download it manually, but he's...
I can think of a few things:
create a simple sketch without the keypad, encoder and OLED display code;
test it with the sample that you played for 30 minutes, for long enough to be sure it reproduces the problem
post the sketch and sample so...
So the shiny new improved version has just been merged - thanks @Moo! As noted above in post #202, the "old" version can be found on the old_master branch, if you need it.
For the most part a masked interrupt will not be lost, just delayed for (up to) however long it takes your code between the disable/enable calls to run. The accepted wisdom is thus to keep such code as short as possible, and never make calls to...
If you
then you want polyphonic.
As @emmanuel63 says, if you're playing real samples then you run short of memory very quickly, which is why streaming from SD starts to look like a good idea. It's definitely feasible, as I said in post #3, but...
Yes, the Cortex M7 used by Teensy has what's termed "nested" interrupts, which means that a higher priority interrupt can interrupt a lower-priority one that's already in progress.
In this case, the pin interrupt is (I think) at level 128...
...followed by a snapshot of your audio configuration ... with all sorts of mystery arrays ... definitely not fulfilling
Yes, the Design Tool documentation isn't what you'd call well-maintained: PWM output is an option for Teensy 4.x. The...
Great, there’s nothing like independent testing for finding the bugs! Well, and automated regression tests, which I can see in there but need to figure out how to execute…
The repo now has a file access example, which shows the hoops you need to...
OK, so quite a bit later than advertised, but I've made some progress. Prior to doing a PR I want to sort out an example showing how to access the SD card while streaming audio from it, and update various bits of documentation, but the current...
Yes, it looks as if your development and test code is getting a bit out of hand - Arduino doesn't make that easy, though there are hints you're using PlatformIO, which may make a difference (I've never used it...). A quick scan reveals there are...
Right, had another chance to look, including actually compiling your code. Two things:
Voice.cpp needs this->env->noteOn(); adding to Voice::noteOn(), otherwise the envelope isn't triggered and nothing gets through to the voice output mixer...
OK, so you’re starting 5 notes but can only actually play the last 2, with the result that your first 3 calls to noteOff() do nothing because the notes are no longer playing so don’t get found by the search.
This doesn't look right - the gain...
Unfortunately the stock AudioPlaySdWav object struggles to achieve more than a couple of files playing simultaneously. I've put significant effort into an improved suite of playback and recording objects, with an associated discussion thread...
My first thought is that you can't get better than 22.7µs alignment, because of the basic 44.1kHz sample rate of the stock audio library. That would improve slightly to 10.4µs if you change the sample rate to 96kHz, which is non-trivial.
A...
It's not completely obvious how the code is crashing, but one has to assume that it's the result of the corrupted audio file, somehow.
The elements of your post that caught my eye are
and
so ... the implication is that playback is in...
A. I would definitely order an electret microphone, even if just to eliminate it as the problem source. They're pretty cheap (about £2.50 on UK eBay); I ordered several different models just in case one was troublesome, but they all seemed to...
That’s what I meant by “slightly” :) I think the issue is:
oneBitAmplitude = np.abs(audioData)>1
as the count will miss samples with the values 0 and 1. In your post there’s an instance where it’s out by 2 samples, in fact… as it happens...
5011 samples doesn’t fill an exact number of audio blocks - it’s a bit over 39. So queueBeep() will leave a part-filled block awaiting completion, transmitting only the completed ones. The next call will do likewise, so you’ll transmit either 39...
What mic are you trying to use? It should be an electret type.
The Teensy analogue input is not involved when using the audio adaptor; the SGTL5000 on the adaptor does the ADC function and the resulting data go to the Teensy via the I2S bus...
Possibly because you're calling flange1.voices(offset, depth, delayRate); every time loop() executes? I looked at the code and I think it resets the flanger whenever you call it... try only calling .voices() when the control actually changes by a...
The single simplest thing to do would be to change AUDIO_SAMPLE_RATE_EXACT to 88.2kHz in AudioStream.h. The whole audio engine will then run at the higher speed, and so long as the resulting clocks are within the TDA1387's limits most stuff will...
It's a fairly steep learning curve! My advice is always to try to get one element at a time working, there are often unforeseen interactions if you try to do everything at once... Google is often better at finding relevant posts than the forum...
I use an AudioRecordQueue, wired to something guaranteed to produce data, and whenever a new block is available, read and discard it, then do any required actions. Late in the UK, can post code tomorrow if needed…
Curious as to why you've made these unipolar?
It would seem more intuitive that each input starts with a level and pan position, and modulation multipliers for those; these parameters would be set via the API. Then a -1.0 to +1.0 LFO (or other)...
Definitely go for the Audio library, unless you have some use case you've not mentioned that requires you to re-invent the wheel...
There are various options for multi-channel audio output: you can currently buy boards from AliExpress based on...
...: SOLUTION :...
Thanks to the good people of this community SAI3 for Audio is possible! 👏
SAI3 can be used by using the files below for Audio Output. Here's how to do it.
NOTE: This uses the following pins for SAI3 Audio Output.
SD_B1_01...
Getting a bit late here in the UK … then again, maybe sleep will cause inspiration! If I get a chance will look in more detail tomorrow, but time will be limited, family visiting.
If this proves stubborn, do you have a way to get some hardware...
Library mods look OK, though of course hard to tell without hardware… Your test code is incomplete, of course … the classic error here is to forget AudioMemory(<enough>) in setup(); 10 is usually <enough> for simple audio not using TDM etc.
That's actually very cool!
I've made the I2S3 files for output, no success yet, but I will do the Input as well for the sake of it.
And I added output_i2s3.h as include in Audio.h
I²S can do two channels with a single audio data pin - that's what LRCLK is for, to signal the switch from left- to right-channel data. Depending on how the /SD_MODE pin is wired on your amplifier(s), you could fit two MAX98357s and have stereo...
I'll give this a solid try by copying the i2s2 files and naming them i2s3. If I am successful I will share the files here to help others that want to use SAI3 on their custom setup.
You probably could - not true the other way around, because the hardware initialisation is in output_i2s2.cpp. A full implementation would do both, add the objects to the Design Tool, including adding the clash markers with MQS, and edit...
The Audio library currently uses SAI3 to generate MQS audio. That being said, a very quick look at the datasheet suggests you could make modified versions of the I2S2 files, changing the registers from I2S2 to I2S3, and some of the pin...
It'd be better with
void setup() {
Serial.begin(9600);
while (!Serial && (millis() < 3000)) // until connected, or 3s has elapsed...
; // ...do nothing
...otherwise you'll be repeating the (unknown) next statement for 3 seconds...