Search results

  1. h4yn0nnym0u5e

    Teensy 4.0 and mp3 and FrankB's audio library

    OK, so I've taken the trouble to answer my own question - FrankB's library does not expose its AudioBuffer class as part of the API, so it's a non-breaking change to rename it. I've done this rename and submitted a PR - he's often / usually quite quick to respond, so it may become mainstream...
  2. h4yn0nnym0u5e

    Teensy 4.0 and mp3 and FrankB's audio library

    ...is also not a proper argument, I admit :) "I don't care" is also not massively helpful. Does your library API require use of the AudioBuffer class, or is it internal-only? Mine exposes it for when the user's code is specifying buffer locations, e.g. createBuffer(4096, AudioBuffer::inHeap)...
  3. h4yn0nnym0u5e

    Teensy 4.0 and mp3 and FrankB's audio library

    Which has a licence that means it's more likely to get pulled into Teensyduino?
  4. h4yn0nnym0u5e

    Teensy 4.0 and mp3 and FrankB's audio library

    There's a clash between my buffered WAV playback / record library and Frank's compressed audio playback library: c:\Users\Forest Shick\Documents\Arduino\libraries\Arduino-Teensy-Codec-lib-master\audiobuffer.h:42:7: error: redefinition of 'class AudioBuffer' 42 | class AudioBuffer | ^~~~~~~~~~~...
  5. h4yn0nnym0u5e

    Basic Wav recorder

    You (or someone...) seem to have grafted together a couple of example sketches and come up with an unholy mess. You'd probably be better off finding a single example which is closer to your aim. Off the top of my head I can see three issues: writeOutHeader() is defined but never called, so you...
  6. h4yn0nnym0u5e

    FreqMeasure with Teensy4.0 - strange results

    Yes, because if (FreqMeasure.available()) { … } Your code does a read() regardless of whether a new value is actually available; that won’t work. Ate you really fitting a 1000ppr encoder, then only using the 1ppr index pulse to calculate the RPM? Seems an odd way to go about things to me…
  7. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Mixers are astonishingly cheap. I did an improved version which optimised channels with zero gain (oddly enough only 1.0 gain was optimised before), and found a 0.0033% improvement per zero-gain channel. So every mixer4 costs a bit over 0.0132% to run. Your 164 are probably only costing you...
  8. h4yn0nnym0u5e

    Using USB host port to read/write USB memory (MSC)

    Be very wary of using AI for code: time after time it generates nonsense which is just plausible enough to waste a lot of your time * is not a directive, it is an operator - these are two very different things compilers do not correct your code for you: if you're lucky erroneous code will...
  9. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Hmmm … I’d expect no change to CPU load, as there’s no obvious need to add any real audio objects; maybe a tiny bit more RAM1 because of the extra classes and their constructors. But the latter could be offset by making your overall code simpler, depending on how clever you’ve been so far about...
  10. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Yup, completely unreadable :LOL: It's an ideal candidate for the updated Design Tool that @manicksan did a few years back. Makes it much easier to maintain a hierarchical / modular topology than the vanilla version. It also allows you to create and place custom objects, though I've found that...
  11. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    It’s not so much the init as the update code, but that was indeed my sticking point. However, any filter is likely to be more resource-hungry, so not really of interest to you. Good luck with the optimisation, I’m fairly sure you’ll find plenty of options!
  12. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    That’s certainly a beast! The only thing I can think of to reduce CPU load further is that noise is noise, so could you not get rid of 3/4 of your pink and white noise generators? I did a quick search but am still not sure of your current architecture, however, I did wonder if splitting the...
  13. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Part of the issue with parallelising the calculations is that the period can be more or less than one block size, so sometimes an update will depend on its own (partial) output! I did think about stealing one of the existing filters’ code to put in the feedback loop to generalise it, but they...
  14. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    It was quite low CPU, but my changes for fractional indexing (needed both for pitch bend and accurate tuning) and the pitch bend calculations themselves are fairly CPU intensive and far from optimised. I did think about auto-adjusting the feedback depending on pitch - that’s effectively the...
  15. h4yn0nnym0u5e

    Tennsy 4.0 & Sound Board - Sequential File Name

    You don’t need us for that - for once (and I admit it’s a rare occurrence) the compiler is telling you exactly what the issue might be and pretty much what to do about it! Shortening the fixed part of the filename should indeed work, as will increasing the filename[] buffer size (the compiler’s...
  16. h4yn0nnym0u5e

    TeensyDebug and Arduino 2.0 IDE

    I’ve used it recently on IDE 1.8.19 under Windows. (I’ve never migrated to 2.x because portable mode isn’t implemented: the issue raised over 5 years ago is locked for further comments with a dev comment that it’s “low priority” - now that’s abandonware 🤬) The installation instructions given in...
  17. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Just to say I've pushed another change to the repo, which improves the tuning. I'm only using AudioAnalyzeNoteFrequency to check, but assuming that's about right the tuning is both better than before, and significantly better than the original AudioSynthKarplusStrong. The latter could only do...
  18. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    Less efficient for sure, but it’s a simple non-breaking change to the F32 library, and means a separate TDM_F32 doesn’t (immediately) need to be developed and maintained. If it gets pulled in and I get some encouragement to do so then it’s fairly likely I’d do the proper code at some point.
  19. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    Pulled in, seems to be working fine for me. I've done a bit of work on the F32 library and put in PR #27 which adds conversion of an F32 audio stream to / from two I16 ones containing the MS and LSwords. This can be used to get 24-bit TDM I/O - only lightly tested so far, though.
  20. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    That all sounds great - thanks so much for your effort on this, I hope it turns out to be worth it. The multi-TDM code doesn’t directly support larger transfers, though as noted above it could be coerced into doing it using pairs of 16-bit signals, and the lowest-impact way of doing that would...
  21. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Good news! I’m chuffed myself that you reminded me that I had been working on this, it might have been forgotten for ages otherwise. And I wouldn’t have necessarily thought about the modulation input at all. Hmm … I’m not sure the note stopping is expected behaviour, I’d’ve expected it to sound...
  22. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Yes, repeated noteOn() without noteOff() was definitely causing a nasty audio block leak, which was a bug, and as you say was wedging the whole audio library. All fixed now, anyway ... hope you manage to get the high priority tasks done in a timely fashion and to the satisfaction of Management...
  23. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    OK, the "what" is straightforward ... At noteOn(), a calculation is made as to how many samples are needed for the requested pitch, bent down as far as the current frequencyModulation() has been set. That's rounded up to the next highest block count. On noteOff(), three updates are used to fade...
  24. h4yn0nnym0u5e

    changing pitch of audio samples - TeensyVariablePlayback library

    Good news. Nice to have some feedback from a Real User, even better when it results in an example to refer back to!
  25. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Bug fixed and inputs swapped, new commit pushed - see what you think. I added a "mandolin mode" to my test sketch which just repeats noteOn() calls at a CC-dependent interval; it broke the old code as expected, but the new code seems OK, so I'm hopeful.
  26. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    I'll give HPF() a go at some point - thanks. I don't think there's a way to avoid using 32 (which is available on a back pad of Teensy 4.0). According to the Reference Manual there's only 2 ball-out options, only one of which is brought out on T4.x: The user could of course place an unused...
  27. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    Not quite right, though my brain is also struggling a bit because one chip’s output is another’s input … and you’ve labelled your signals from the codecs’ POV, whereas I seem to think from Teensy’s! So, Teensy outs need to be 7+32, and ins are 8+6 … so your DI and DO need that too, and as-built...
  28. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    Hi Mark … glad you’re enjoying it To answer your questions in order quite possibly, the input order was arbitrary anyway. I’ll do that I did mention in post #10, but it’s 22 blocks for C0. It uses enough for the played note plus the currently set maximum bend, which is why it’s a bad idea to...
  29. h4yn0nnym0u5e

    Using BiQuad filter with external PCM data stream

    The problem with using any AudioStream-derived object is that it’ll get linked into the update list at construction time, so there’s no way to run it independently apart from something like the bodge I posted in #2, which tramples on the audio but at least gets you a way to debug your code in...
  30. h4yn0nnym0u5e

    Using BiQuad filter with external PCM data stream

    Yes, the AudioPlaySdWav is only in there because you said you were starting from a WAV file, so it seemed the easiest and most relevant way to put the demo together. If you're starting from an existing buffer of samples, you'd probably replace that with an AudioPlayQueue and feed your samples in...
  31. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    For info, here is the “world clock” thread. I think there’s two separate issues here: can TDM be made to work using an external source of MCLK/BCLK/LRCLK, and can the above clocks be regenerated from a studio’s world clock I have no answer for either of these questions at this time, and anyway...
  32. h4yn0nnym0u5e

    Using BiQuad filter with external PCM data stream

    Some time ago I wrote an "update grabber" which takes over the audio system so you can graph or log its output in slower than real time. Here's an example I hacked together quickly - not sure if it's along the lines you were thinking, and I couldn't be bothered to figure out BiQuad coefficients...
  33. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    Input testing: Yellow and green traces are generated on board 0 and board 5, received on inputs on board 0 and board 2, and output on board 0. Far from rigorous, but I'm happy the multi-TDM code is working! Although there are 8 boards connected, 6 and 7 are non-functional in this instance, and...
  34. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    I'm thinking I could address >16-bit sampling in my playback and recording updates, but have been holding off until I have some idea whether there's any chance of the existing code being pulled into the official Teensyduino distro (1.60 beta has been stalled for months now - guess we know one...
  35. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    Hmmm. I’ve just taken a look at the F32 library, and it appears that minor tweaks to AudioConvert_I16toF32 and AudioConvert_F32toI16, and another to the TLV control object, would allow 24-bit I/O. The converters need two inputs for I16toF32, and two outputs the other way. These second ports...
  36. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    @mattybrad that’s an awesome project! A hardware version of my soft-patchable synth, but based on Teensy 3.6. I guess the Teensy 4.x one stalled for some reason? Maybe this new board can resurrect the idea… My updated multi-TDM doesn’t support 24- or 32-bit I/O, but it probably could with...
  37. h4yn0nnym0u5e

    changing pitch of audio samples - TeensyVariablePlayback library

    Image of WAV file supplied, showing loop points I selected
  38. h4yn0nnym0u5e

    changing pitch of audio samples - TeensyVariablePlayback library

    Slightly surprised that you're surprised by the "audible interruptions", given that your audio file fades in at the start and out at the end, so there's about 0.5s of near-silence if it's looped without setting start and finish points. Here's an edit of your code which works, as far as I can...
  39. h4yn0nnym0u5e

    changing pitch of audio samples - TeensyVariablePlayback library

    Note that it must be possible for us to drop your posted code into the Arduino IDE and compile and run it to reproduce your initial result. Short code fragments will not be useful, they often omit relevant information.
  40. h4yn0nnym0u5e

    changing pitch of audio samples - TeensyVariablePlayback library

    Perhaps you could start by posting a short example of code that doesn't work as you'd expect, saying what you expected and what actually happened. At the very least you should also tell us something about the sample data you're trying to play, e.g. RAW or WAV, and its length. It shouldn't be...
  41. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    All righty then ... I think we have a result ... or at least have got to the penalty shoot-out. As before, the revised code is in my repo branch. Features are: two inputs to the object: input 0 is "drive": feed this with audio to keep the waveform going. A bit experimental, may be of use for...
  42. h4yn0nnym0u5e

    AudioSynthKarplusStrong object with modulation/tuning input

    I think I might have made some progress, though I haven't ported my concept across to Teensy code as yet - it's still in the form of a Python simulation, which is way easier to interrogate. You can find an incomplete mess on the relevant branch in my repo. Simulation plot: Prior to t=0, in...
  43. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    You’re very likely right about use cases above 32x32 - it’s just daft poms that try that sort of thing! And maybe artists who aren’t unduly concerned with sound quality, as long as they can fill a darkened space with 80 independent sound channels… If you route everything so much the better, as...
  44. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    I’ll get to the full 80o32i :cool:, just need to figure out the geometry to keep the wiring as short as possible. Plus, recover a bit from that build, it was pretty fiddly. Yes, I’m pleased the multi-TDM works as well as it does. I’d done some testing with dual CS42448 boards but this is pretty...
  45. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    Getting steadily more bonkers. 64 output channels, with a different frequency / waveform combination on each one. As shown it's taking 22% CPU and 64 audio blocks, plus ~770mA from the USB ( :eek: ). I can reduce the CPU to 5% by using sine and triangle waveforms in place of the...
  46. h4yn0nnym0u5e

    t4.1 detect reboot type

    Well … I may be misunderstanding what you’re saying, but … The Rules are: don’t use any sort of Serial access in an ISR. If you use “less”, all you’ve done is to increase the interval between crashes. The next one will probably happen when you’re doing something expensive, on a Friday evening...
  47. h4yn0nnym0u5e

    t4.1 detect reboot type

    I generally drop it into a spreadsheet, ensuring the address columns are set to text (mayhem ensues otherwise), then filter and sort as needed. It’s not easy, though :mad: Yes, definitely avoid serial output from within an ISR. Even sprintf could be problematic, as I think it uses the heap...
  48. h4yn0nnym0u5e

    t4.1 detect reboot type

    That output usually means the access violation occurred in a library function - those don’t tend to have debug information available. You should find a .sym file in the same folder as the .elf, with a bit of digging around you should be able to figure out the function that has code at 0x2179E
  49. h4yn0nnym0u5e

    Updated 8x8 and 16x16 audio

    Two up...
  50. h4yn0nnym0u5e

    Help bringing up WM8904 on Teensy 4.1

    Hmmm ... on second reading, you're probably right - it's kind of not a digital loopback at all, it's an analogue loopback that goes through the digital processing. I read it as anything the Teensy sends out digitally is looped back in. @Pio could well be right. Certainly the Teensy does...
Back
Top