Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Making MIDI CC's editable on a Teensy 2 based project

  1. #1
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,138

    Smile Making MIDI CC's editable on a Teensy 2 based project

    I've made a very simple three-button, two-pot MIDI project using Teensyduino and Teensy 2 (actually it supports foot pedals and switches through 1/4 inch plugs).

    I'd like to make a simple Windows editor that would allow me to select which CC each of the five pins is translated to.

    I know there is adequate and accessible EEPROM memory (and the 100K reuse 'limit' is not a major issue for such an occasional usage) and I figure I'll be able to sort out the read and write parts once I figure out how to talk to my sketch (or write directly to the EEPROM).

    I'm familiar with SynthMaker/FlowStone (which has MIDI tools available and now has Ruby support in FlowStone) so I figured I could make the editor in that very easily.

    I assumed having it transmit small blocks of SysEx would be the simplest way of triggering the writes and transmitting the few bytes of data I would need but FlowStone has a bunch of IO tools too so I thought I asked if anyone has a better idea or any advice before I stumble through trial and (lots of) error.

    Any assistance or warnings of potential pitfalls will be greatly appreciated.

  2. #2
    Member
    Join Date
    Nov 2012
    Location
    Olympia, WA
    Posts
    52
    I'm kinda sad don't know the tools you are talking about, but on the Teensy side you might want to check out a similar project to bypass some of that trial and terror. Also: perhaps peruse the program he mentions that inspired him, if you can find it.
    http://echolevel.tumblr.com/post/497...r-by-echolevel

    He hijacks a very-unlikely device maker's ID (Fairlight), which is going to be OK IMO 99.999% of the time. Though he is changing the values very "close to the metal" (hex editing the .syx file!), there's no reason you couldn't just expand the Teensy code to 5 pots and craft / send the tiny Sysex file another way using your PC tools.

  3. #3
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,138
    Nice! I'll just keep my Fairlight in the closet with my Pong game and all will be well.

    The PC side will be no probs but I would have stuggled with some of the MIDI read stuff.

    Thanks Doc

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,303
    If you can get your software to send MIDI Sysex, that's probably the cleanest solution. Or at least it's as good as the ease (or difficulty) of whatever type of user interface that software has.

    Another alternative might be using the Arduino Serial Monitor. You can send messages from the serial monitor, and check for arrival with Serial.available() and grab the data with Serial.read(). The downside is of course needing to run the Arduino IDE to make changes. But if your music software turns out to be too limited in what it can send, or too difficult to configure, or just more trouble than it's worth, at least this other way exists.

    Or you could add hardware like knobs, buttons, a rotary encoder, even an LCD for adjusting parameters without the PC at all.

  5. #5
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,138
    Thanks Paul...

    I think I'll just do SysEx for this iteration. FlowStone (formerly SynthMaker) is a graphic programing environment that is really quick and easy for UI and MIDI tasks. So it should be no problem to come up with a very simple-to-use UI that sends a few btyes of SysEx.

    I have an LCD shield kicking around that I plan on playing with to see about a hardware approach at some later date.

    The serial method seems too much trouble. But it's interesting and I'll keep that in mind if I need to talk to a Teensy without MIDI.

    There is one line of code from the project reference above that has me puzzled:
    byte * sysbytes = usbMIDI.getSysExArray();
    I get what it does... in this case it fills an array 'sysbytes' with eight values 0-7
    But I don't know why it works. Why '*'?
    How is it that sysbytes didn't have to be decalred?
    I've seen some on-line documentation that it's just part of how the MIDI library works but it seems strange to me.
    Last edited by oddson; 11-13-2013 at 06:48 PM. Reason: oops

  6. #6
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,138
    Quote Originally Posted by oddson View Post
    How is it that sysbytes didn't have to be decalred?
    Or is it being decalred as an array of bytes (unsigned int)?

  7. #7
    Member
    Join Date
    Nov 2012
    Location
    Olympia, WA
    Posts
    52
    I think what you have there is dang ol' pointers.

    http://arduino.cc/en/Reference/Pointer

    I steer clear of them unless they are (as in this case) coded by someone else...though everyone seems compelled to point out how easy they are to use.

  8. #8
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,138
    I think you're correct but I guess what threw me was the space.
    I would expect to see "byte *sysbytes = ..."
    Last edited by oddson; 10-08-2017 at 03:25 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •