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

Search:

Type: Posts; User: PieterP

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    9
    Views
    584

    There is a wrapper...

    There is a wrapper, but you don't need it, Control Surface supports MIDI over hardware serial out of the box. For example:

    HardwareSerialMIDI_Interface serialmidi = Serial1;
    This line replaces...
  2. Replies
    3
    Views
    191

    I don't think you're supposed to make copies of...

    I don't think you're supposed to make copies of the serial ports. Not sure why the HardwareSerial copy constructor isn't deleted.
    If you want to declare the serial ports separately, use references...
  3. Replies
    9
    Views
    584

    You might be interested in the Control Surface...

    You might be interested in the Control Surface library for Arduino and Teensy that I maintain. It comes with many building blocks for creating MIDI controllers and control surfaces and has support...
  4. Replies
    22
    Views
    894

    Changing the Interrupt Threshold Control value...

    Changing the Interrupt Threshold Control value seems to alter the timing and might expose some data races.
    Occasionally, packets seem to be dropped when sending very long SysEx messages using my...
  5. Replies
    22
    Views
    894

    What exactly is the problem with the...

    What exactly is the problem with the USBDriverTimer class? Is there anything you could use help with?
  6. Replies
    22
    Views
    894

    You would inherit from the MIDI_Callback class...

    You would inherit from the MIDI_Callback class and implement its onChannelMessage method. Then attach the callback to the MIDI interface using setCallbacks.
    For example:

    #include...
  7. Replies
    22
    Views
    894

    Sure, the code for the T4.0 simply discards any...

    Sure, the code for the T4.0 simply discards any incoming MIDI USB data (compiled with USB type “MIDI”, of course):

    void setup() {
    pinMode(LED_BUILTIN, OUTPUT);
    digitalWrite(LED_BUILTIN,...
  8. Replies
    22
    Views
    894

    I've been working on a more efficient...

    I've been working on a more efficient implementation of the USB host MIDI driver. It uses alternating transmit buffers and disables interrupts only for a minimal amount of time, which allows for high...
  9. Replies
    205
    Views
    15,164

    On a related note: Raspberry Pi also boasts about...

    On a related note: Raspberry Pi also boasts about the SWD debugging support on the Pico. A $4 SWD debugger sounds pretty nice.

    I've tried their “Picoprobe” firmware and their fork of OpenOCD to...
  10. Replies
    205
    Views
    15,164

    Maybe it was because I already had some of the...

    Maybe it was because I already had some of the necessary dependencies and tools installed, but for me it was as simple as installing the PlatformIO extension in VSCode and clicking the “new project”...
  11. Replies
    205
    Views
    15,164

    IIRC, the Arduino Pro IDE is based on Eclipse...

    IIRC, the Arduino Pro IDE is based on Eclipse Theia, which is an open-source VSCode alternative. The problem with VSCode is that it's not really open-source. It's built on open-source and large parts...
  12. The Teensy 4.0 is a 3.3V device, connecting...

    The Teensy 4.0 is a 3.3V device, connecting analog pins to 5V will destroy it. Your potentiometers should be wired to 3.3V, not 5V.

    Pieter
  13. You could use a lambda function: ...

    You could use a lambda function:

    OLEDIntervalTimer.begin(+[]{ enableCyclePointer(&currentGlobals); }, 6);

    Pieter
  14. I've been using Teensy on Ubuntu 20.04 since it...

    I've been using Teensy on Ubuntu 20.04 since it came out in April (and on 19.10, 18.04 and 16.04 before that), and I've never had any problems with the serial monitor.

    When selecting the 'Serial'...
  15. MIDI uses a current loop, not voltage. It's...

    MIDI uses a current loop, not voltage. It's normal that you don't measure any voltage at the output of your circuit, it only needs to source current. By adding some kind of pull-up network (e.g. by...
  16. Thread: teensy midi

    by PieterP
    Replies
    9
    Views
    615

    I posted a working example for a MIDI controller...

    I posted a working example for a MIDI controller with buttons and an encoder. Did it not work for you?

    If you want to write your own code from scratch, you'll have to learn some basics about the...
  17. Thread: teensy midi

    by PieterP
    Replies
    9
    Views
    615

    The MCU::PLAY constant is for the Mackie Control...

    The MCU::PLAY constant is for the Mackie Control Universal protocol specifically. If you don't use that protocol, the controller numbers don't really have any meaning apart for the MIDI mapping you...
  18. Thread: teensy midi

    by PieterP
    Replies
    9
    Views
    615

    You have to write code, there's no way around...

    You have to write code, there's no way around that. You have to tell the Teensy what MIDI messages to send and when, and how it should react to the incoming MIDI messages it receives.

    I'm the...
  19. There are very few circumstances where you should...

    There are very few circumstances where you should be using “new” in modern C++.
    The code you linked to uses “new” and owning raw pointers, and leaks memory as a result.

    For example here:
    ...
  20. Replies
    6
    Views
    266

    A quick glance at the source seems to reveal that...

    A quick glance at the source seems to reveal that the default constructor copies the contents of a pre-allocated “zero” constant BigNumber. This constant is created when calling BigNumber::begin(),...
  21. Replies
    6
    Views
    266

    Something like this, perhaps? class Foo { ...

    Something like this, perhaps?

    class Foo {
    public:
    static BigNumber* getBarPtr() {
    static BigNumber bar; // Costructed when this function is first called
    return &bar;
    ...
  22. Replies
    6
    Views
    266

    You cannot create a BigNumber before calling...

    You cannot create a BigNumber before calling BigNumber::begin(), otherwise the BigNumber constructor will dereference a null pointer and crash your program.

    Pieter
  23. You can use the “usb_string_midi_port1” through...

    You can use the “usb_string_midi_port1” through “usb_string_midi_port16” constants. By default, the names used are “Port *”, see usb_desc.c#L1686.

    You can define these names as shown here, for...
  24. I don't have too much time to look into it right...

    I don't have too much time to look into it right now, but here are a couple of things you could try:

    - Try using doubles instead of floats. If it's a numerical issue, there should be a difference....
  25. I'm not familiar with “denormalisation” in...

    I'm not familiar with “denormalisation” in digital filters. In analog filter design, there seems to be a technique called denormalisation, but I'm not familiar with it.
    In all floating point...
  26. I maintain this Arduino-Filters...

    I maintain this Arduino-Filters library.
    It supports Butterworth filters out of the box, as you can see in this example: Butterworth.ino
    Ideally, this example is all you need to filter some sensor...
  27. Replies
    2
    Views
    294

    I don't use Ableton myself, but in my experience,...

    I don't use Ableton myself, but in my experience, DAWs will usually send all relevant MIDI data when you start the application, when you open a new project, or when you configure the control surface....
  28. Replies
    7
    Views
    500

    Don't bother with the powf and pow C functions,...

    Don't bother with the powf and pow C functions, use the C++ function std::pow from the <cmath> header, it'll always select the right version: double if the arguments are doubles, float if the...
  29. Replies
    8
    Views
    532

    Basically it just reads the states of all the...

    Basically it just reads the states of all the pins, and for each pair of pins, it compares them to the previous states. This is done by combining the two new states and the two old states as a 4-bit...
  30. Replies
    8
    Views
    532

    Here's what I use:...

    Here's what I use: https://github.com/tttapa/Arduino-Helpers/blob/master/src/AH/Hardware/MCP23017Encoders.hpp

    See this example:...
  31. Replies
    8
    Views
    532

    I see you've edited your reply, glad you got it...

    I see you've edited your reply, glad you got it working.

    If you have multiple chips, you could tie all of their interrupt pins together (use open-drain output on the MCPs and input pull-up enabled...
  32. Replies
    8
    Views
    532

    When a pin of the MCP changes state, the...

    When a pin of the MCP changes state, the interrupt output goes low. This should trigger an interrupt on the Teensy. In the ISR, you read the MCP input register, and this read request causes the MPC...
  33. Replies
    8
    Views
    532

    The MCP will keep the interrupt pin low until you...

    The MCP will keep the interrupt pin low until you read the input register of the port that caused the interrupt, so you have to read the data in your ISR.
    This also implies that the correct...
  34. Replies
    4
    Views
    398

    A latency of 27ms doesn't seem right at all. I'm...

    A latency of 27ms doesn't seem right at all. I'm not familiar with the Adafruit libraries you mention, but I did write a MIDI BLE library for ESP32. The way I handle it there is by buffering the...
  35. Replies
    4
    Views
    398

    What exactly do you need a queue for? Usually,...

    What exactly do you need a queue for? Usually, you want to keep the latency as low as possible, so you'd avoid queuing up any MIDI data. The serial port or USB MIDI code you're using already has its...
  36. For my purposes, and as a beginner-friendly...

    For my purposes, and as a beginner-friendly Arduino/Teensy sketch, using the same size for the state as for the input is a perfectly sensible default.
    You can still supply your own types as a...
  37. Agreed, I added a check and more comments on the...

    Agreed, I added a check and more comments on the page:...
  38. For truly random inputs, it probably doesn't...

    For truly random inputs, it probably doesn't matter, but the problem with truncation is that it makes it impossible to reach zero again (assuming non-negative inputs).

    Using a rectangular input...
  39. Ah, I see what you mean. The difference is of...

    Ah, I see what you mean.
    The difference is of course that both 'Decay' and 'Exponential' use floating point states and operations, whereas the C++ implementation uses only integer arithmetic, so...
  40. Indeed, @xenington where did you get that code...

    Indeed, @xenington where did you get that code from? The pages you linked to seem to list the correct code...
  41. Replies
    10
    Views
    690

    You're right, I didn't double-check my version, I...

    You're right, I didn't double-check my version, I meant 1.52, 1.53 does indeed seem to include the change.
  42. Replies
    10
    Views
    690

    The .ARM.exidx section was added just 25 days...

    The .ARM.exidx section was added just 25 days ago, it's not yet included in the latest official release of Teensyduino.

    I ran into the same problem a couple of weeks ago, trying to copy the...
  43. Replies
    19
    Views
    2,085

    I've used CMake extensively for cross-compiling...

    I've used CMake extensively for cross-compiling on Linux, but never tried it on Windows, so I might be wrong but here are at least some things I could think of:

    The default CMake generator for...
  44. Here's what I use:...

    Here's what I use: https://github.com/tttapa/Arduino-Helpers/blob/ea926d30f64916cbe9d9c5a14b2b0f23e6a6d40a/src/AH/Hardware/ButtonMatrix.ipp#L16-L49
    Should be simple enough to translate that to C, or...
  45. You can simply compile the necessary files as C++...

    You can simply compile the necessary files as C++ if you edit the makefile accordingly. I covered the process in this Stack Exchange answer. Since you're not using an ATmega16U2, you probably don't...
  46. Replies
    2
    Views
    327

    In most cases, you can just undefine these...

    In most cases, you can just undefine these annoying macros.
    Here's what I use in my Linear Algebra library: ArduinoMacroFix.hpp.
    You have to include it before including any Eigen headers (and...
  47. Alternatively, you could use the Control Surface...

    Alternatively, you could use the Control Surface library, it'll filter the analog input for you, and it supports MIDI routing as well.

    For example:

    #include <Control_Surface.h> // Include the...
  48. Replies
    6
    Views
    506

    /dev/ttyACM* only exists if you select a USB mode...

    /dev/ttyACM* only exists if you select a USB mode (in the Tools menu of the IDE) that includes "Serial".
  49. Replies
    68
    Views
    3,869

    I'm sorry, without more information, I cannot...

    I'm sorry, without more information, I cannot possibly help you.

    Does it not send the correct MIDI messages, or does it not send any messages at all?
  50. Replies
    68
    Views
    3,869

    The code I posted can be used with that setup. ...

    The code I posted can be used with that setup.

    If you want the exact code, try this:


    #include <MIDI_Controller.h>

    AnalogCC potentiometers[] = {
    {A0, MIDI_CC::Channel_Volume, 1}, //...
Results 1 to 50 of 59
Page 1 of 2 1 2