Teensyduino - Page 4
Page 4 of 7 FirstFirst 1234567 LastLast
Results 31 to 40 of 68

Thread: Teensyduino

  1. #31

    Default

    This is the exact code that i used (The inputs are a little screwy i think pin 6 is the led pin on the teensy and i didn't feel like adding a pull down resistor, so i didn't use it)

    http://dl.dropbox.com/u/1596228/midi...r_usb_midi.pde

    after i wrote that code the original author took my changes and made a new version with the updates (a little easier to follow and customize)

    http://www.instructables.com/files/o...FHGM9QL394.zip

    if you need any help with the wiring lemmie know.

  2. #32
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    Quote Originally Posted by timcrawf88 View Post
    This is the exact code that i used (The inputs are a little screwy i think pin 6 is the led pin on the teensy and i didn't feel like adding a pull down resistor, so i didn't use it)

    http://dl.dropbox.com/u/1596228/midi...r_usb_midi.pde

    after i wrote that code the original author took my changes and made a new version with the updates (a little easier to follow and customize)

    http://www.instructables.com/files/o...FHGM9QL394.zip

    if you need any help with the wiring lemmie know.
    does this code support 4 banks mode or any of the supercombos?

    good work btw!

  3. #33
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    Quote Originally Posted by timcrawf88 View Post
    This is the exact code that i used (The inputs are a little screwy i think pin 6 is the led pin on the teensy and i didn't feel like adding a pull down resistor, so i didn't use it)

    http://dl.dropbox.com/u/1596228/midi...r_usb_midi.pde

    after i wrote that code the original author took my changes and made a new version with the updates (a little easier to follow and customize)

    http://www.instructables.com/files/o...FHGM9QL394.zip

    if you need any help with the wiring lemmie know.
    this is the error when I try to upload your code to a Teensy 2.0:

    Code:
    sketch_oct12a:156: error: 'PIN_E0' was not declared in this scope
    sketch_oct12a:156: error: 'PIN_E1' was not declared in this scope
    sketch_oct12a:156: error: 'PIN_C0' was not declared in this scope
    sketch_oct12a:156: error: 'PIN_C1' was not declared in this scope
    is it because I haven't attached any pots/buttons to my Teensy? Shouldn't the code upload okay without anything attached to the Teensy?

  4. #34
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    well I've fiddled with the code a bit:

    Code:
      // This array size must match NUM_DI above.
      #define DIGITAL_PIN_ORDER //PIN_D0, PIN_D1, PIN_D4, PIN_D5, PIN_D7, PIN_E0, PIN_E1, PIN_C0, PIN_C1, PIN_B3, PIN_B2, PIN_B1
    //  #define DIGITAL_PIN_ORDER 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53
    #endif
    
    #define ANALOGUE_PIN_ORDER A0 //, A1, A2, A3, A4, A5
    //#define ANALOGUE_PIN_ORDER A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15
    #define MIDI_CC MIDI_CC_GENERAL1
    and now it uploads okay... I presume because the array size has to match the number of pins in this section:

    Code:
    // Number of digital inputs. Can be anywhere from 0 to 18.
    #define NUM_DI 0
    // Number of analogue inputs. Can be anywhere from 0 to 6.
    #define NUM_AI 1
    but I'm not getting any midi data showing up in midiox when I twiddle the single pot I've got attached to A0

    gonna keep fiddling...

  5. #35
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    okay, well the original author of the "Arcade Button MIDI controller" sketch has come back to me with a proper fix:

    The compilation error is saying that the DIGITAL_PIN_ORDER hasn't been defined, and that the number of elements digitalInputMapping is being assigned to doesn't match the size of the array.

    If you look at line 163, you'll find:
    Code:
    #elif defined(TEENSY_2)
    #elif defined(TEENSY)
    #elif defined(TEENSY_PLUS_PLUS)
    Underneath #elif defined(TEENSY_2) add the following line:
    Code:
    #define DIGITAL_PIN_ORDER 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
    So you'll now have something like:
    Code:
    #elif defined(TEENSY_2)
      #define DIGITAL_PIN_ORDER 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
    #elif defined(TEENSY)
    #elif defined(TEENSY_PLUS_PLUS)
    The number of pins listed (0-12) needs to match the number of digital pins defined on line 121 (NUM_DI).

    Hopefully this addresses both compilation errors.
    I just tried the above and it fixed one error, but not the other.

    To fix the too many initializers problem, go to line 174:
    Code:
    #elif defined(TEENSY_2)
    #define ANALOGUE_PIN_ORDER 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
    Delete the last pin from ANALOGUE_PIN_ORDER, so it now reads
    Code:
    #define ANALOGUE_PIN_ORDER 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
    I'll update the sketch in the Instructable to reflect these changes when I have a chance.
    The issue I'm having now is simply getting the Teensy to work as a midi controller! Take a look at this video which explains my problem:

    http://www.youtube.com/watch?v=K0G1wCf1FRM

  6. #36

    Default

    are you using the code that i modified or the code the original author put out with my changes?

    Not a big deal but just giving me an idea of what code to read through.

    I've never used the latter code so i'm not exactly sure how it runs, just out of curiosity if you are using the latter can you try using mine and see if you get the same error?

  7. #37

    Default

    one quick possibility is in my code i have the analog defined as so:

    Code:
    #define ANALOGUE_PIN_ORDER A0, A1, A2, A3, A4, A5
    //#define ANALOGUE_PIN_ORDER A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15
    #define MIDI_CC MIDI_CC_GENERAL1
    and in the other one the analog is defined like this:

    Code:
    #elif defined(TEENSY_PLUS_PLUS)
      #define ANALOGUE_PIN_ORDER 0, 1, 2, 3, 4, 5, 6, 7
    try changing the analog pin names

  8. #38
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    I just switched to your code again - the same problem

    All the midi sketches cause the teensy to be recognised as a usb midi device, but midiox doesn't pick up ANY midi data when I turn the pot thats connected to A0.

    This is how I've got it setup to test 1 digital and 1 analogue (using your sketch):

    Code:
    // Number of digital inputs. Can be anywhere from 0 to 18.
    #define NUM_DI 1
    // Number of analogue inputs. Can be anywhere from 0 to 6.
    #define NUM_AI 1
    
    // Number of digital inputs. Can be anywhere from 0 to 68.
    //#define NUM_DI 52
    // Number of analogue inputs. Can be anywhere from 0 to 16.
    //#define NUM_AI 16
    
    #ifdef MIDI_FIGHTER
      #define MIDI_CHANNEL 3
      // First note, starting from lower left button
      #define NOTE NOTE_C2
      // When mapping to a MIDI Fighter we need to skip a row of buttons. Set this from 0-3 to define which row to skip.
      // Rows are ordered from bottom to top (same as the MIDI Fighter's button layout).
      #define SKIP_ROW 2
      // This pin order corresponds to the bottom left button being zero, increasing by one as we move from left to right, bottom to top
      // 8  9 10 11
      // 4  5  6  7
      // 0  1  2  3
      // This array size must match NUM_DI above.
      //#define DIGITAL_PIN_ORDER 10, 11, 12, 13, 6, 7, 8, 9, 2, 3, 4, 5
      #define DIGITAL_PIN_ORDER 10
    #else
      #define MIDI_CHANNEL 1
      // First note, starting from upper left button
      #define NOTE NOTE_C0
      // This pin order corresponds to the top left button being zero, increasing by one as we move from left to right, top to bottom
      // 0  1  2  3
      // 4  5  6  7
      // 8  9  10 11
      // This array size must match NUM_DI above.
      #define DIGITAL_PIN_ORDER PIN_D0
      //#define DIGITAL_PIN_ORDER PIN_D0, PIN_D1, PIN_D4, PIN_D5, PIN_D7, PIN_E0, PIN_E1, PIN_C0, PIN_C1, PIN_B3, PIN_B2, PIN_B1
    //  #define DIGITAL_PIN_ORDER 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53
    #endif
    
    //#define ANALOGUE_PIN_ORDER A0, A1, A2, A3, A4, A5
    #define ANALOGUE_PIN_ORDER A0
    //#define ANALOGUE_PIN_ORDER A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15
    #define MIDI_CC MIDI_CC_GENERAL1

  9. #39
    Tech Guru MiL0's Avatar
    Join Date
    May 2009
    Location
    Brighton / Bangkok
    Posts
    1,386

    Default

    I really don't think it's an issue with any of the sketches. I've tried at least 3 different sketches that should turn the teensy into a midi device. I've confirmed that my circuit is working okay via serial when I use the teensy as a serial usb type.

    The problem seems to occur when I switch the usb type to midi. The teensy will appear as a midi device in midiox. When I reset the teensy, it will spit out loads of midi commands to midiox:



    but no matter which analogue pin I attach the pot to, it simply won't output any midi in midiox! I'm totally confused about what I'm doing wrong because I seem to have eliminated every possible problem and it still doesn't work!!

  10. #40

    Default

    do you have traktor? if so open traktor and try the midi mapping, that's how i would figure out if mine worked. Also try just straight uploading my code exactly how it is. see how that works.

Page 4 of 7 FirstFirst 1234567 LastLast

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
  •