Hello, my first Bome script.. ie. how to Bome properly?

tsutek

2016-06-19 20:54:25

Hi,

First of all, let me say I'm really excited about joining the Bome club!

Been reading this board a bit, but getting around to catching up soon.

Just wanted to ask some opinion about my first bome script. First it's probably good to explain my intentions with the script.

I have a MPD218 pad controller that is triggering notes of a drum machine. I want to reserve the first four pads to special functions, while the 12 pads underneath are sending midi notes to trigger the drum sounds / synth notes.

So I have mapped the first 4 pads to transmit midi notes 124, 125, 126, 127 on channel 16
The remaining pads are triggering notes chromatically from notes 000-011 on channel 01

Now the script itself has two translators. First one handles program change increment, and the second one handles program change decrement. Here is the code:

Code: Select all

Project: MPD218-AR-CTRL002
_____________________________________________________________
[x] Preset 0: MPD218-AR-CTRL001

[x] Translator 0.0: MPD218-PRGC-INC
Incoming: Takes Note #127 from ch16 of MPD218 and converts to pgm chng (+) - if pgm chng = 127, action is ignored, on port MPD218 Port A
Rules:
  if gp==127 then exit rules, skip Outgoing Action
  gp=gp+1
Outgoing: Program Change on channel 1 with program:gp, to port Bome MIDI Translator 1 Virtual Out

[x] Translator 0.1: MPD218-PRGC-DEC
Incoming: Takes Note #126 from ch16 of MPD218 and converts to pgm chng (-) - if pgm chng = 0, action is ignored, on port MPD218 Port A
Rules:
  if gp==0 then exit rules, skip Outgoing Action
  gp=gp-1
Outgoing: Program Change on channel 1 with program:gp, to port Bome MIDI Translator 1 Virtual Out
Does it look like I am doing everything correctly? I am asking because it's my first script and I am not 100% sure the script works flawlessly.. Like, is it safe to use a global variable for translating data like this? Should I copy the value of gp to a local, say, "pp" before going out from a translation? Also, what about note offs (velo 0), will they cause the translations to run twice or unpredicatbly?

Cheers

tsutek

2016-06-22 10:09:01

BUMP

anyone? I'd appreciate any feedback

tsutek

2016-06-24 11:54:07

Oh fudge, seems like I am doing this totally wrong! Just checked the midi logs, redundant ugly data spilling from every orifice! I need to add some cleanup it seems..

tsutek

2016-06-24 14:32:15

Yes, after adding cleanup translations I get clean translated MIDI!

Still I don't know how to drop the redundant prog changes of 0 and 127 from the prog change boundaries while still "swallowing midi", but this is good enough for now.

DvlsAdvct

2016-07-18 01:14:09

Hi tsutek

Sorry for the delay, I'm back in the land of the living again. I can now answer questions. Your code looks fine.

Are you getting the top and bottom (127 and 0 respectively) program change messages sending when you don't want them to?

Jared

tsutek

2016-07-18 08:25:10

Hi,

thanks for getting back to this!

Yes I am getting redundant pgm chng 0 & 127 values, any ideas how to prevent those from getting sent by the script?

DvlsAdvct

2016-07-18 15:31:54

Alright, can we make some small changes to the rules, using labels, to try and isolate the problem?

In your rules section for note 127, change it to:

Code: Select all

if gp>=127 then Goto "Skip"
gp=gp+1
Exit rules, execute outgoing action
Label "Skip"
Exit rules, skip outgoing action
And for note 126

Code: Select all

if gp<=0 then Goto "Skip"
gp=gp-1
Exit rules, execute outgoing action
Label "Skip"
Exit rules, skip outgoing action
Let me know if that works
Jared