Jump to content

Simple Prg-Change Box mit LED-Indicators or ...8 digit LED display


macsurfer4
 Share

Recommended Posts

Hi, all of you.

I´m building a small Midibox 64. It has only 8 Buttons with Prg-Change Commands from 1 to 8.

It works fine but there´s a additional wish i have.

May it be possible to display the last pushed button (e.g. Prg-Change 5) on a 8 digit display?

Or the other way, can i have the led lighting up and hold when i press another button?(e.g Prg-Change 4, LED 5 off and LED 4 on)

I have no idea of programming assembler or C but i will learn if you want me to-  ;)

See you later.

Macsurfer4

Link to comment
Share on other sites

Hi Macsurfer4,

I don't know if there's a "hack" to enable an 8 digit display for MB64 (can be...),

but your demands are a quite simple task for programming your own application in C.

Sending a PRG-CH from the DIN_Notify-Function needs two lines of code (MIOS_MIDI_TxBufferPut: MIDI-PRG-CH + Value), switchin an LED takes also just two lines (MIOS_DOUT_PinSet...: all off, last one on);

Implementing an 8 digit display would require to switch multiple DOUTs to build the relevant numbers, not really a lot more complicated ;)

So, if you're not using any other functions from the MB64 app (like banksticks, LCD-menus or sth like that), this seems like a doable task for programming beginners!

You could also do a seach in the forum for segmented LED displays, I think there are some threads around...

Cheers,

Michael

Link to comment
Share on other sites

:) :D ;D 8)

Hi there,

what fun is programming, yeeh ha!!

OK, i´m normal now. I did get help from a friend who is a good programmer.

He showed me some functions:

I can MIOS_MIDI_TxBufferPut(0xC1), I mean send Prg-Change,

I can light up the right led, in connection with a pushed button,

I can display "Programm 1-8" on the LCD,

I can merge midi in to out with MIOS_MIDI_MergerSet(0x01)

I´m really happy right now, this little box is working fine and it was quite easy.

So i am waiting for the parts now but the programming part is done!

The Box will have 8 Prg Change Buttons with Status LEDs, 2 Buttons for future functions, 1 Panic Button (Controller 123), and maybe a lcd display.

But i have one more question, is it possible to display e.g. Programm 1,2,... a bigger type, i mean over 2 lines of the 2x20 display instead of a 8 digit display?

Greetings

macsurfer4 (micha)

So here is some code, if you want please do some advices:

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

// 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

{

if(pin_value == 0 && pin <= 8)

{

// send program change status byte

MIOS_MIDI_TxBufferPut(0xC1);

// send program number

MIOS_MIDI_TxBufferPut(pin);

// switch all leds off

  MIOS_DOUT_PinSet0(0);

  MIOS_DOUT_PinSet0(1);

  MIOS_DOUT_PinSet0(2);

  MIOS_DOUT_PinSet0(3);

  MIOS_DOUT_PinSet0(4);

MIOS_DOUT_PinSet0(5);

MIOS_DOUT_PinSet0(6);

MIOS_DOUT_PinSet0(7);

// switch pressed led on

MIOS_DOUT_PinSet1(pin);

//diplay Program number

MIOS_LCD_Clear();

                          MIOS_LCD_CursorSet(0x00);

                          MIOS_LCD_PrintCString("Program");

              MIOS_LCD_PrintBCD3(pin+1);

}

  else if(pin_value == 0 && pin == 11)

{

  // send controller status byte

MIOS_MIDI_TxBufferPut(0xB1);

// send controller number

  MIOS_MIDI_TxBufferPut(0x7B);

  MIOS_MIDI_TxBufferPut(0x00);

}

}

and one more for the merger

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

// 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(16); // for 128 pins

  // debouncing value for DINs

  MIOS_SRIO_DebounceSet(10);

 

  //set midi merger on

MIOS_MIDI_MergerSet(0x01);

}

Link to comment
Share on other sites

if(pin_value == 0 && pin <= 8)

hehe ;D ...if the pin is uncooler than cool... I like that :)

You could take a look in some examples to find out how to deal with the DISPLAY_Tick() function; clearing the screen takes some time, but in your case (not time critical) your solution to it is quite fine! ;)

But i have one more question, is it possible to display e.g. Programm 1,2,... a bigger type, i mean over 2 lines of the 2x20 display instead of a 8 digit display?

No, and yes: You have the possibility to generate custom chars, but as there are only eight chars storeable (0x0 to 0x7). This way you could define different sets of custom chars and swap while displaying, but I fear, that this would be a quite advanced task and I'm not sure if it's possible to swap the charset while being displayed all at once... :-\

But MIOS also supports GLCDs (Graphical LCDs); you could customize this freely; but I think there are not so many examples available and I've never worked with GLCDs by myself...

You could take a search for Captain Hastings GLCD and CLCD tools here on the forum – and they are linked in the Wiki (appDev -> LCDs), if you're interested.

Best regards,

Michael

Link to comment
Share on other sites

  • 2 weeks later...

The box is for a friend of mine.

He is performing live with some orchestral sounds triggered by a midi keyboard.

This keyboard has no prg-change function, so he asked me to build a simple Box with buttons.

I built the box that he can use it also as a small Midibox 64, the upper 4 buttons and the lcd are for the menu navigation.

534_Programmbox_jpg5ce7882b3b4114a4ba528

536_Box1_jpgdfdf5ceb28a5a7c63daad8bfc72f

538_Box3_jpg9b60c601c6d0bcd0837e3c9c51fb

Link to comment
Share on other sites

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...