Jump to content

Custom characters in a 2nd LCD


Jakes Daddy
 Share

Recommended Posts

Hi,

I wonder if anyone can help. I'm building a MB with 2 LCD panels. I can initialize and write to both LCD panels no problem, but now I want to define a couple of custom characters for each LCD.

I am currently doing something like this:

// define the bit patterns for the special chars which will be written to the LCD tables
// we'll use these for pitch up and down indicators (and up and down arrow !)
const unsigned char charset_arrows[2*8] = {
    0x00, 0x04, 0x0e, 0x1f, 0x1f, 0x04, 0x04, 0x00,        // this is the up arrow
    0x00, 0x04, 0x04, 0x1f, 0x1f, 0x0e, 0x04, 0x00        // this is the down arrow
};

void Init(void) __wparam {
    // setup to use 2 16X2 lcds
    MIOS_LCD_YAddressSet(0x00, 0x40, 0x80, 0xc0);

    // add the special characters to the LCDs (up and down arrows for pitch up and down)
    MIOS_CLCD_SpecialCharsInit(charset_arrows);

<rest of Init code>

}

void DIN_NotifyToggle(unsigned char pin, unsigned char pin_value) __wparam { 
    // we need to see if either decks pitch- or pitch+ has been pressed or released as we need to display the appropriate icon on screen
    // we need to do it here rather than waiting on a MIDI in signal as Traktor does not send enough MIDI info for us to determine if it was - or +
    // is it deck a pitch -
    if (pin==26) {
        // either clear or display the down icon on deck a
        MIOS_LCD_CursorSet(0x09);
        MIOS_LCD_PrintChar( pin_value==0 ? ' ' : 0x01 );    // this works, correct custom char is displayed
    } else
    // is it deck a pitch +
    if (pin==27) {
        // either clear or display the up icon on deck a
        MIOS_LCD_CursorSet(0x09);
        MIOS_LCD_PrintChar( pin_value==0 ? ' ' : 0x00 );    // this works, correct custom char is displayed

    } else
    // is it deck b pitch -
    if (pin==58) {
        // either clear or display the down icon on deck b
        MIOS_LCD_CursorSet(0x89);
        MIOS_LCD_PrintChar( pin_value==0 ? ' ' : 0x01 );    // this does not work, correct custom char is not displayed

    } else
    // is it deck b pitch +
    if (pin==59) {
        // either clear or display the up icon on deck b
        MIOS_LCD_CursorSet(0x89);
        MIOS_LCD_PrintChar( pin_value==0 ? ' ' : 0x00 );    // this does not work, correct custom char is not displayed

    }

<rest of DIN_NotifyToggle code>

}

So, when I try display one of the custom characters on the 2nd LCD (by positioning the cursor at an offset of 0x80), it positions correctly but displays a random character. Doing this on the 1st LCD works perfectly.

So, I can only assume that my call to MIOS_CLCD_SpecialCharsInit(charset_arrows) only did it for the 1st LCD. Does anyone know how to get custom characters into the 2nd LCD ??

Thanks in advance

JD

Link to comment
Share on other sites

You'll need to init the special chars twice, once for each display... I haven't toyed with this much, but try setting the cursor position to one on the 2nd LCD before running the MIOS_CLCD_SpecialCharsInit the 2nd time.

I've checked the MIOS source and I'm pretty sure that'll do it :)

Link to comment
Share on other sites

Jakes, how do you plan arrange those displays on the panel? What is the idea?

I'm building a midibox version of a pro DJ CD deck - basically rip apart a broken CD control unit, stuff it with MB goodies, and use it with Traktor.

My base hardware is a Denon 1800F (the top half of the picture - the bottom half is the CD players themselves and they are now in the bin !):

DenonDN-1800F_1b.JPG

I stripped out all of the inards including the original LCD panels (I think they are actually LED, but that does not matter - they are gone now !) - replaced both panels with a 16X2 LCD in exactly the same mounting position, and the plan is to display on it as much as I can based on the original units functionality (ie. pitch, play/pause indicator, time etc) - this is where I'm getting a bit stuck as Traktor does not send much MIDI data, and so pitch I am having to calculate myself based upon the AIN values for the pitch faders - and there is no hope that Traktor will ever send track info as MIDI data (such as time remaining) - never mind, its fun anyway !

Link to comment
Share on other sites

I respect Native Instruments very much, but Traktor sucks! Why... simple because not supporting MIDI good enough. I think current version is 3 and no anny kind of MIDI feedback. I switch to Ableton Live because of that. Not that it supports MIDI... it supports it very well.

Be sure to check Wild Weasel pages about Denon conversion:

http://www.midibox.org/dokuwiki/doku.php?id=wild_weasel

http://stud3.tuwien.ac.at/~e0327352/

Link to comment
Share on other sites

I switch to Ableton Live because of that. Not that it supports MIDI... it supports it very well.

So what MIDI events/data will Ableton send?

From Traktor 3.2 (which is the version I have), it will send MIDI data, but its very basic - all you can do (AFAIK) is to duplicate a MIDI IN event and set it as output. EG. if you configure the DECK A PLAY function to respond to a given MIDI IN signal, you can make Traktor also send it back OUT on the same MIDI channel. So, you can write into the C code for the midibox to respond to this event. Its a bit like an acknowledgement of an event - I press the play button, mb sends the MIDI signal, Traktor receives it, Traktor sends the same MIDI signal back, mb receives it and lights the play led.

I'd be very interested to know what Ableton will send back as MIDI data

Wild Weasel is the man!, and I've already been in touch with him about his project. He gave me a lot of inspiration and ideas.

Link to comment
Share on other sites

I'd be very interested to know what Ableton will send back as MIDI data

The best way to know it is to try it yourself. I tested Live 5 with midifeedback command and it light my LEDs. Live 6 supports various control surfaces that sends midi feedback. I tried LC emulation and MB64 with Mackie control selected in the Live.

EG. if you configure the DECK A PLAY function to respond to a given MIDI IN signal, you can make Traktor also send it back OUT on the same MIDI channel. So, you can write into the C code for the midibox to respond to this event. Its a bit like an acknowledgement of an event - I press the play button, mb sends the MIDI signal, Traktor receives it, Traktor sends the same MIDI signal back, mb receives it and lights the play led.

So Traktor 3.2 does sends feedback? (ok, resend same MIDI to out) Didn`t know that.

I don`t understand why you need anny C coding when you can configure MB DOUT registers to react on MIDI in. I tried it?

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...