Forum Rule: Always post complete source code & details to reproduce any issue!

Search:

Type: Posts; User: el_supremo

Page 1 of 10 1 2 3 4

Search: Search took 0.01 seconds.

  1. If you are writing to WAV files, it won't help...

    If you are writing to WAV files, it won't help writing 512 bytes at a time because what is getting in your way is the 44 byte WAV header which offsets everything you write.
    I have found a way around...
  2. 1) I think the memory requirement will be...

    1) I think the memory requirement will be determined primarily by how long the delays need to be and how much memory you allocate to the granular effects. That in turn will determine whether you need...
  3. Replies
    20
    Views
    448

    I've been playing with the filter and produced...

    I've been playing with the filter and produced this sketch which you might find useful.
    It generates a tonesweeep from 100-10000Hz over 5 seconds. The output of the sweep is fed to the queue so that...
  4. If mixer3 and mixer4 will only have one input in...

    If mixer3 and mixer4 will only have one input in the final design, they can be removed and the diagram simplifies to this:

    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>...
  5. Your diagram is essentially mono. To handle...

    Your diagram is essentially mono. To handle stereo you would need to have a separate path for each channel. Import this into the audio design tool:

    #include <Audio.h>
    #include <Wire.h>
    #include...
  6. Replies
    20
    Views
    448

    Fixing the m_buffer[-1] problem and changing...

    Fixing the m_buffer[-1] problem and changing floating point to fixed-point arithmetic won't make significant changes to the audio.
    There is something else that is having a more profound effect.
    One...
  7. Replies
    20
    Views
    448

    Try this: m_file.write((const char *)m_out,...

    Try this:

    m_file.write((const char *)m_out, AUDIO_BLOCK_SAMPLES * 2 * 2);

    And, you can also copy and paste error messages as text too.

    Pete
  8. Replies
    20
    Views
    448

    I missed (at least) one thing. The m_out array...

    I missed (at least) one thing. The m_out array also needs to be int16_t;

    int16_t m_out[AUDIO_BLOCK_SAMPLES * 2];

    Which Teensy are you using? (T3.2 ?)

    Pete
  9. Replies
    20
    Views
    448

    P.S. You can also speed up things by changing the...

    P.S. You can also speed up things by changing the floating point computations to use int16_t instead. We'll also handle that once the basic code works.

    Pete
  10. Replies
    20
    Views
    448

    uint8_t m_buffer[512]; That is...

    uint8_t m_buffer[512];
    That is your biggest problem. Samples are int16_t. When you calculate this:

    m_smooth = 0.985f * (m_smooth + m_buffer[k] - m_buffer[k - 1]) ;
    it is done...
  11. Replies
    20
    Views
    448

    Posting code as an image makes it extremely...

    Posting code as an image makes it extremely difficult to help you.
    Cut and paste it as text into your message, preferably within code tags (use the # icon).

    Have you tried the unmodified...
  12. Replies
    12
    Views
    324

    When using MIDI-OX, have you selected Teensy MIDI...

    When using MIDI-OX, have you selected Teensy MIDI in Options|MIDI devices. If you don't click on it to highlight it, MIDI-OX will ignore it.

    Pete
  13. Replies
    12
    Views
    324

    I made these changes #define btn0 2 #define...

    I made these changes

    #define btn0 2
    #define led0 LED_BUILTIN
    and your code works on a Teensy2 - I see the MIDI messages with Midi-Ox on my windows PC and also the messages to the Serial monitor....
  14. Which Teensy are you using? So, a maximum of...

    Which Teensy are you using?


    So, a maximum of 3200 bytes which would be no problem at all on a T3.x or T4.x and even on a Teensy 2 shouldn't cause problems.


    That makes no sense at all....
  15. The bug is in your code. The Audio library...

    The bug is in your code. The Audio library expects that when you play a buffer, you have allocated an audio object that will receive and process that buffer. All you are doing is allocating buffers...
  16. Replies
    39
    Views
    1,245

    When you print (or println) int16_t data, you...

    When you print (or println) int16_t data, you must always cast it as (uint16_t) to stop the implicit sign extension. E.g.

    Serial.println((uint16_t)plaintext[0], HEX);
    Then it will print this...
  17. Replies
    39
    Views
    1,245

    No they aren't. They are all 32-bits. The...

    No they aren't. They are all 32-bits. The difference is that all the numbers that begin with FFFF were negative and FFFF is the sign extension which occurs when a negative 16-bit number is converted...
  18. Replies
    4
    Views
    244

    Which Teensy and ethernet hardware are you using?...

    Which Teensy and ethernet hardware are you using?

    Pete
  19. Replies
    3
    Views
    211

    If I read the card correctly, that is the CAN bus...

    If I read the card correctly, that is the CAN bus Tx and Rx.

    Pete
  20. P.S. If the loopback on Serial2 works, you can...

    P.S. If the loopback on Serial2 works, you can change the JY901 code to use that port instead of Serial1.

    Pete
  21. Hang on. The JY901 has nothing to do with the...

    Hang on. The JY901 has nothing to do with the loopback test! My bad. The Serial1.begin sets the baud rate of the loopback. The JY901 isn't there.
    It is not a good sign that the loopback doesn't...
  22. That suggests that the JY901 isn't at 9600 baud....

    That suggests that the JY901 isn't at 9600 baud.
    Change this

    Serial1.begin(9600);
    To try the other baud rates: 2400, 4800, 19200 and 38400.

    Pete
  23. Your code looks correct as long as the JY901 is...

    Your code looks correct as long as the JY901 is set for 9600 baud.
    It is possible that having the JY901 Tx pin at 5V has damaged the Teensy Rx pin - the T4.1 is not 5V tolerant. Try this loopback...
  24. Either of those libraries should work (I found...

    Either of those libraries should work (I found where your example reads serial DUH! :) ).
    So, it's a hardware problem!
    Only thing I notice in the photo is that you appear to be powering the JY901...
  25. BTW. I can't see where the JY901 library actually...

    BTW. I can't see where the JY901 library actually reads anything from the serial port.
    Perhaps try this library instead.

    Pete
  26. Post a diagram (and/or a photo) of how you have...

    Post a diagram (and/or a photo) of how you have the JY901 connected to the Teensy - perhaps you have the Tx and Rx pins the wrong way round?

    Pete
  27. The problem is that teensy4/imxrt.h and JY901.h...

    The problem is that teensy4/imxrt.h and JY901.h both use the name BAUD but for different uses. One way to resolve it is to edit the JY901 library (JY901.cpp and JY901.h) and change every occurrence...
  28. Replies
    39
    Views
    1,245

    The audio_block_t data structure is defined in...

    The audio_block_t data structure is defined in Audiostream.h

    typedef struct audio_block_struct {
    uint8_t ref_count;
    uint8_t reserved1;
    uint16_t memory_pool_index;
    int16_t ...
  29. You have Teensy pins 11 and 12 wired incorrectly....

    You have Teensy pins 11 and 12 wired incorrectly. They should be the other way round. MISO on the Ra-01 should go to MISO (pin 12) on the Teensy.

    Pete
  30. Your code doesn't compile. A lot of variables are...

    Your code doesn't compile. A lot of variables are not declared. You've probably left out a lot of declarations from the beginning of the file.

    Pete
  31. Replies
    9
    Views
    281

    I have got the code to compile on a Teensy 4.1...

    I have got the code to compile on a Teensy 4.1 after a bit of pushing and shoving, but I can't test it. It is all in one directory.
    21942

    Pete
  32. Replies
    7
    Views
    209

    Works for me with Firefox. Pete

    Works for me with Firefox.

    Pete
  33. You are using Arduino Version 1.8.12. The current...

    You are using Arduino Version 1.8.12. The current version is 1.8.13. You probably have an older version of Teensyduino too.
    Install the latest Arduino IDE and then install the latest Teensyduino and...
  34. Replies
    39
    Views
    1,245

    block->data[0] to block->data[3] is 8 bytes. Each...

    block->data[0] to block->data[3] is 8 bytes. Each audio sample is an int16_t not 32-bits.

    Pete
  35. Replies
    8
    Views
    376

    Teensy LC is a 3V3 device, Teensy 2 is a 5V...

    Teensy LC is a 3V3 device, Teensy 2 is a 5V device. Would the MIDI circuit need to be modified to handle the difference and did you do that?

    Pete
  36. Replies
    39
    Views
    1,245

    As I mentioned in #2, you are printing 44100...

    As I mentioned in #2, you are printing 44100 times per second which results in perhaps 176kB/s. The serial buffer is not huge and probably fills up quickly and then (I think) the Serial driver blocks...
  37. Replies
    39
    Views
    1,245

    Sounds like the Serial.prints in the update()...

    Sounds like the Serial.prints in the update() function are interfering with the output.
    Comment the four Serial.print statements and check the audio.

    Pete
  38. Replies
    3
    Views
    262

    See this thread...

    See this thread, especially Paul's answer in message 9.

    Pete
  39. Replies
    39
    Views
    1,245

    Two problems (I thiink). ...

    Two problems (I thiink).

    Serial.print(*sampleRect);
    1. sampleRect is declared as int32_t so you are trying to print the address of that variable, not its value/content.
    2. Doing a Serial.print...
  40. Replies
    5
    Views
    244

    Would using just two diodes in series drop the...

    Would using just two diodes in series drop the voltage from between 5V and 2V down to about 3.6V and 0.6V ?

    Pete
  41. Replies
    4
    Views
    241

    Yes, each of the .ino and .cpp files is compiled...

    Yes, each of the .ino and .cpp files is compiled separately, so that an #include only applies within that one file.

    Pete
  42. Replies
    4
    Views
    241

    At the top of the file, add this: #include...

    At the top of the file, add this:

    #include <Arduino.h>


    Pete
  43. AudioMemory is a macro. Adding EXTMEM on the...

    AudioMemory is a macro. Adding EXTMEM on the front doesn't change the macro at all.
    However, you can try changing the macro itself. In ...\hardware\teensy\avr\cores\teensy4\AudioStream.h at line 106...
  44. Replies
    27
    Views
    856

    I didn't think to try digitalToggleFast! But it...

    I didn't think to try digitalToggleFast! But it compiles to what I show in #6.

    Pete
  45. Replies
    27
    Views
    856

    The digitalToggle function doesn't compile down...

    The digitalToggle function doesn't compile down to a single STR like digitalWriteFast does but you can use this in its place:

    CORE_PIN0_PORTTOGGLE = CORE_PIN0_BITMASK;
    CORE_PIN0_PORTTOGGLE =...
  46. Replies
    27
    Views
    856

    In this message...

    In this message Paul says that digitalWriteFast compiles to a single STR instruction but that it can take two clock cycles to execute.
    @tonton81 may be right that toggling could be faster because,...
  47. Replies
    27
    Views
    856

    Each of those statements is compiled to a single...

    Each of those statements is compiled to a single assembler instruction so I don't think you can improve on it.
    Does it make any difference if you compile with Tools|Optimize: "Fastest" ?

    Pete
  48. Replies
    36
    Views
    717

    Hmmmm. The link in #28 is to...

    Hmmmm. The link in #28 is to https://forum.pjrc.com/attachment.php?attachmentid=21728 which shows the image to me.
    Try again:
    21739
    That seems to have attached in a different way but I used the...
  49. Replies
    36
    Views
    717

    @KurtE: Does the attachment in #28 work for you?...

    @KurtE: Does the attachment in #28 work for you?

    Pete
  50. Replies
    36
    Views
    717

    The rest of your wiring looks OK. I hooked up a...

    The rest of your wiring looks OK.
    I hooked up a T3.6 with several I2C devices, including the Chronodot. I tried two different I2C scanners and both find all 5 addresses on the bus using a range of...
Results 1 to 50 of 500
Page 1 of 10 1 2 3 4