Jump to content

saving patches to a bankstick without control surface


Recommended Posts

Posted

Hi there,

I built a very minimal Midibox FM (box with midi+audio sockets and psu) a while ago, but I didn't build a control surface and I've been having some trouble with the JSynthLib editor (see http://www.midibox.org/forum/index.php?&topic=11662).

Ever since I laid eyes on the MidiboxFM project and saw that each register on the OPL was mapped to a midi CC for realtime parameter tweaking, I've been wondering if I could hook the MBFM directly to my Edirol/Roland PCR 500 to control a few key parameters for on-the-spot patch generation without a computer.

Only one problem: After tweaking a patch by sending various CC messages, I can't save it into the bank stick. I've looked at the documentation and I can't immediately find an answer for this problem. The sysex implementation textfile only mentions dumping an entire patch explicitly, i.e all parameters in one sysex blob.

Is there a sysex command that will tell the MBFM to "save the current parameters to a bankstick", without having to keep a copy of every parameter and then send a complete sysex patch dump?

I wonder if this isn't implemented because of the way the MBFM MIOS program is programming the OPL. If the OPL registers are "write only" and MIOS isn't keeping track of all the parameters, then there's no way to collect all the information for a patch back up into a bank stick.

If this is the case however, how does a full MBFM with control surface save the current parameters to a bankstick? Perhaps only parameters edited with the control surface get stored by the MBFM MIOS program?

I wonder if I built a control surface, could I still tweak the parameters by CC then save the patch to bankstick?

Any help greatly appreciated,

Thanks!

Posted

Hi,

all OPL3 registers + MBFM sound engine parameters are stored in RAM, they can be transfered into a BankStick by calling the MBFM_BANK_StoreP function, which is located in src/mbfm_bank.inc


;; --------------------------------------------------------------------------
;;  Stores a patch from RAM in EEPROM or BankStick
;;  IN: Instrument Number in MBFM_CURRENT_INSTRUMENT
;;      Patch Number in MBFM_PATCH
;;      Bank Number in MBFM_BANK
;; --------------------------------------------------------------------------
MBFM_BANK_StoreP
[/code]

How would you like to trigger this function?

- via a button directly connected to the PIC

- via a button connected to a DIN pin

- via a MIDI event

- via SysEx

Currently, this only works via the control surface function (you have to go into the Save menu).

Usually I prefer this laborious approach, as it prevents unintended store operations on HW issues (e.g. no DIN connected and somebody forgot to mount MBHP_CORE:R9, or random CCs are received from an external MIDI device...)

But so long you know what you are doing, and provided that your HW runs stable, nothing prevents you from adding a dedicated possibility to trigger the store function. Only question: how do you want to control the bank and patch number, how do you want to differ between the instruments, and how do you want to store drum and ensemble parameters (MBFM_BANK_StoreD and StoreE)?

Best Regards, Thorsten.

Posted

Thanks for the super-quick reply TK, much appreciated!

all OPL3 registers are stored in RAM, and can be transfered into a BankStick by calling MBFM_BANK_StoreP

That's perfect! ;o)

How would you like to trigger this function?

- via a button directly connected to the PIC

- via a button connected to a DIN pin

- via a MIDI event

- via SysEx

I don't have a DIN board made, so I think a combination of "a MIDI event" and/or "SysEx" would be a good place to start, maybe I'll build a DIN board with "patch up/down" and "overwrite" buttons later tho.

I remember from my limited experience in programming TexasInstruments DSP chips that triggering via an interrupt (i.e a pin directly on the PIC) ought to be simple in PIC assembly, but I'm not sure how to trigger it via MIDI or SysEx events.

how do you want to control the bank and patch number?, how do you want to store drum and ensemble parameters (MBFM_BANK_StoreD and StoreE)?

I don't think I'll need to store drum or ensemble parameters, maybe later tho.

My idea is to slowly modify existing patches beyond recognition so it'd be perfect to overwrite the current patch (i.e the last recalled patch via ProgramChange). I can always restore the original patches by dumping SysEx back into the MBFM when I'm back at the computer.

I only have one bank stick so it's tempting to hard code the bank to be "0" but if I add more banks I think it'd be perfect to overwrite the patch in whichever bank was last accessed.

how do you want to differ between the instruments?

Do you mean how to name them, like in the first few bytes after the patch/bank of the SysEx dump?

Probably best to keep the same name for now, although maybe I'll replace the last character byte of the name with a "*" or something? Not sure how I'd do this with PIC assembly tho!

----

At the moment, I'm just reading the .inc files in my favourite text editor, but I'm not sure how to turn them into PIC code. I've discovered http://www.midibox.org/dokuwiki/doku.php?id=windows_toolchain_core but it looks like things could get quite convoluted in order to modify a few lines of code!

Maybe I ought to save up some of my other wishes before I make tweaks. (like custom drumkit maps which detect note numbers and load in percussive patches from banks before actually triggering the notes) ;o)

Thanks again for helping sir - very much appreciated,

Posted

you can have up to 8 switches connected directly to your core zenpho, so if you wanted a patch store button and some other functions (patch up down, or a rotary encoder for this, and maybe an audition button to sound a note on the current patch)

to get round the accidental write problem i recommend an airwolf/fighter jet style switch with flip up cover mounted in the centre of your instrument panel, with hazard warning lights and that

Posted

Could you please try if this quick hack is working at your side:

http://www.ucapps.de/tmp/midibox_fm_v1_1d_rc1.zip

I added a new SysEx command, but have no time to test it completely (e.g. check if storing instrument 2..4, drumsets/ensembles is working)

from the documentation:


   d) F0 00 00 7E 49 <device> 0A <type> F7

      Stores back the current patch into EEPROM/BankStick
      Can be used if no Control Surface is available - parameters can be changed
      via CC or SysEx

         <device>: device number 00-7F
         <type>:   00: Stores patch of Voice #1
                   01: Stores patch of Voice #2
                   02: Stores patch of Voice #3
                   03: Stores patch of Voice #4
                   10: Stores drumset
                   70: Stores ensemble setup
[/code]

Best Regards, Thorsten.

Posted

Awesome! I was expecting that you'd just point me at the places in the code that I should begin modifying, and leave me to chugg away. ;o) Thanks so much for this sir. I'll give it a try in a moment and let you know how I get on. Its very groovy of you to make an addition on request.

Airmailed: you can have up to 8 switches connected directly to your core - i recommend an airwolf/fighter jet style switch with flip up cover with hazard warning lights and that

hehe, classic! like this? http://www.cnet.co.uk/i/c/blg/cat/blog/off_switches/2.jpg

Posted

Well I had a go at quickly testing this last night, tried voices 1-4, and ensembles too. Everything seemed to work without a hitch. I forgot to test the drums tho, but I'll get on that and let you know if there are any problems.

I like how you've made the sysex command have separate sub-commands to address each voice.

It's also neat how the Request/Write Dump and Direct Parameter Write commands also work with these numbers. I was imagining a more general "store the current patch on this channel" message, but I think this is more flexible.

It was certainly good foresight to keep the ensemble references way up in the 70 and 78 range and the drums in the 10 and 18 range. Good thinking!

I am still very interested in setting up a build environment such that I can make modifications to the MBFM code to get those drum maps - perhaps I'll post another thread on this when I get started. I'll no doubt be needing some guidance. ;o)

Thanks for this mod again TK, it's much appreciated.

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...
×
×
  • Create New...