# Cross-Reference List of all Variables in a MT Pro Project

**URL:** <https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886>\
**Category:** Bome Products\
**Created:** [February 5, 2018, 2:52pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886 "2018-02-05T14:52:08Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlorianBome](https://forum.bome.com/user_avatar/forum.bome.com/florianbome/32/2367_2.png) [@FlorianBome](https://forum.bome.com/u/FlorianBome)\
**Post date:** [February 5, 2018, 2:52pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/1 "2018-02-05T14:52:08Z")

</div>

A user of MIDI Translator Pro created a small utility to create a cross reference of all used variables in a MIDI Translator Pro project. It outputs two lists: 1) by variable in which translators the variable is used, and 2) by translator, which variables are used in a given translator.

Such functionality is planned for a future version of MIDI Translator Pro, but for now this utility might be useful for you.

**Usage:** 1) open the project file in MIDI Translator Pro 2) Use File|Export Project As Text to save the file as a text file 3) run the attached .exe file (a command line window appears) 4) from an explorer window, drag the exported .txt file to the command line. Press the BACKSPACE key 4 times to remove the .txt file extension, then ENTER 5) the program creates a file with appended name "-Liste Variables.txt" which contains the cross-reference

Note: the program is French, but it should be easy to use it with the instructions above.

Example output:

```
C:\Novation_Launchpad_Pong.txt
--------------------------------------
## ORDRE ALPHABETIQUE DES VARIABLES

Variable - Translator  
i0 000.000  
i0 002.008  
i0 002.009  
i1 000.000  
i1 002.008  
i1 002.009  
i2 000.000  
i2 002.008  
i2 002.009  
i3 000.000  
i3 002.008  
(…)  
Nombre variables : 90

## ORDRE DES TRANSLATORS

Translator - Variable  
000.000 i0  
000.000 i1  
000.000 i2  
000.000 i3  
000.000 kc  
000.000 ks  
000.000 kt  
000.000 lx  
000.000 ly  
001.018 pp  
002.000 kg  
002.001 kx  
002.001 ky  
002.001 lx  
002.001 ly  
002.003 kg  
002.006 kr  
002.007 ks  
(…)
```

