Jump to content

instead of pot value 0-127, value text


.mag
 Share

Recommended Posts

hi  ;D

midibox 64 lcd menu display normaly prints the pot name and the value 0-127. so far this works.

now i want to chance the number value to a text value, for example:

when i move pot #6 (midi cc#118)

for value 0-10 the display should print ES1, for value 11-22 the display should print ES2,

for value 11-22 the display should print EXS, for value 23-34 the display should print EVOC,  and so on..

where do i have to define this values, in mb64_lcd.inc ?

thanx for any help, its better to spend hours behind mios than watching tv for hours  ;)

Link to comment
Share on other sites

hi

Firstly please try with some paper on glue closer to knob with :

0-10 ES1

11-22 ES2...

and check it , try , play with it.

If you will see that this is not enough and you must to have this on LCD

then you can include a code who cathing your pot

(probubly in USER_AIN_notify...) and run your part who print texts depend from value.

Link to comment
Share on other sites

hi qbas

i already made a text display in logic environment and played with it over 2years,

no i think its time to integrate it into my midi-box, just for feeling good  ;)

first of all it would be alright to get the text values for all pots, i tried it in mb64_lcd.inc,

but it seems to be the wrong place, i'm searching the code which defines the numerical values.

any idea?

Link to comment
Share on other sites

i just need for pot number 6 text values. i used a 12-way rotary pot, every single way is 10k

any idea where to to manage the value tables?

yes, i'm happy with my controller, use it for logic pro 7.1 and for live vj'ing.

if anyone wants .dwg files of the case, pm me......... 8)

Link to comment
Share on other sites

no hurry, thanx anyway

if just someone could tell me how to define the value ???

its maybe in

mb64_lcd

MB64_LCD_PrintValue

andlw 0x03

JUMPTABLE_2BYTES 4

rgoto MB64_LCD_PrintValue_Hex

rgoto MB64_LCD_PrintValue_PmHex

rgoto MB64_LCD_PrintValue_Dec

rgoto MB64_LCD_PrintValue_PmDec

;; print hex value 0x00..0x7f

MB64_LCD_PrintValue_Hex

movlw ' ' ; fill with space

call MIOS_LCD_PrintChar

movf INDF0, W

andlw 0x7f

goto MIOS_LCD_PrintHex2

hope to find a solution....

mios rocks!

Link to comment
Share on other sites

Hello Thorsten Klose.

Before we will try changing something can we ask you what is the best direction for achieve in MB64 this:

chance the number value to a text value, for example:

when i move pot #6 (midi cc#118)

for value 0-10 the display should print ES1, for value 11-22 the display should print ES2,

for value 11-22 the display should print EXS, for value 23-34 the display should print EVOC,  and so on..

Thank you

Link to comment
Share on other sites

  • 2 weeks later...

OK, I'm not TK, but I'll take a shot at this.

This may not be the best way, but it will work.

So I'm guessing you have about twelve choices.

The first step is to convert your 0-127 input into 0-11 for your twelve choices.

We take your original value and divide by about 10.66. Since division is

not easy, we'll multiply by 24, then divide by 256.(both easy to do)

movf  yourvalue,W   ;get your starting value

mullw d'24'

movf  PRODH,W    ;now you have 0-11 in W

call channame    ;selects the right name

call MIOS_LCD_PrintString ;and prints it

Next up is to choose your label. I'm SURE there are better ways, but

this works for me.

;this will select the proper name for a given channel (in W)

channame

movwf NameScan ;store our channel target

TABLE_ADDR TEXT_CHAN_0 ;point to first name

movf  NameScan,F

btfsc STATUS,Z ;if the channel number is Zero,

return

TABLE_ADDR TEXT_CHAN_1 ;point to second name

dcfsnz ChanScan ;decrement the channel number. If the result is zero,

return

TABLE_ADDR TEXT_CHAN_2 ;point to the third name

dcfsnz ChanScan ;dec the channel number. If the result is zero,

return

TABLE_ADDR TEXT_CHAN_3 ;point to the fourth name

dcfsnz ChanScan ;dec the channel number. If the result is Zero,

return

TABLE_ADDR TEXT_CHAN_4

dcfsnz ChanScan ;repeat until a name is found

return

TABLE_ADDR TEXT_CHAN_5

dcfsnz ChanScan

return

TABLE_ADDR TEXT_CHAN_6

dcfsnz ChanScan

return

TABLE_ADDR TEXT_CHAN_7

dcfsnz ChanScan

return

TABLE_ADDR TEXT_CHAN_8

dcfsnz ChanScan

return

TABLE_ADDR TEXT_CHAN_9

dcfsnz ChanScan

return

TABLE_ADDR TEXT_CHAN_10

dcfsnz ChanScan

return

TABLE_ADDR TEXT_CHAN_11

return

Finally, define the names with the string macro

;Name your channels here

;remember to change the number to the length of the new name

;the 0x04 tells where to put the text on the display

TEXT_CHAN_0 STRING 8,0x04,"Whatever"

TEXT_CHAN_1 STRING 3,0x04,"XVQ"

TEXT_CHAN_2 STRING 3,0x04,"FU2"

TEXT_CHAN_3 STRING 9,0x04,"Channel 4"

TEXT_CHAN_4 STRING 9,0x04,"Channel 5"

TEXT_CHAN_5 STRING 9,0x04,"Channel 6"

TEXT_CHAN_6 STRING 9,0x04,"Channel 7"

TEXT_CHAN_7 STRING 9,0x04,"Channel 8"

TEXT_CHAN_8 STRING 9,0x04,"Channel 9"

TEXT_CHAN_9 STRING 10,0x04,"Channel 10"

TEXT_CHAN_10 STRING 10,0x04,"Channel 11"

TEXT_CHAN_11 STRING 10,0x04,"Channel 12"

Hope that helps,

LyleHaze

[edit] cleaned up the code just a little bit

Link to comment
Share on other sites

Gee, I don't know.

I've been so busy with my own code, I've not yet had a chance to look at the MB64 code.

The OP said it was already displaying a value, so maybe

find that display code and replace it with a call to the above?

I would _hope_ that the original poster was seeking to learn a technique, instead of just finding someone to do it for him... But I don't know. :-)

In any case, the code will work, but It's most definetly not the best way to do this. Maybe someone will volunteer a better way.

Good Luck,

LyleHaze

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