-
Posts
812 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Gallery
Everything posted by bugfight
-
http://www.midibox.org/forum/index.php/topic,12362.0.html
-
ugh plastic
-
ahhh that text doesn't appear til you enable scripts. plus, i doubt everything... thanks for the info.
-
cool, those fit the 7506?
-
4x16 (8x8) Button/Duo-LED programming example
bugfight replied to TK.'s topic in MIOS programming (C)
no problemo, i'll be making an 8x8 device "soon" so i would have done it eventually, anywayz... -
4x16 (8x8) Button/Duo-LED programming example
bugfight replied to TK.'s topic in MIOS programming (C)
ok "soon" actually was soon in this case. i haven't checked this into svn, (tk let me know if you want me to...) but it is tested and working on my hardware. i'm not sure "descramble" is the best choice for naming it, though... here are the changes. in main.h i added: #define BLM_DESCRAMBLE_ROWS 1 //set this to 0 for 4x16 (like MB_Seq) and 1 for 8x8 the rest of the changes are in main.c in Global variables, i added: #if BLM_DESCRAMBLE_ROWS unsigned char blm_button_row_dscrmbl; #endif in DISPLAY_Tick(), i replaced MIOS_LCD_PrintBCD3(blm_button_row);: with #if BLM_DESCRAMBLE_ROWS MIOS_LCD_PrintBCD3(blm_button_row_dscrmbl); #else MIOS_LCD_PrintBCD3(blm_button_row); #endif here is the entire MPROC_NotifyReceivedEvnt() which contains the scramble code: i also corrected an error in local vars where led_column and led_row were reversed... void MPROC_NotifyReceivedEvnt(unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam { unsigned char led_column; unsigned char led_row; unsigned char evnt1Adj; unsigned char btnVal; // control the Duo-LEDs via Note On/Off Events // The colour is controlled with velocity value: // 0x00: both LEDs off // 0x01..0x3f: green LED on // 0x40..0x5f: red LED on // 0x60..0x7f: both LEDs on // only MIDI note numbers from 0x00..0x3f are valid (-> 64 LEDs) evnt1Adj = (evnt1 - BLM_MIDI_STARTNOTE) & 0x7f; if( (evnt0 == 0x80 || evnt0 == 0x90) && (evnt1Adj < 0x40 ) ) { // derive LED column and row from note number led_column = evnt1Adj & 0x07; #if BLM_DESCRAMBLE_ROWS //scramble the rows, NOTE: this method is not scalable blm_button_row_dscrmbl = evnt1Adj >> 3; led_row = blm_button_row_dscrmbl; led_row <<= 1; if(led_row & 0x08) { led_row &= 0x07; led_row++; } #else led_row = evnt1Adj >> 3; #endif // 90 xx 00 is the same like a note off event! // (-> http://www.borg.com/~jglatt/tech/midispec.htm) if( evnt0 == 0x80 || evnt2 == 0x00 ) { // Note Off or velocity == 0x00: clear both LEDs blm_row_green[led_row] &= MIOS_HLP_GetBitANDMask(led_column); blm_row_red[led_row] &= MIOS_HLP_GetBitANDMask(led_column); btnVal = 1; } else { btnVal = 0; if( evnt2 < 0x40 ) { // Velocity < 0x40: set green LED, clear red LED blm_row_green[led_row] |= MIOS_HLP_GetBitORMask(led_column); blm_row_red[led_row] &= MIOS_HLP_GetBitANDMask(led_column); } else if( evnt2 < 0x60 ) { // Velocity < 0x60: clear green LED, set red LED blm_row_green[led_row] &= MIOS_HLP_GetBitANDMask(led_column); blm_row_red[led_row] |= MIOS_HLP_GetBitORMask(led_column); } else { // Velocity >= 0x60: set both LEDs blm_row_green[led_row] |= MIOS_HLP_GetBitORMask(led_column); blm_row_red[led_row] |= MIOS_HLP_GetBitORMask(led_column); } } // enable this code (turn #if 0 into #if 1) if midi notes should change the LCD display // disable it when LCD should only be affected via buttons #if 1 blm_button_row = led_row; blm_button_column = led_column; blm_button_value = btnVal; // request display update app_flags.DISPLAY_UPDATE_REQ = 1; #endif } } here is the entire BLM_NotifyToggle() which contains the descramble code: void BLM_NotifyToggle(unsigned char pin, unsigned char value) __wparam { unsigned char mask; unsigned char noteNumber; #if BLM_DESCRAMBLE_ROWS //convert blm_button_row to blm_button_row_dscrmbl. NOTE: this method is not scalable blm_button_row_dscrmbl = blm_button_row >> 1; if( 0x01 & blm_button_row ) //if row is odd number blm_button_row_dscrmbl |= 0x04; // noteNumber = ((blm_button_row_dscrmbl << 3) + blm_button_column + BLM_MIDI_STARTNOTE) & 0x7f; #else noteNumber = (pin + BLM_MIDI_STARTNOTE) & 0x7f; #endif // send pin number and value as Note On Event MIOS_MIDI_TxBufferPut(0x90); MIOS_MIDI_TxBufferPut(noteNumber); MIOS_MIDI_TxBufferPut(value ? 0x00 : 0x7f); // enable this code (turn #if 0 into #if 1) if buttons should change the LED colour directly // disable it when LEDs should only be controlled via MIDI #if 1 // cycle colour whenever button has been pressed (value == 0) if( !value ) { mask = MIOS_HLP_GetBitORMask(blm_button_column); if ( blm_row_green[blm_button_row] & mask ) blm_row_red[blm_button_row] ^= mask; blm_row_green[blm_button_row] ^= mask; } #endif // request display update app_flags.DISPLAY_UPDATE_REQ = 1; } -
BWAHAHAHAHAHAAAAAH FOOLS! I WILL DESTROY THEM ALL!
-
4x16 (8x8) Button/Duo-LED programming example
bugfight replied to TK.'s topic in MIOS programming (C)
we can probably improve on that by using some math on the indexes, but works is better than perfect... i'll post what i come up with "soon" -
4x16 (8x8) Button/Duo-LED programming example
bugfight replied to TK.'s topic in MIOS programming (C)
do you only want the row numbers changed on the lcd? that's pretty simple. to get the pins and notes to map in that order is a little more involved, but not too bad. that is the way i think i will eventually go... -
SmashTV?? who is that?? *whack*
-
CLOSED: Black Re'an P401 Soft-touch knobs - 39 cents each
bugfight replied to nebula's topic in Bulk Orders
woohoo! got mine! they are "verah niiizeh" -
4x16 (8x8) Button/Duo-LED programming example
bugfight replied to TK.'s topic in MIOS programming (C)
yes -
A full-blown newb on the way to a POKEY synth
bugfight replied to nILS's topic in MIDIbox User Projects
you mean like "A full-blown tripleguru on the way to quadguru and no POKEY synth"? i don't know who would say such a thing... *whack* -
this is helium: http://www.strindbergandhelium.com/
-
CLOSED: Black Re'an P401 Soft-touch knobs - 39 cents each
bugfight replied to nebula's topic in Bulk Orders
woohoo! welcome back, neb -
sweeet
-
MIDIboxes in Sound & Recording magazine
bugfight replied to sneakthief's topic in MIDIbox User Projects
yummmm, that's in the queue... -
what type of messages are passed to MPROC_NotifyReceivedEvnt ?
bugfight replied to This N°9's topic in MIOS programming (C)
more specifically, you have to be careful about order of operations. even when the operator precedence is enough, it is good practice to use parenthesis to explicitly specify the order like this: if((byte >= 0x80) && (byte < 0xf0)) { if (15 == (byte & 0x0f)) { MIOS_MPROC_MergerDisable(); } else { MIOS_MPROC_MergerEnable(); } } -
MIDIboxes in Sound & Recording magazine
bugfight replied to sneakthief's topic in MIDIbox User Projects
auf cool -
very nice stuff thanks for posting
-
hehe i was joking a bit with the presumptuous wood entry, but since it's now real... woohoo!
-
no way! mine is coming right up... i think you should do this as well. and anyone who already ordered should be clicking that paypal dev button above right now...
-
wow, that's a lot of figs. nobody, and i mean nobody, can eat 890 newtons...