Note that the program is not foolproof and provided to you without warranty of any kind. Bome Software has not created this program and merely makes it available as a courtesy.

  
**Attachments:**  
[**1517838718387\_mtpro\_varlist\_v6.exe**](https://www.bome.com/wp-content/uploads/cma_attachments/1517838718387_mtpro_varlist_v6.exe)

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [February 5, 2018, 4:22pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/2 "2018-02-05T16:22:48Z")

</div>

Nice,

I might try this sometime if I get a large file from someone else that is not well documented. Usually I don’t need to do this for my project files as I document all of my variables. I usually document all global variable in a preset I call “Init” with translator “Init Global Variables”. For local variables I document them within each translator. In addition to initializing them I put in comments prior to the initialization, what each is for: example

//fader 1 target  
g1=0  
// fader 1 current postion  
ga=0  
// fader 1 timer running statuts  
ha=0  
// precision  
ia=3

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [February 6, 2018, 7:58pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/3 "2018-02-06T19:58:39Z")

</div>

I created a quick and dirty awk script that does something similar. Right now it seems to handles rules section pretty well but I have yet to figure out how to implement input and output.

I invoke it with the following \*nix command

awk -f scriptfilename inputfilename | sort | uniq

Here is the script. Anyone, feel free to improve on it and re-publish/share.

Steve

[bome@sniz.biz](mailto:bome@sniz.biz)

Independent Bome Programming Specialist

Bome Q&A moderator

————–

&nbsp;

BEGIN {IGNORECASE }  
match($0, /([x].\*)(Translator.\*)/,a) {tr++; name[tr]=a[2] ;}  
# I don’t think I need the below unless I want to print it  
#/.\*//.\*/ {print}  
match($0,/(.\*)([g-z][a-z0-9])([=\<\>])/, a) {var=a[2]; var2[var,tr]++ }  
#;printf(“%s:%s:%sn”,name[tr],var, var2[var,tr]) }  
match($0,/([=\<\>])([g-z][a-z0-9])(.\*)/,a) {var=a[2]; var2[var,tr]++ }  
match($0,/(==)([g-z][a-z0-9])(.\*)/,a) {var=a[2]; var2[var,tr]++ }  
match($0,/(.\*)([g-z][a-z0-9])(==)/, a) {var=a[2]; var2[var,tr]++ }  
match($0,/(!=)([g-z][a-z0-9])(.\*)/,a) {var=a[2]; var2[var,tr]++ }  
match($0,/(.\*)([g-z][a-z0-9])(!=)/, a) {var=a[2]; var2[var,tr]++ }  
match($0,/(.\*then.\*)([g-z][a-z0-9])(=)/, a) {var=a[2]; var2[var,tr]++ }  
match($0,/(.\*then.\*)(=)([g-z][a-z0-9])/,a) {var=a[3]; var2[var,tr]++ }  
# The below matches input and output but still needs work. Commenting out for now  
# First  
#match($0,/(^Incoming[^’]\*)(‘)([g-z][a-z0-9])(‘)/,a) {var=a[3]; var2[var,tr]++ }  
# Need to figure out if any others might need to iterate over the string  
# Last  
#match($0,/(^Incoming.\*)(‘)([g-z][a-z0-9])(‘)/,a) {var=a[3]; var2[var,tr]++ }  
# First  
#match($0,/(^Outgoing: MIDI[^s]\*)(s)([g-z][a-z0-9])(s)/,a) {var=a[3]; var2[var,tr]++ }  
# Last  
#match($0,/(^Outgoing: MIDI.\*)(s)([g-z][a-z0-9])(s)/,a) {var=a[3]; var2[var,tr]++ }  
END {  
for (y in var2)  
{  
z = substr(y,3,length(y))  
b = substr(y,4)  
#print b,  
print name[b], substr(y,1,2)  
}  
#for (x=1; x\<=tr ; x++)  
#print x ,” “name[x]  
#print tr ” Total Translators”  
}

&nbsp;

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [February 11, 2018, 5:46pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/4 "2018-02-11T17:46:46Z")

</div>

I just updated my awk file that captures all global variables (hopefully I covered all cases)

It is attached below

# bmt.awk  
# Document all Global Variables in a Bome BMT Project File  
# By Steven J. Caldwell 11-Feb-2018  
# please send any corrections to the author  
# [bome@sniz.biz](mailto:bome@sniz.biz)  
# Steps  
# 1) Eport your project into a text file  
# 2) Run the following command  
# $awk -f bmt.awk filename | sort -t: -k 1 -n | uniq \> outputfile  
# Caputures global variables only and saves to the output file  
# Format of output file will look like this  
# …data excluded above  
# 26.3: Bank Select LSB – gb  
# 26.3: Bank Select LSB – gd  
# 26.3: Bank Select LSB – gf  
# 26.3: Bank Select LSB – ha  
# 26.3: Bank Select LSB – hb  
# 26.3: Bank Select LSB – hc  
# 314 Total Translators

&nbsp;

&nbsp;

  
**Attachments:**  
[**1518367603336\_bmt.awk**](https://www.bome.com/wp-content/uploads/cma_attachments/1518367603336_bmt.awk)

---

<div class="post-metadata">

**Author:** ![pedro.estrela](https://forum.bome.com/letter_avatar_proxy/v4/letter/p/87869e/32.png) [@pedro.estrela](https://forum.bome.com/u/pedro.estrela)\
**Post date:** [January 30, 2020, 12:14am UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/5 "2020-01-30T00:14:17Z")

</div>

this AWK script is really useful. A minor improvement is that it ignores local variables

* * *

&nbsp;

This is a small wrapper around it that automates the grepping and post-formatting, and adds an outgoing timers (useful to show the code flow):  
https://github.com/pestrela/music\_scripts/blob/master/traktor/tools\_traktor/bome\_analyse\_project.sh

&nbsp;

This python tool shows the **unused** variables that are still free to use:

> <https://github.com/pestrela/music/blob/master/traktor/tools_traktor/bome_find_unused_vars.py>

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [January 30, 2020, 12:22am UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/6 "2020-01-30T00:22:41Z")

</div>

Hi, feel free to reach out to me via email whenever. I've made several revisions since I posted this almost a year ago. It keeps getting better.

Steve Caldwell  
Bome Q and A Moderator and  
Independent Bome Consultant/Specialist  
bome@sniz.biz

---

<div class="post-metadata">

**Author:** ![nilskastner](https://forum.bome.com/letter_avatar_proxy/v4/letter/n/b77776/32.png) [@nilskastner](https://forum.bome.com/u/nilskastner)\
**Post date:** [February 24, 2020, 5:42pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/7 "2020-02-24T17:42:04Z")

</div>

Did you ever think about clear names for variables? Should not to hard to implement and would be really helpful if you could see

"ga - shift toggle"

"gb - option toggle"

"gc - whatever"

and so on in the dropdown. You would know which variables are already in use and what they mean instantly instead of strange stuff like documentation at some other place.

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [February 24, 2020, 6:46pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/8 "2020-02-24T18:46:03Z")

</div>

Yes that is on the “wish list”

Steve Caldwell  
Bome Q and A Moderator and  
Independent Bome Consultant/Specialist  
bome@sniz.biz

---

<div class="post-metadata">

**Author:** ![pedro.estrela](https://forum.bome.com/letter_avatar_proxy/v4/letter/p/87869e/32.png) [@pedro.estrela](https://forum.bome.com/u/pedro.estrela)\
**Post date:** [October 4, 2020, 7:11pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/9 "2020-10-04T19:11:50Z")

</div>

I’ve added this post to the advanced mappings index:

> [@Index of ADVANCED posts and tools](https://forum.bome.com/t/index-of-advanced-posts-and-tools/1782):
>
> Do you have a VERY large mapping? Do you push the limits of Bome MIDI Translator Pro? then read on. This post is an index to useful posts/tools/info applicable to very large mappings. Contributions are welcome. Just comment below, and I will keep the post updated. Internals explanation: Be sure to check chapter 12 of the [user's manual](https://www.bome.com/products/miditranslator/support/manual): "behind the scenes" Exact order of operations: [https://www.bome.com/support/kb/order-of-operat…](https://www.bome.com/support/kb/order-of-operations)

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [May 6, 2021, 3:48am UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/13 "2021-05-06T03:48:28Z")

</div>

When the new version of MT Pro comes out (1.9.0), we will have another 350 available global variables so the script will need to be modified again.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![CreepyPants](https://forum.bome.com/user_avatar/forum.bome.com/creepypants/32/975_2.png) [@CreepyPants](https://forum.bome.com/u/CreepyPants)\
**Post date:** [May 8, 2021, 9:14pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/14 "2021-05-08T21:14:00Z")

</div>

> [@SteveC](#):
>
> When the new version of MT Pro comes out (1.9.0), we will have another 350 available global variables

Umm…(droool)

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [May 8, 2021, 9:20pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/15 "2021-05-08T21:20:20Z")

</div>

Indeed very exciting.

oa-oz (excluding oo) o0-o9  
pa-pz (excluding pp) p0-p9  
…

oo,pp,qq,rr,ss,tt,uu,vv,ww and xx continue to be local variables

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

…

---

<div class="post-metadata">

**Author:** ![bill-5598](https://forum.bome.com/letter_avatar_proxy/v4/letter/b/f17d59/32.png) [@bill-5598](https://forum.bome.com/u/bill-5598)\
**Post date:** [November 7, 2025, 11:49am UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/16 "2025-11-07T11:49:34Z")

</div>

Was the script ever modified to support the increased number of global variables.

My project has gotten unruly and I need to go back and do the work of increasing the detail level of the documentation. The script and the python wrapper sound very useful.

Bill

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [November 7, 2025, 4:55pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/17 "2025-11-07T16:55:59Z")

</div>

I havent updated the awk script. Maybe @pedro.estrela has updated the python script though.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [November 7, 2025, 5:23pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/18 "2025-11-07T17:23:14Z")

</div>

Actually, I guess I did update it several years ago. I don’t remember if I fully tested it.

[bmt-2025-11-07-awk.txt](https://forum.bome.com/uploads/short-url/lQse7eV7sHsPnVFl8w0goAKWEUb.txt) (8.7 KB)

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![pedro.estrela](https://forum.bome.com/letter_avatar_proxy/v4/letter/p/87869e/32.png) [@pedro.estrela](https://forum.bome.com/u/pedro.estrela)\
**Post date:** [November 12, 2025, 6:45pm UTC](https://forum.bome.com/t/cross-reference-list-of-all-variables-in-a-mt-pro-project/886/19 "2025-11-12T18:45:12Z")

</div>

sorry, I’m no longer working on BOME  
I recommend asking a scrip to chatGPT or Claude code  
it makes wonders!
