venkecske Posted December 27, 2007 Report Share Posted December 27, 2007 Hello All Midiboxers, and T.K. !I was built my little MB with 5 pots and 2x4+16 buttons (no AIN modul, pots on the direct input, other 3 are on Gnd) and one DINx3 and a DOUTx3 with 16 leds. My goal to control my Yamaha PSR3000 (Like Tyros1) some functions quickly, not from instrument's menu.These like : mic. volume, midi ch.1-2 volume,effect depth, cutoff/reso of upper1-2 tone,vocal harmony balance; to switch toggle on/off microphone effect, mic.vocoder on/off, vocoder type, and so on...First I was reassembled midibox64V2_4 main1.asm to mainMy.asm, then translated to 5pot_24but.hex.That was I uploaded to PIC, and I'ts works, but I have some questions :How can I tell to buttons my special meta events in edit mode on the box? I can edit only last 3 byte . My instument parameters which I must send for example : F0 43 10 4C 03 00 0C 7F F7 F0 43 10 4C 03 00 0C 01 F7 in toggle mode.But when I receive with MIDI-OX the button-command send always F0 43 10 5C 10 10 31 76 F7 / F0 43 10 5C 10 10 31 00 F7, and only the last byte can I change in edit mode.Where can I say to the box the correct values, and how?Or I must use vmidibox to configure , and send sysex -editor dump? Must I mark the "learn" checkbox, if I want to learn that button or pot later?Other question : If I turn the pots, the 5 pot's have different functions, it's ok. But one pot movement send to the all 8 midi chanel volume, pan ,or others. How can I tell to a pot, if only to one midi chanel must send data?I apologize my bad English, and for much questions. I hope are you understand my problem.Thank you for help in advanced from Hungary : Pisti (venkecske)<a target="_blank" href="http://kepfeltolto.hu/i/?8156"><img border=0 width=100 src="http://kepfeltolto.hu/i/?8156&t=thb" /></a>(If you think, I can sent the mainMy.asm file to control my config.) Quote Link to comment Share on other sites More sharing options...
TK. Posted December 28, 2007 Report Share Posted December 28, 2007 Hi,fixing the pots is easy: since no AIN multiplexers are connected, you need to set DEFAULT_MUX_ENABLED to 0, otherwise a single pot will send the events of 8 AIN channels.Meta events: it isn't possible to use the learn function for this, instead it is required to adapt the mb64_meta.inc file for your needs. The described SysEx string can be found under the META_Send_AN1x_SysEx label, just modify this one, and the MB64_META_Handler_00/01/02/.. handlers in addition (the comments should say it all).As you were able to send a single meta event, just configure the other ones like you did for the first one. Meta events can be assigned to pots/buttons with vmidibox64 (more comfortable), or the mk_syx script (more flexible)Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
venkecske Posted December 31, 2007 Author Report Share Posted December 31, 2007 Thank You Thorsten !My first problem after all soluted... The pots work all single.... but it was 3 days to me ... There are so much possibility to assemble these asm, inc, hex, ini .... My head now a chaosss :-) But I find the mpasmwin, it's worked to my asm file , and I was uploded to core . Perfect !My next question : wich program I must use to reassemble, and to get my hex file after I edited the mb64_meta.inc ? MPLAB Ide 8.0 is ok ? And save to asm, or export to hex ? My first experiment with main.inc (or ini ? :s) was error, when I was exported hex file (When I was uploded with mios studio, It was a wrong adress message).Thank you for your patience and for help, I hope must not too much disturb with my beginner questions...I wish You and for all Midibox builder Happy New Year, and lot of fine music ;-)It's the World most professional project ! Bye : Pisti Quote Link to comment Share on other sites More sharing options...
TK. Posted December 31, 2007 Report Share Posted December 31, 2007 After MPLAB has been installed, you will find the "MPASMWIN" application in the installation tree which allows you to build a .hex file without using the IDE. So, just edit the files of the midibox release package with your favourite text editor (don't rename the files), and assemble the code like described here: http://www.ucapps.de/howto_tools_mpasm.html. For MIDIbox64 it means: assemble main.asm - it's always this toplevel file, it includes all the .inc files.Thereafter upload the new main.hex file with MIOS Studio.The .ini file (probably you mean the one of the mk_syx package) is part of the bank configuration. It can be changed and converted to a .syx, thereafter uploaded to the MIDIbox64 during runtime. However, this is part of the "configuration layer" - the firmware has to run for beeing able to receive this configuration data.Best Regards, Thorsten.P.S.: ah yes - happy new year! :) Quote Link to comment Share on other sites More sharing options...
venkecske Posted January 5, 2008 Author Report Share Posted January 5, 2008 Good Luck !Thank you, the Mpasmwin works, I was uploded my changed main.hex. I think I was understand the asm and inc files relation.But sorry, I'm locked again ... Please help if You have a little time !If I edit mb64_meta.inc :MB64_META_Handler_00 ;; this example sends a SysEx string: F0 43 10 5C 10 10 31 vv F7 (PSR3K Mic.Reverb) ;; META Event: "F0 00" (pot) or "F0 00 7F @OnOff" (Button - 7F may vary) movlw 0x12 ; store parameter value in W rgoto META_Send_AN1x_SysEx ; branch to SysEx routine;; --------------------------------------------------------------------------MB64_META_Handler_01 ;; this example sends a SysEx string: F0 43 10 5C 10 10 33 vv F7 (PSR3K Mic.Volume) ;; META Event: "F0 01" (pot) or "F0 01 7F @OnOff" (Button - 7F may vary) movlw 0x0B ; store parameter value in W rgoto META_Send_AN1x_SysEx ; branch to SysEx routine META Event "F0 00" .... does it mean this is the first pot and "F0 01" the second pot (and button) ? And what the relation , when I go to the vmidibox, and open the pot window : Whitch parameter set the Meta ID, and whitch the Meta Event Nr. (this last I think related to MB64META_Handler_00-07 in the example) ? Ok, I was changed The META_sendAN1x_SysEx soubroutine to my needs : ; This is a subroutine which sends a SysEx stream for AN1x synthesizer ;; IN: parameter address in working register WREG ;; pot/button value in MIDI_SENDMETA_Send_AN1x_SysEx movwf TMP1 ; temporary store parameter value from working register W into TMP1 call MIOS_MIDI_BeginStream ; begin stream movlw 0xf0 ; send 0xf0 call MIOS_MIDI_TxBufferPut movlw 0x43 ; send 0x43 call MIOS_MIDI_TxBufferPut movlw 0x10 ; send 0x10 call MIOS_MIDI_TxBufferPut movlw 0x4c ; send 0x4c changed to my Instrument (PSR 3000) call MIOS_MIDI_TxBufferPut movlw 0x10 ; send 0x10 call MIOS_MIDI_TxBufferPut movlw 0x00 ; send 0x00 because my sysexes for example : 43 10 4C 10 00 00 00 F7 AUDIO 1 INPUT GAIN FOR MIC43 10 4C 10 00 0B 46 F7 AUDIO 1 VOLUME = 7043 10 4C 10 00 12 20 F7 AUDIO 1 REVERB SEND = 32The 00 ; 0B and 12 are the "W" parameters in the META_Heandler_00 ; _01... and so on ? Correct?And next question : I want not only 9 byte long, but 10 long sysex, like :43 10 4C 04 00 00 59 57 F7 VOCODER USING "MEN CHOIR"So I must make an other soubroutine with new name ? Ok, and in addition where I must into write the new name? , in main.inc too ? Or if I want change AN1x to PSR3K ?And last : what is the relationship between these parameters, and the midibox64 Editor's pot window "Meta ID" (F0-FF) ? Can I set up second, third... settings in the MeataHaendler_00-01-02...... If I change F0 01 (pot) to F1 01 , it will be the second Meta ID?Do you think, can I solute this myself ? Too much questions :(((Please patient , and thank you in advanced, Thorsten (or anybody else)regards : venkecske Quote Link to comment Share on other sites More sharing options...
TK. Posted January 5, 2008 Report Share Posted January 5, 2008 I will give you a general answer in the hope that it helps to improve the understanding, how Meta events are working.Whenever you define an event which starts with F (F0, F1, F2, ... FF) - regardless if you are using mk_syx or vmidibox, the button and pot movement will cause the MB64_META_Handler for beeing called.This handler gets following parameters:;; on pot events (entry point: MB64_META_Handler_Pot):;; o Pot number in MB64_CURRENT_POT (BANKED access required!);; o first MIDI byte in MIDI_EVNT0 (no BANKED access required);; o second MIDI byte in MIDI_EVNT1 (no BANKED access required);; o pot value in MIDI_EVNT_VALUE (no BANKED access required);;;; on button events (entry point: MB64_META_Handler_Button):;; o Pot number in MB64_CURRENT_BUTTON (BANKED access required!);; o first MIDI byte in MIDI_EVNT0 (no BANKED access required);; o second MIDI byte in MIDI_EVNT1 (no BANKED access required);; o button value in MIDI_EVNT_VALUE (no BANKED access required)[/code] MIDI_EVNT0 and MIDI_EVNT1 are the values which have been defined in vmidibox/mk_syx MIDI_EVNT_VALUE is the variable pot value, or the button state (depressed: 0, pressed: third byte of button event) So, now you can do with these values whatever you want :) For example, if it is sufficient to differ a single byte within the SysEx string, just add the sending routine directly below "MB64_META_Handler_Pot", and replace a "movlw 0x.." by "movf MIDI_EVNT1, W" at the position which requires a variable value. Now you can control this "placeholder" value from your your mk_syx/vmidibox setup It's very similar for the pot value - replace a "movlw 0x.." by "movf MIDI_EVNT_VALUE, W" to send it. Differing between different strings (e.g. 9 and 10 byte string): you could select it with the rightmost digit of MIDI_EVNT0, so that "F0" sends a 9-byte string, and "F1" a 10-byte string. Example for a simple two-way branch: [code]MB64_META_Handler movf MIDI_EVNT0, W xorlw 0xf1 ; F1 received? bz MB64_META_Handler_F1MB64_META_Handler_F0 ;; send 9 bytes... call MIOS_MIDI_BeginStream ; begin stream movlw 0xf0 ; send 0xf0 call MIOS_MIDI_TxBufferPut movlw 0x43 ; send 0x43 call MIOS_MIDI_TxBufferPut movlw 0x10 ; send 0x10 call MIOS_MIDI_TxBufferPut movlw 0x4c ; send 0x4c changed to my Instrument (PSR 3000) call MIOS_MIDI_TxBufferPut movlw 0x10 ; send 0x10 call MIOS_MIDI_TxBufferPut movlw 0x00 ; send 0x00 movf MIDI_EVNT1, W ; send 2nd byte of pot event call MIOS_MIDI_TxBufferPut movf MIDI_EVNT_VALUE, W ; send pot/button value call MIOS_MIDI_TxBufferPut call MIOS_MIDI_EndStream ; end stream ;; ...and exit returnMB64_META_Handler_F1 ;; send 10 bytes... ;; ... ;; ...and exit returnBtw.: remove the jumptable stuff below the handler label, I guess that it only confuses you.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.