Search results

  1. M

    Strange audio playback behavior

    The part for(int i;i<9;i++){ pinMode(i,INPUT_PULLUP); } should it be: for(int i=0;i<9;i++){ pinMode(button_Pins[i],INPUT_PULLUP); } the original code sets pin 4 used as CS to input after the SD card is initialised, this could create isues. Also the test if the file is playing takes a...
  2. M

    Threads... possibly going to cause issues?

    Threads might or might not solve your issues, this depends a lot on the thread scheduling algorithm and the synchronization needs. Threads does not 'magically' give create more time, in most cases threads uses more resources and processor time than a straight loop. If you want a 'high...
  3. M

    Spark generator - How to remove high voltage/frequency noise

    Perhaps optocouplers between shift registers and spark modules
  4. M

    Circuit debugging strategies

    Followup after checking your forum posts. So your code almost works, you can generate 5.13MHz in sync, or 5.00MHz with clocks that have random sync. So what is the issue, digitalWriteFast in a loop dont have the resolution you want, and PWN (analogWrite) can be precise but hard to adjust synco...
  5. M

    Circuit debugging strategies

    Your question is so general its hard to say, but First question to answer is "What precisely is not working, how do you know there is a problem, what is the expected behavior and the actual behaviour?" This meas you must document and describe the problem as carefully as possible. "Not working"...
  6. M

    Teensy 3.6 + PT8211 DAC : pitched sound when recording analog signal

    What does the waveform look like in Audacity, and what should it look like ?
  7. M

    Teensy 4.0 external power burning hot

    How much current does the board use ? Try running from 9V, and yes a heat sink might be needed.
  8. M

    Question about "delay()"

    Try to place a delay(1000) both directly and after before sending the play message.
  9. M

    Frequent Mac hard reboot when uploading to teensy

    What other hardware is the Teensy 4.0 connected to ?
  10. M

    Another dead Teensy?

    Building version one I would put female headers on the stripboard for the adudioboard, and male/female pass through headers on the audioboard. Then connections can be checked without any board, with one and then finally two boards. When it all works, make a more compact soldered version, or...
  11. M

    Start stop timers using two different interupts

    For comparing phases by time difference between two input channels the timer clocks must be synchronised, so you should use two Capture Compare channels connected to the same timer, on the other hand then they will share interrupts so some little code is needed to find out which or both channels...
  12. M

    Teensy 4.0 increase AUDIO_BLOCK_SAMPLES to 512

    Is this an audio system ? Oversampling will reduce random uncorrelated noise, but it will not affect/improve any non-linearities in the system.
  13. M

    Audio Average 96kHz -> 48kHz

    That depends on the details of the input code, but I guess it should have two buffers each with space for 2x128 samples per channel. The hardware uses dma to fill the buffers and when update is called for each channel you do something like: /* one block of 128 samples */ block =...
  14. M

    Serial comm problems.

    Reboot the computer
  15. M

    Audio Average 96kHz -> 48kHz

    If you sample at 96 kHz from the input and then reduce it to 48KHz in the output you have to read two input blocks for every update and output one block, or the special input code handles this. Anyway transmitting 96kHz data with a sample rate of 48kHz needs several blocks sent for every update...
  16. M

    Getting one Teensy 3.6 to act like 2 SPI slaves

    I think this depends on whether there are one or two masters
  17. M


    I am just a simple mathematician, and I know that you can integrate, at least formally since Fourier techniques makes assumptions that are not always satisfied by measured signals, by dividing the Fourier transform by i omega. The units and how to convert them can be seen from the formulas for...
  18. M

    Sending Data from Raspberry Pi via I2C to Teensy 3.6 in HID keyboard mode

    Sending over a normal TTL serial port from Raspberry to Tensy and forwarding as keypresses over HID USB should be simple.
  19. M

    Will USB MIDI handle MPE ?

    As far as I can understand MPE uses standard MIDI transport, but assigns a dedicated channel to every playing note. So USB MIDI should work, but user code has to adapt.
  20. M

    How do I run Teensy with USB audio output on Linux?

    something like alsa mixer (was years since since I played with Linux audio)
  21. M

    24 Bit DAC for Teensy

    Interesting to see, but a bit of apples to oranges. We expect different results when measured at double sampling frequency. Doesn't really show that they are better at the same sampling frequency.
  22. M

    Play sound every x seconds

    Interrupts do happen, that's the point with IntervalTimers, not sure why they cannot be used. The interval trigger every x seconds and sends a NoteOn to an envelop, or sets a mixer amplitude. Another option is to write an AudioTimedGate object, all audio objects are clocked by the update calls...
  23. M

    Teensy 4.1 A2 input question

    Perhaps a timerbased AudioUpdateEventClock object could be added to the library to drive the update cycle.
  24. M

    Dynamic Audio Connection Bug? A new one!

    I hope the basic AudioStream and Connection objects stays simple
  25. M

    Dynamic Audio Connection Bug? A new one!

    Indeed yes, can be cleaned up, mostly to make the logic more clear, its not time critical code.
  26. M

    Dynamic Audio Connection Bug? A new one!

    There seems to be an error in the disconnect method, when unlinking an element from a linked list the pointer of the prevoius node most be shifted, so in AudioStream.cpp line 257 if (p == this) { if (p->next_dest) { p = next_dest; break; } else { p = NULL; break...
  27. M

    Raspberry Pi Pico

    After testing a bit, its quite a nice chip, the Audio library feels overengineered and does a lot of unnecessary buffer copying. The Teensy Audio code is much more efficient. The pico can run the Teensy Audio with a pio i2s output, its not a DSP engine and even with the advertised "fast"...
  28. M

    BLDC joystick too sensitive

    A dead zone in the middle could help. First of all measure the adc reading with joystick centered, my experience is that this will be close to 511 (for 10 bits) but not equal. Save this value as something like adc_center. void loop() { int val, mappedval; //Creating a variable val val=...
  29. M

    Button update and SoftPWMSet incompatibility

    In the loop you set the SoftPWM to the input pins and not the output pins. Will not give any light effects and most likely confuse the inputs also.
  30. M

    no serial port upon teensy 4.1 connect

    Since the Teensy Loader can talk to the board USB must be working, and the SerialUSB should also work if properly configured. So look for fried code and perhaps other hw connections that might upset the board running your sketch. Did you try the 15 second reset press ?
  31. M

    Loud Buzzing Crash

    Perhaps the sound file should be closed before calling, it is opened again in this function.
  32. M

    is there a T4.1 Screw Shield ?

    Looks nice, could be very useful when moving from protoboard to more permanent installations
  33. M

    Sending 180k bytes over Serial

    To know where the problem occurs, count the number of received characters on the Teensy side, connect a serial adapter or another Teensy to the HW serialport to receive debug/status information.
  34. M

    Loud Buzzing Crash

    Does the application crash or is it just a 'crashing' sound ? Is the crash momentary or continous ? Does the sound return to normal when the effect is finished playing ? Does the issue depend on what background file is being played ?
  35. M

    Encoder behaving strangely on Teensy, code works on Uno

    Strange, I took your sketch, added the Encoder library after installing it, checking version Encoder by Paul Stoffregen v 1.4.2. Hooked up a cheap encoder on a breakout board with 10K pullup resistor on the board, the marking says so, to gnd, 3.3V, pins 2 and 3 on a Teensy 3.0 on a...
  36. M

    Bluetooth Serial between Teensy 4.1 and 3.6

    Think about both buffer size and bandwidth, and the delay introduced, for every link in your chain of communications. fill serial out buffer->transmit to BT modem-> BT transmision to receiver -> BT serial out to Teensy serial in -> Teensy read message and send response I dont have the...
  37. M

    Measuring Code Efficiency; Measuring CPU utilization

    A very simple measure is number of loops per second with your code active as a fraction of number of loops per second for an (almost) empty sketch.
  38. M

    Teensy midi output for VST input

    So the audio interface drivers has the multi client capability mentioned by MatrixRat, the UNO shield gives a single MIDI connection with up to 16 channels, just as the standard Teensy USB MIDI (not x4) does
  39. M

    Teensy midi output for VST input

    The DIN from Arduino UNO must connect to some MIDI interface connected to the PC ? And this has some hardware/software driver layer ?
  40. M

    Teensy 3.2 Crashes Computer When Plugged In w/ External Power

    Did you cut the connection between vusb and vin ?
  41. M

    Using usbMIDI with I2C without saturating I2C bus

    If you have a number of automations sending conflicting CC values within 10ms then there is a problem with the Ableton setup, and what value this controller really has, and the rest should be dropped, even if all communications are infinitely fast. With the filtering every slave CC will be...
  42. M

    Using usbMIDI with I2C without saturating I2C bus

    Without seeing the code we are talking about, its hard to give precise help, but filtering CC messages is not hard. Keep an array "byte CC_value[chn][CC]", then when receiving a message (channel,CC,value) test and filter like the following: if (CC_value[channel][CC] != value) { /* only pass...
  43. M

    Programming the Teensy 4.0 with GCC. Examples?

    So this is not criticising anyone, just an attempt at finding the bases, and starting at the OP invitation to discussion. I have myself transitioned between developed environments and paradigms so I know this is a bit painful. The Arduino framework for Teensy uses gcc, so any little *.ino...
  44. M

    Simple High Accuracy Timer advice.

    So 5 ns max error after 1 ms is 5 ppm error, and 5 ns after 1s is 5 ppb. The crystal on the Teensy has a 15ppm specification. If you measure the crystal speed with a high resolution time reference you can compensate for the errors down to, in my tests, around 50ppb as long as room temperature...
  45. M

    Teensy 3.6 to Python Serial Communication Optimization

    In text format 13 bit unsigned values are 0 to 8192 so max four characters plus the ',' separator, so max 5 and min 2 characters per sample. Lets say 3 on average. Anyway if the python in buffer is always full the limiting factor seems to be the python read and display handling. One possible...
  46. M

    Digital inputs switching on their own in a very electrically noisy environment

    Normally shield should be grounded at one end. Another option is to use current signalling, like MIDI. Button closure send a 5mA current through an optoisolator, this should be much more resilient to electrical noise. The optoisolator is in shielded environment and can convert 5mA to 3.3V
  47. M

    arduino-ide 2.0 beta

    The IDE 2.0 is rather nice, feel fast and easy to work with, but there are quite a bit of raw edges. The port selection is forgotten when USB serial is down for reload/reboot, easy to reselect but suddenly the smooth feel is much less smooth, saving a project under a new name drops all...
  48. M

    3.2 Dead? (Newbie)

    Several things, its good with a proper connection from the VIN pin to the VUSB pin, having a two pin header that can be bridged with one of those little caps is very helpful when debugging problems, "bend a piece of solder" can never be a reliable connection to test what works or not. What is...
  49. M

    Trying to understand why sizeof(structure) doesn't match expectation

    Remember that integers are saved in little endian , least significant byte first. This is what I get, Teensy 3.0 union outputLora data; data.timepacketdata.startorfinish = 255; data.timepacketdata.carnum = 1; data.timepacketdata.pulsetime = 0xFFFFFFF0; data.timepacketdata.pulsems = 0xA0A0A0A0...