Jump to content

jsflint

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Posts posted by jsflint

  1. Hallo, wie offensichtlich einige Andere bin ich zu blöd (obwohl ich einiges gelesen habe...)...

    Habe mein Midibox Projekt soweit fertig gelötet, muß aber die Analogen Geschichten noch Erden bzw. an Masse legen. Nur wie?

    Ich benutze zur Zeit weder einen AOUT noch einen AIN, habe also die entsprechenden Platinenabschnitte nur mit Pins ausgestattet. Die Platinen selbst sind von Smash TV.

    In meiner (gänzlich unwissenden) Vorstellung nehme ich jetzt einfach einen Pfostenstecker mit Flachbandkabel, setze den Stecker auf J5A/B und J6 und auf der anderen Kabelseite drehe ich die Litzen einfach zusammen und löte sie an den unbekannten Massepunkt. Ist das soweit ok? Wenn nicht, benötige ich offensichtlich noch ein paar Tips... So, wo aber verlöte ich jetzt den ganzen Krempel, damit es an Masse liegt? Ich (als einfacher Mensch) benötige hier eine klare, einfache Anweisung... Habe wirklich schon im Forum viel gelesen und glaube, daß es Pin2 vom IC7805 ist, allerdings weiß ich das halt nicht so genau...

    Auch wenn diese Frage für Euch wahrscheinlich echt blöd ist, hilft sie bestimmt auch ner Menge anderen weiter (zudem werde ich wenn die Midibox mal klappt eine kleine Anleitung für uns Unfähige basteln...)

    Vielen Dank schon mal!

  2. Hi, baue mir einen Midicontroller der nur einen analogen Eingang benötigt, daher benutze ich keinen AINX4. Da dort ein Expressionpedal über ein Stereoklinkeeingang angeschlossen werden soll, ist meine erste Frage, wie ich die Buchsenkontakte genau anzulöten habe (So wie beim Schaltplan? Also eine Seite der Stereobuchse an 10k Ohm Widerstand dann an A1 von J5A und die andere Seitung an Masse, oder wie?). Ausserdem muß ich ja alle unbenutzten analogen Eingänge erden... Gibt's da ne tolle Methode - mir scheint, daß einfachste ist ein Flachbandkabel mit Steckpfostenverbinder und das andere Ende der Flachbandleitungen verbinden und dann an Masse - ist das so richtig, oder gibt's noch was besseres?

    Und zuguterletzt: (Stelle ich dann auch nochmal ins C Programming Forum) Wie Adressiere ich meinen analogen Eingang, da ich ja kein AINX4 und dementsprechend keine Shift Register benutze?

    Habe ich sonst irgendwas vergessen oder sollte auf irgendwas achten? Mache das hier zum ersten Mal und will nicht gleich alles abfackeln ;)

    Danke,

    JSF

  3. Ok... actually this is more of a hardware question but I don't want to spam the forum with my questions...

    I intend to include an AIN for my expression pedal (regular stereo jack). Though I read a couple posts I still don't know how to do it. As I want only one AIN, I guess I could skip the AIN module and connect them to a core jumper directly, correct? Do I need to know someting else? And do I need to change some code, or does MIOS recognize that?

    Do you have any idea or link to a post that adresses this?

    Thanks,

    JSF

  4. Thanks for all your help... as you can see I have no idea about C at all but I'm willing to learn so I follow your 'expert' discussion...

    But at least I'm proud of myself 'cause I really looked at the C forum for a couple of hours and was able to write a little code... So thanks to all the midiboxers who wrote all the tutorials and stuff...

    I'll try to learn more about functions and incorporate them so that the code for my small app will at least look clean...

    Oh, one more question: as I won't include AINs, AOUTs and LCD etc, do I need to delete the parts from the skeleton or just leave them?

    Thanks,

    JSF

  5. Oh.. I got than one now... (had to look in an online C reference.. ;) ) but I think it's really a little bit to much for this small controller..

    But thanks for your help! (I will probably continue asking some questions when my midibox parts arrive so... be warned!!)

  6. Hi everybody!

    After a long time I decided to try out my midiboxing skills...

    I just started coding yesterday and I have no experience whatsoever with this.. So please be nice... Additionally I have not yet started building the damn thing so many of my questions will probably be solved when switching it on the first time. But I'm afraid I'll fry it up ;)

    Anyway, I need a lot of help with my code cause I have no freakin idea if anything I coded is correct... But before I post the respective code snippets I will try to describe what my small midi box should do in the end and post a picture so you know what I have in mind...

    midi.jpg

    The box is going to act as a floorboard controller for my guitar effects rig. Although I have some commercial controllers I thought they could do better for my purposes so I ended up here  ;)

    The box has 6 buttons (DIN 0x00 - 0x05 sorry for the typo in the pic) and two external inputs for buttons (DIN 0x6 and 0x7).

    Buttons 4-6 send Control Changes; Button 1 switches between 2 Program Changes (for the distorted guitar channel), same goes for Button 2 (for the clean guitar channel). Button 3 is a shift button, that switches between 3 banks. The Program Changes of Buttons 1 and 2 act correspondingly.

    External Button 2 sends a Control Change message, Ext Button 1 is a little bit more complicated. It is somehow a remote control for Button 1 and 2. It switches between the two Program Change messages of these Buttons, dependent on the last pressed Button (which channel is selected).

    The LEDs 0x07 - 0xA are regular LEDs. The first 3 light up when Control Changes are received, LED 0xA ist just a status LED that turns on, when the midibox is on.

    The lower row of LEDs should be RGB Leds that light up in a different color, when the corresponding button is pressed.

    So far for the concept.... Now comes the really big part, a million questions (I have read the wiki and the forum but still need help, since I'm really a newbie at this...Sorry).

    The whole main.c (WIP) can be downloaded at hxxp://www.dailymojo.org/main.zip if it is easier for you...

    I'll continue now by posting code snippets and then asking the questions for this part, ok?

    Alright...

    /////////////////////////////////////////////////////////////////////////////

    // Local variables

    /////////////////////////////////////////////////////////////////////////////

    // last_button + shift + dirty lead + clean lead + ext1

    unsigned char last_button;

    unsigned char shift;

    unsigned char dirty;

    unsigned char clean;

    unsigned char ext1;

    /////////////////////////////////////////////////////////////////////////////

    // This function is called by MIOS after startup to initialize the

    // application

    /////////////////////////////////////////////////////////////////////////////

    void Init(void) __wparam

    {

      // set shift register update frequency

      MIOS_SRIO_UpdateFrqSet(1); // ms

      // we need to set at least one IO shift register pair

      MIOS_SRIO_NumberSet(NUMBER_OF_SRIO);

      // debouncing value for DINs

      MIOS_SRIO_DebounceSet(DIN_DEBOUNCE_VALUE);

      MIOS_SRIO_TS_SensitivitySet(DIN_TS_SENSITIVITY);

      // only one DOUTX4 module is connected

      // the maximum value is 16 (-> 128 digital outputs)

      MIOS_SRIO_NumberSet(16);

     

      // intialize start-up status etc

      MIOS_DOUT_PinSet(0xA, 1); // Status LED

      MIOS_DOUT_PinSet(0x00, 1); // LED Dirty Rhythm On

      MIOS_DOUT_PinSet(0x01, 0); // Other Channel LEDs off

      MIOS_DOUT_PinSet(0x02, 0);

      MIOS_DOUT_PinSet(0x03, 0);

      MIOS_MIDI_BeginStream();

      MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

      MIOS_MIDI_TxBufferPut(0x1 + shift);  // ProgramChange 1 + shift DIRTY RHYTHM EQ

      MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

      MIOS_MIDI_TxBufferPut(0x59);  // ProgramChange 89

      MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

      MIOS_MIDI_TxBufferPut(0x0);  // ProgramChange 0

      MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

      MIOS_MIDI_EndStream();

      last_button = 0;

    }

    The first 'couple' of questions:

    1) Do I have to declare the local variables somewhere else as well? (total C noob question..)

    2) In the void Init part I included my personal start-up status. Does this belong here or after the void init function?

    3) As I stated above, I want to use RGB LEDs to make it cooler-looking. In the code I treat every color of the LED as a single DOUT, is this the correct way?

    4) Whatfor is the MIOS_MIDI_BeginStream command? In some examples this command was left out... I included it anyway..

    5) Is this the correct way to send multiple midi messages at once? As you can see I send three messages simutaneously...

    6) In the beginning I introduced the char 'shift' , which indicates the status of the shift button (see above). Now in my first midi out message (and in some others too) I want to send a Program Change command which is "ProgChange 1 + shift value" but I don't know if this is the correct way, probably not since I add a decimal value to the Hex value..

    7) the last line shall set the last_button char value as a 0, is this correct?

    Ok, this was the first part, many of these commands will come up again and again so ignore them in the next code parts...

    /////////////////////////////////////////////////////////////////////////////

    //  This function is called by MIOS when a complete MIDI event has been received

    /////////////////////////////////////////////////////////////////////////////

    void MPROC_NotifyReceivedEvnt(

      unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam

    {

      // BLOCK STATUS RECEIVE -> LED 4-6

      if( evnt0 == 0xBF ) {

    // evnt0 == 0xBF  = Control Change on MidiChannel 16

        if( evnt2 == 0x00 ) {

          // Control Change Value 0

          MIOS_DOUT_PinSet(evnt1 +=6, 0);

      } else {

          // Control Change Value 127

          MIOS_DOUT_PinSet(evnt1 +=6, 1);

        }

      }

    }

    The corresponding DOUT_PinSet value should be the received Control Change Number (evnt1) + a decimal 6 (as you can see above the LEDs that should react to these messages are 0x07 to 0x09, so I want to add a 6 to the cc number). How do I do that?

    Ok, the next part describes what happens if a button is pressed... I tried to code it the most easiest way I could (or as I could learn from this forum) but due to my inability to code in C there are probably some errors.. I have no specific questions here, please just have a look at it (especially case 0x06 - is there an easier way to do this?) and tell me if I should jump from a bridge or if there is someway to make me a midiboxer ;)

    /////////////////////////////////////////////////////////////////////////////

    // This function is called by MIOS when an button has been toggled

    // pin_value is 1 when button released, and 0 when button pressed

    /////////////////////////////////////////////////////////////////////////////

    void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam

    {

    switch( pin ) {

      case 0x02: // Bank Button as a Shift button to toggle between three equalizer modes

      shift++;

      if(shift > 2) { shift = 0; }

        switch(shift) {

      case 0:

        MIOS_DOUT_PinSet(0x04, 1);

            MIOS_DOUT_PinSet(0x05, 0);

            MIOS_DOUT_PinSet(0x06, 0);

          break;

      case 1:

        MIOS_DOUT_PinSet(0x04, 0);

            MIOS_DOUT_PinSet(0x05, 1);

            MIOS_DOUT_PinSet(0x06, 0);

      break;

      case 2:

        MIOS_DOUT_PinSet(0x04, 0);

            MIOS_DOUT_PinSet(0x05, 0);

            MIOS_DOUT_PinSet(0x06, 1);

          break;

    } // switch shift

      case 0x00: // Dirty Rhythm/Lead

      dirty++;

      if(dirty >1) {dirty = 0}

        switch(dirty) {

      case 0:

      MIOS_DOUT_PinSet(0x00, 1); // LED Dirty Rhythm On

      MIOS_DOUT_PinSet(0x01, 0); // Other Channel LEDs off

      MIOS_DOUT_PinSet(0x02, 0);

      MIOS_DOUT_PinSet(0x03, 0);

          MIOS_MIDI_BeginStream();

          MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

          MIOS_MIDI_TxBufferPut(0x1 + shift);  // ProgramChange 1 + shift DIRTY RHYTHM EQ

          MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

          MIOS_MIDI_TxBufferPut(0x59);  // ProgramChange 89

          MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

          MIOS_MIDI_TxBufferPut(0x0);  // ProgramChange 0

          MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

          MIOS_MIDI_EndStream();

      last_button = 0;

          break;

      case 1:

      MIOS_DOUT_PinSet(0x00, 0); // LED Dirty Lead On

      MIOS_DOUT_PinSet(0x01, 1); // Other Channel LEDs off

      MIOS_DOUT_PinSet(0x02, 0);

      MIOS_DOUT_PinSet(0x03, 0);

      MIOS_MIDI_BeginStream();

          MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

          MIOS_MIDI_TxBufferPut(0x7 + shift);  // ProgramChange 7 + shift DIRTY LEAD EQ

          MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

          MIOS_MIDI_TxBufferPut(0x7E);  // ProgramChange 126

          MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

          MIOS_MIDI_TxBufferPut(0x0);  // ProgramChange 0 EVENTUELL ÄNDERN WEGEN LOOPER AUF 1

          MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

          MIOS_MIDI_EndStream();

      last_button = 1;

          break;

      } // switch dirty

     

      case 0x01: // Clean Rhythm/Lead

      clean++;

      if(clean >1) {clean = 0}

        switch(clean) {

      case 0:

      MIOS_DOUT_PinSet(0x00, 0); // LED Clean Rhythm On

      MIOS_DOUT_PinSet(0x01, 0); // Other Channel LEDs off

      MIOS_DOUT_PinSet(0x02, 1);

      MIOS_DOUT_PinSet(0x03, 0);

          MIOS_MIDI_BeginStream();

          MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

          MIOS_MIDI_TxBufferPut(0x44 + shift);  // ProgramChange 4 + shift Clean RHYTHM EQ

          MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

          MIOS_MIDI_TxBufferPut(0x59);  // ProgramChange 89

          MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

          MIOS_MIDI_TxBufferPut(0x1);  // ProgramChange 1 EVENTUELL ÄNDERN WEGEN LOOPER AUF 2

          MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

          MIOS_MIDI_EndStream();

      last_button = 2;

          break;

      case 1:

      MIOS_DOUT_PinSet(0x00, 0); // LED Clean Lead On

      MIOS_DOUT_PinSet(0x01, 0); // Other Channel LEDs off

      MIOS_DOUT_PinSet(0x02, 0);

      MIOS_DOUT_PinSet(0x03, 1);

      MIOS_MIDI_BeginStream();

          MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

          MIOS_MIDI_TxBufferPut(0xA + shift);  // ProgramChange 10 + shift Clean LEAD EQ

          MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

          MIOS_MIDI_TxBufferPut(0x77);  // ProgramChange 119

          MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

          MIOS_MIDI_TxBufferPut(0x1);  // ProgramChange 1 EVENTUELL ÄNDERN WEGEN LOOPER AUF 3

          MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

          MIOS_MIDI_EndStream();

      last_button = 3;

          break;

      } // switch clean

     

      case 0x03: // Harmonizer Function Switch 1

      MIOS_MIDI_BeginStream();

      MIOS_MIDI_TxBufferPut(0xBF); // CC on channel 16

      MIOS_MIDI_TxBufferPut(0x1);  // CC #1

      MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // Velocity = 0x7f when

                                                      // button pressed, else 0x00

      MIOS_MIDI_EndStream();

      break;

     

      case 0x04: // Tremolo Function Switch 2

      MIOS_MIDI_BeginStream();

      MIOS_MIDI_TxBufferPut(0xBF); // CC on channel 16

      MIOS_MIDI_TxBufferPut(0x2);  // CC #2

      MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // Velocity = 0x7f when

                                                      // button pressed, else 0x00

      MIOS_MIDI_EndStream();

      break;

     

      case 0x05: // Tuner Function Switch 3

      MIOS_MIDI_BeginStream();

      MIOS_MIDI_TxBufferPut(0xBF); // CC on channel 16

      MIOS_MIDI_TxBufferPut(0x3);  // CC #3

      MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // Velocity = 0x7f when

                                                      // button pressed, else 0x00

      MIOS_MIDI_EndStream();

      break;

     

      case 0x06: // External Switch 1 switches between Lead and Rhythm Sound for both channels

      ext1++;

      if(ext1 >1) {ext1 = 0}

        switch(ext1) {

      case 0:

    if (last_button == 0 || last_button == 1) {

    MIOS_DOUT_PinSet(0x00, 1); // LED Dirty Rhythm On

    MIOS_DOUT_PinSet(0x01, 0); // Other Channel LEDs off

    MIOS_DOUT_PinSet(0x02, 0);

    MIOS_DOUT_PinSet(0x03, 0);

    MIOS_MIDI_BeginStream();

    MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

    MIOS_MIDI_TxBufferPut(0x1 + shift);  // ProgramChange 1 + shift DIRTY RHYTHM EQ

    MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

    MIOS_MIDI_TxBufferPut(0x59);  // ProgramChange 89

    MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

    MIOS_MIDI_TxBufferPut(0x0);  // ProgramChange 0

    MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

    MIOS_MIDI_EndStream();

    } // endif lastbutton

    if (last_button == 2 || last_button == 3) {

    MIOS_DOUT_PinSet(0x00, 0); // LED Clean Rhythm On

    MIOS_DOUT_PinSet(0x01, 0); // Other Channel LEDs off

    MIOS_DOUT_PinSet(0x02, 1);

    MIOS_DOUT_PinSet(0x03, 0);

    MIOS_MIDI_BeginStream();

    MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

    MIOS_MIDI_TxBufferPut(0x4 + shift);  // ProgramChange 4 + shift Clean RHYTHM EQ

    MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

    MIOS_MIDI_TxBufferPut(0x59);  // ProgramChange 89

    MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

    MIOS_MIDI_TxBufferPut(0x1);  // ProgramChange 1 EVENTUELL ÄNDERN WEGEN LOOPER AUF 2

    MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

    MIOS_MIDI_EndStream();

    } // endif lastbutton

    break;

    case 1:

    if (last_button == 0 || last_button == 1) {

    MIOS_DOUT_PinSet(0x00, 0); // LED Dirty Lead On

    MIOS_DOUT_PinSet(0x01, 1); // Other Channel LEDs off

    MIOS_DOUT_PinSet(0x02, 0);

    MIOS_DOUT_PinSet(0x03, 0);

    MIOS_MIDI_BeginStream();

    MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

    MIOS_MIDI_TxBufferPut(0x7 + shift);  // ProgramChange 7 + shift DIRTY LEAD EQ

    MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

    MIOS_MIDI_TxBufferPut(0x7E);  // ProgramChange 126

    MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

    MIOS_MIDI_TxBufferPut(0x0);  // ProgramChange 0

    MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

    MIOS_MIDI_EndStream();

    } // endif lastbutton

    if (last_button == 2 || last_button == 3) {

    MIOS_DOUT_PinSet(0x00, 0); // LED Clean Lead On

    MIOS_DOUT_PinSet(0x01, 0); // Other Channel LEDs off

    MIOS_DOUT_PinSet(0x02, 0);

    MIOS_DOUT_PinSet(0x03, 1);

    MIOS_MIDI_BeginStream();

    MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 16

    MIOS_MIDI_TxBufferPut(0xA + shift);  // ProgramChange 10 + shift Clean RHYTHM EQ

    MIOS_MIDI_TxBufferPut(0xC0); // Midichannel 1

    MIOS_MIDI_TxBufferPut(0x77);  // ProgramChange 119

    MIOS_MIDI_TxBufferPut(0xC1); // Midichannel 2

    MIOS_MIDI_TxBufferPut(0x1);  // ProgramChange 1 EVENTUELL ÄNDERN WEGEN LOOPER AUF 2

    MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // High-Active State

    MIOS_MIDI_EndStream();

    } // endif lastbutton

    break;

     

      } // switch ext1

    case 0x07: // Externeal switch 2 switches Delay ON/OFF via CC #4

    MIOS_MIDI_BeginStream();

    MIOS_MIDI_TxBufferPut(0xBF); // CC on channel #16

    MIOS_MIDI_TxBufferPut(0x4);  // CC #4

    MIOS_MIDI_TxBufferPut(pin_value ? 0x00 : 0x7f); // Velocity = 0x7f when

                                                      // button pressed, else 0x00

    MIOS_MIDI_EndStream();

    break;

      } // switch pin

    } // void din notify toggle

    Ok, this was a long post and I know it's not that polite to start here with a million questions etc... But I tried to do as much as I can without asking (by reading the forum, the wiki and stuff) and now this is the part that seems unclear to me..

    I tried to explain my code as precise as I can, so feel free to ask if you need something explained more in detail...

    Anyway, thanks to anyone who's able one or more questions! Sorry for my english...

    Well I owe you a beer or two...

    Thanks,

    JSF

×
×
  • Create New...