Dr.Godfried-Willem RAES

Kursus Experimentele Muziek: Boekdeel 5: Notatie en Muzieksoftware

Hogeschool Gent : Departement Muziek & Drama


<Terug naar inhoudstafel kursus>

   

5045:

MBatch

MBATCH.EXE is een beperkte, maar bijzonder handige batch-file georienteerde programmeertaal opgesteld door enkele gebruikers voor het MusicQuest Midi-interface voor IBM-PC's en de klonen daarvan.

Vooral voor wie het ontziet om telkens weer in eigen software routines te moeten voorzien en telkens weer software te moeten herschrijven voor dit soort mondaine taken, is het bijzonder handig omdat het zelfs vanuit een Basic programma kan opgeroepen worden. De algemene syntax is:

MBATCH <filename>

Door vanuit Basic naar de DOS shell te gaan, kan het binnen een eigen programma geintegreerd worden. We geven hier -af en toe voorzien van wat kommentaar en technische tips- de originele manual van het programma (in het engels dus...).


The MIDI Batch File Utility <<MBATCH.EXE>> Version 2.22 September 10, 1991

Music Quest, Inc.

Inhoud:

 

Introduction : Requirements

What's in a Batch File?

Learning How to Use MBATCH

Running MBATCH

Variables and the SET Command

The BUFFER Variable

Commands, Functions, and Verbs

Miscellaneous Commands

Comments

Controlling Batch File Listing

Running a DOS Command or Program

Commands that Assign Values to Variables

Set (Define) a Variable

Get Data from User

Arithmetic and Logical Commands

Add, Subtract from Variable, And to Variable

Or to Variable , Exclusive Or to Variable

Execution Control Commands .

Logical Expressions

While-end Loop, If-else-endif

Commands for Manipulating MIDI Data

Send Data Bytes

Start System Exclusive

Send End of Exclusive

Flush System Exclusive Receive BUFFER

Receive System Exclusive Data

Save BUFFER to File

Receive System Exclusive Data and Save

Send System Exclusive Data from a File

Load a File into the BUFFER

Send Contents of BUFFER

Load and Send File

Receive Time Out Value

Receive Status Pacing

Delay Timer

Send Note On

Send Note Off

Send Program Change

Send Control Change

Send Pitch Bend Message

Send General MIDI Message

Displaying Data

Print (Display)

Set Print Format

Typical Uses of MBATCH

Uploading Sysex Data

Downloading Sysex Data

Using MBATCH Interactively


Introduction

Many operating systems have batch file capabilities like the DOS or OS/2 batch file feature. Some batch file products can be added to your system to give it more powerful script routine features. The Personal REXX product is an example of a batch file add-on, although it is much more powerful than your average batch file processor. MBATCH is a MIDI oriented batch file processor, with simple yet useful functions. MBATCH was born when we realized we had accumulated one too many MIDI hardware products with no corresponding software. For example, that rack mount Mirage always forgets how it was set up when you remove power. We wanted some simple way to send system exclusive commands to anything in my configuration, without having to run 10 programs. The result was MBATCH.

Requirements

MBATCH is a DOS based program, and it should run on any 3.X version of DOS. In terms of memory, any machine with 256K or more RAM should be adequate. MBATCH will work with any of the Music Quest interfaces. What's in a Batch File? An MBATCH file isn't too much different from a DOS batch file. It contains one or more statements that are interpretively executed by MBATCH. Each line of the batch file is a statement. A statement consists of a command, function name, or verb followed by zero or more operands (arguments).

functionname operand1 operand2....operandn

Commands and function names are not case sensitive, so you can use upper/lower case at will. Operands can be separated by blanks or commas. Operands can be of three types: variables, character strings or numbers. Variables provide a powerful way to substitute other values into a statement (a varaible can contain a character string or number). Character strings consist of 1 or more non-white space characters and are typically used to specify things like file names. Numbers can be entered in any of three forms: hex, decimal or octal. A hex number starts with the characters 0x, as in 0xFF. A decimal number starts with the digits 1-9, as in 24. An octal number starts with a 0 with the second digit being 1-7.

In deze taal is 0x... dus hetzelfde als &H... in QB4.5 en PDF-Basic. Strings zijn alle variabelen die niet met een cijfer beginnen. Het equivalent dus van ...$ in QB4.5 en PDF.

In summary:

c:file.any = character string

0xAC = hex

39 = decimal

017 = octal

You build a batch file by combining various statements into some useful sequence, such as uploading a patch bank from a synthesizer. The MBATCH package includes several useful batch files that you can use as models for creating more batch files.

 

Learning How to Use MBATCH

You will find that the fastest way to learn how to use MBATCH is to look at the example batch files. If you don't understand something in a batch file, then look up the particular statement in this document. More than likely, you will be able to create new batch files by starting from the ones that are included with the package.

 

Running MBATCH

The MBATCH program is run from the DOS prompt:

mbatch batchfilename

Here, batchfilename is any full file name that may include a path and a file extension. For example,

mbatch c:dx7.mbt

starts MBATCH and tells it to interpretively execute the batch file c:dx7.mbt

 

Variables and the SET Command

Variables allow you to manipulate data in various ways. For example, you can use variables to accomplish basic mathematic operations, modify MIDI data (such as System Exclusive data), or parameterize a batch file. With the SET command, you can define a variable name with up to 31 characters. The first character of the variable name must be non-numeric (anything other than a number). For example:

SET midichannel 0

defines the variable 'midichannel' and sets its value to 0. One of the advantages of variables is that you can use them just about any place where an operand is required. You can assign any number, character string, or quoted string to a variable. Note that the length of a string is limited to 32 characters.

 

The BUFFER Variable

There is one special variable that you will want to know about, namely the BUFFER variable. The BUFFER variable refers to MBATCH's System Exclusive data buffer. The BUFFER is typically more than 64K bytes long, so there must be some way to specify what byte of BUFFER is being referenced. An example will illustrate how this is handled.

SET buffer[0] 0xF0

This statement sets the byte at offset 0 within BUFFER to the value 0xF0. It illustrates how the square brackets (ala C language syntax) are used to specify an index into the BUFFER array.

Commands, Functions, and Verbs

Here is a description of all of the commands currently supported by MBATCH. The commands are arranged according to category. Where appropriate, an example illustrating the use of each command is included.

 

Miscellaneous Commands

Comments

Syntax: ;anything

Any statement or line that starts with a semicolon is treated as a comment, and ignored by MBATCH.

;A comment statement

Controlling Batch File Listing

Syntax: echo {on | off}

The echo command works just like the DOS batch file echo command. Ordinarily, each statement of the batch file is displayed. The command echo off suspends the display of batch file lines, while echo on resumes the display.

 

Help Screen

Syntax: help

The help command prints a help screen with each possible command listed. This provides a handy way to remember possible command names when using MBatch interactively.

 

Commands that Assign Values to Variables

Set (Define) a Variable

Syntax: set varname value

The set command assigns a value to a variable. The value can be an integer number or character string of up to 31 characters. Numeric variables are maintained as 32-bit values.

 

Get Data from User

Syntax: input prompt varname

The input command displays the prompt and waits for the user to enter data. The prompt can be anything, including a quoted string. The data is assigned to the variable varname. This is similar to the BASIC input command.

input "Enter MIDI channel number: " midichannel

 

Arithmetic and Logical Commands

 

These commands allow you to alter the value of a variable. Their syntax is somewhat similar to many assembler languages in that they consist of a command (mnemonic) and two operands. The first operand is also the destination of the result. Note that all arithmetic operations are performed using 32-bit arithmetic.

 

Add to Variable

Syntax: add varname value

The value is added to the variable varname.

 

Subtract from Variable

Syntax: subtract varname value

sub varname value

The value is subtracted from the variable varname.

 

And to Variable

Syntax: and varname value

The value is anded to the variable varname.

 

Or to Variable

Syntax: or varname value

The value is orred into the variable varname.

 

Exclusive Or to Variable

Syntax: xor varname value

The value is exclusive orred into the variable varname.

 

 

Execution Control Commands

 

The execution commands provide loops and conditional execution capability.

 

Logical Expressions

 

Control statements use logical expressions to determine which statements are interpreted. A simple logical expression consists of two values and a logical operator:

value1 logical-operator value2

Values can be character strings or numbers. The supported logical operators are:

Operator: Meaning:

== equal to

!= not equal to

> greater than

< less than

>= greater than or equal to

<= less than or equal to

 

The result of a logical expession is "true" if the condition is true; otherwise, the result is false. Two simple logical expressions can be combined to form a compound logical expression. The compound operators are:

Operator Meaning

 

& and

| or

 

Here are some syntactically valid logical expressions:

Expression Meaning

x > 6 x greater than 6

x > 6 & x < 12 x greater than 6 and x less than 12

string != abcd variable string not equal to

character abcd

string == abcd | string == xyz variable string equal to character

string abcd or xyz

 

While-end Loop

Syntax: while logical-expression

statement(s)

end

The while-end construct implements the traditional while-loop. The three operands of the while command form an expression that controls the loop. If the expression is false, the loop terminates. Value1 and value2 can be variables, numbers, or character strings.

Example:

set i 0

while i < 16

print i

add i 1

end

 

will print the numbers from 0 through 15.

 

If-else-endif

Syntax: if logical-expression

statement(s)

else

statement(s)

endif

 

The if-else-endif construct implements conditional execution. If the logical expression is true, the statements up to the else are executed; otherwise, the statements between the else and endif are executed. If there is no else clause, the else command may be omitted, yielding an if-endif construct. The endif command MUST always be included.

Example:

input "Enter a number: " n

if n > 5

print n "is greater than 5"

else

print n "is less than or equal to 5"

endif

This example asks the user for a number, and responds by telling the user if the number is greater than or less than equal to 5.

 

Commands for Manipulating MIDI Data

 

Send Data Bytes

Syntax: data [byte1] [byte2]....[byten]

The data command causes all of the operand data bytes to be sent to MIDI-out. No error checking is performed.

 

Start System Exclusive

Syntax: sysex [byte1] [byte2]....[byten]

The sysex command is probably the most useful command in the MBATCH vocabulary. Effectively, MBATCH sends a 0xF0 (start of system exclusive) to MIDI-out followed by what ever data bytes appear on the rest of the statement. MBATCH doesn't validate the operands, it merely sends them to MIDI-out, so you must pay attention to the operands.

The following sends a bulk dump request to a DX-7:

 

sysex 0x43 0x20 9 0xF7

 

Notice that an end of exclusive, 0xF7, was included to complete the system exclusive. You can explicitly write the 0xF7, or you can use the eox command to do it for you. For example, the following two statements are functionally the same as the single statement above:

sysex 0x43 0x20 9

eox

Long system exclusives can be continued over multiple statements by using the data command. Using the data statement, the above could be written:

sysex

data 0x43 0x20 9

eox

In summary, you can use these three statements to send just about anything imaginable to your MIDI hardware.

 

Send End of Exclusive

Syntax: eox

This command causes a 0xF7 to be sent to MIDI-out, effectively terminating any open system exclusive.

 

Flush System Exclusive Receive BUFFER

Syntax: flushbuffer

MBATCH implements a 64K byte sysex BUFFER for storing incoming system exclusive data. The flushbuffer command clears the BUFFER and prepares the MIDI-interface to receive new system exclusive data.

 

Receive System Exclusive Data

Syntax: receive [n]

The receive command stores received system exclusive data in the BUFFER. The command completes after 'n' system exclusive units have been received. The single operand specifies the number of system exclusive units that are to be saved in the file. If 'n' is omitted, the value 1 is assumed. A system exclusive unit is one complete system exclusive message, starting with 0xF0 and ending with 0xF7. Many MIDI devices (e.g Emu Proteus) can transmit multiple system exclusive units in response to a single request. For example, the Emu Proteus sends 64 units in response to a "dump factory presets" request.

Example: receive 64

This statement causes MBATCH to wait until 64 system exclusive units have been received into the sysex BUFFER.

 

Save BUFFER to File

Syntax: save filename

The save command writes the contents of the sysex BUFFER to the designated file. The filename operand specifies the full name of the file. You can specify any path, name and extension.

 

Receive System Exclusive Data and Save

Syntax: receivefile filename [n]

The receivefile is the logical combination of the receive and save commands. After receiving 'n' system exclusive units, the contents of the BUFFER are saved in the specified file. The filename operand specifies the full name of the file. You can specify any path, name and extension. The second operand specifies the number of system exclusive units that are to be saved in the file. If n is omitted, the value 1 is assumed. A system exclusive unit is one complete system exclusive message, starting with 0xF0 and ending with 0xF7. Many MIDI devices can transmit multiple system exclusive units in response to a single request. For example, the Emu Proteus sends 64 units in response to a "dump factory presets" request.

Example: receivefile c:factory.pro 64

This statement causes MBATCH to wait until 64 system exclusive units have been received into the sysex BUFFER. When all 64 have arrived, they are written to the file c:factory.pro as a continuous stream of data.

 

Send System Exclusive Data from a File

Load a File into the BUFFER

Syntax: load filename

The specified file is loaded into the sysex BUFFER. The file must be in MIDIEX format (a MIDIEX file contains one complete Sysex, starting with a 0xF0 and ending with a 0xF7).

 

Send Contents of BUFFER

Syntax: send

The current contents of the sysex BUFFER are sent to MIDI-out.

 

Load and Send File

Syntax: sendfile filename

The sendfile command is the logical combiantion of the load and send commands, and the complement to the receivefile command. It reads the contents of the specified file into the sysex BUFFER and then sends the data to MIDI-out. It can read/send any file that was saved via receivefile. The file format employed is upward compatible with the popular MIDIEX format, so you can use sendfile to send anything that was captured using MIDIEX.

 

Receive Time Out Value

Syntax: timeout tttt

When you use the receivefile command, it will wait until the specified number of sysex units arrive. If you make a mistake with a preceding sysex request, the data may never arrive. To avoid program hangs, the receivefile command will give up if it does not receive any data within the time out value. You control the time out value through the timeout command. The value of the tttt operand specifies the time out value in terms of seconds.

Example: timeout 10

The receivefile command will terminate if no data is received for 10 seconds.

 

Receive Status Pacing

Syntax: pacing pppp

While the sendfile command is running, it reports status about how many sysex units and data bytes have been received. The pacing value, pppp, determines how frequent status is updated. The pppp value specifies that the status is to be updated every pppp bytes. If you never specify a pacing value, it defaults to 512. The pacing value has a not-so-obvious side effect from which its name was derived. Updating the status consumes CPU cycles, which inherently slows down the effective of rate of data transfer to MIDI-out. Thus, you can use it to pace the rate of outgoing data for devices that cannot receive data at full MIDI speed. Setting a pacing value of 1 will cause the status to be updated every byte, and it will provide the slowest data transfer.

 

Delay Timer

Syntax: delay mmmm

The delay command simply pauses for mmmm milliseconds. Some MIDI hardware is timing sensitive, so you can use the delay command to slow down transactions. Be aware that the PC timer is used to measure delays. Since the PC timer is in units of approximately 55 milliseconds, the total delay time will be rounded to the nearest 55 millisecond unit.

 

Send Note On

Syntax: noteon ch nn vv

The noteon command sends a note on message for channel ch (0-15), note nn (0- 127), at velocity vv (0-127).

 

Send Note Off

Syntax: noteoff ch nn vv

The noteoff command sends a note off message for channel ch (0-15), note nn (0-127), at velocity vv (0-127).

 

Send Program Change

Syntax: programchange ch pp

The programchange command sends a program change message for channel ch (0- 15) to change to program pp (0-127).

 

Send Control Change

Syntax: controlchange ch cc vv

The controlchange command sends a control change message for channel ch (0- 15) to change controller cc (0-127) to value vv (0-127). For example, controller 64 is the sustain controller. Thus,

controlchange 0 64 127

would cause the sustain controller on channel 0 to be turned on.

 

Send Pitch Bend Message

Syntax: pitchbend ch bbbb

The pitchbend command sends a pitch bend message on channel ch (0-15) with bend value bbbb (0-0x3FFF). Note that 0x2000 is the center value (i.e no bend). Thus the value 0 is the maximum bend down and 0x3FFF is the maximum bend up.

 

Send General MIDI Message

Syntax: midimessage rs b1 [b2]

The midimessage command can be used to send any message. Other MBATCH commands allow you do cover most MIDI messages, but this command gives yo the most control. The rs byte specifies the running status byte, while b1 and b2 are the data bytes.

Example: midimessage 0x90 36 64

This sends a note on (0x90) for channel 0, note 36, at velocity 64. Note that the statement:

noteon 0 36 64

accomplishes the same result, but is somewhat easier to read.

 

Displaying Data

MBATCH includes some basic functions for displaying data. These can be especially useful for dumping out the contents of system exclusives or other MIDI data.

 

Print (Display)

Syntax: print item1 [item2...itemn]

The print command displays one or more data items (just like the BASIC print statement). The data items can be numbers, character strings or quoted strings. A blank is inserted between each data item, and a new-line is added after the last data item.

Example:

print buffer[0] buffer[1] buffer[3] buffer[4]

prints out the first 4 bytes of the system exclusive BUFFER.

 

Set Print Format

Syntax: printformat format

This command allows you to tell MBATCH how you want printed data to be formatted. The format string is a C language format string that would be typically used with the printf function. Note that when printing numeric values, the format string must include an 'l', because all numeric values are maintained as long integers (32-bit values).

For those not familiar with C, the here is a list of useful formats. Assume that your are printing the value 0xF7.

 

String Results Comments

 

0x%02lX 0xF7 this is the default format

%ld 247 print as decimal digits, no leading zeroes

%02lX F7 an alternative hexadecimal format

 

 

Typical Uses of MBATCH

Probably the most frequent use of MBATCH will be to retrieve system exclusive data from a synth or to send system exclusive data to a synth.

 

Uploading Sysex Data

With most synths (Roland products being an exception), you can upload sysex data by sending a single request to the synth and recording what the synth sends back. This works well with most Yamaha equipment. The general form of a batch file for uploading and saving sysex data is:

flushbuffer

timeout

sysex

receivefile

The flushbuffer command clears out any data that may be in the receive buffer. The timeout command establishes the time interval before a time out condition is declared. The sysex command sends the request to the synth, and the receivefile command writes the received data to a file. For a specific example, look at the dx7.mbt file.

 

Downloading Sysex Data

The general form of a batch file for downloading sysex data that has been saved in a file is:

pacing

sendfile

The pacing command sets the status update frequency, which in turn controls the rate of data transfer. The sendfile command transmits the designated file.

De *.mbt files op de disks - een ervan is verder uitgeprint- tonen specifieke voorbeelden van deze algemene vorm. (bvb. DX7.MBT).


Interaktief en rechtstreeks gebruik van MBATCH:

 

MBATCH kan ook vanaff het komputertoetsenbord gebruikt worden, zonder bij het MBATCH kommando een filenaam op te geven. Het programma stuurt dan wel telkens de echo van het gegeven kommado terug naar het scherm. Gebruik volgende syntax:

mbatch con

 

Vervolgens, type een bewering (statement) en sluit af met de enter toets. Wanneer alle gewenste instrukties gegeven zijn, eindig met ^C en enter. Het programma reageert dan met

'Terminate MIDI Batch File Execution (y/n)?'

waarop je uiteraard Y drukt.


Batch-file voorbeelden:

File: DX7.MBT

 

;=============================================================================

; This example illustrates how to upload and download patch

; banks from/to a DX-7

;=============================================================================

; First, we do the upload

;

flushbuffer ;prepare to receive data

sysex 0x43 0x20 9 0xF7 ;request bulk dump from DX-7

timeout 5 ;if nothing is received for 5 seconds,

;we'll timeout

receivefile e:sysex.dx7 ;write data to file

;

; Then, we do the down load

;

sysex 0x43 0x10 0x19 83 0 0xF7 ;This sysex turns off memory protect

pacing 512 ;Report status every 512 bytes

sendfile e:sysex.dx7 ;Now, send the file from above

 

 

File:DX7II.MBT

 

;=============================================================================

; This example illustrates how to upload and download patch

; banks from/to a DX-7S or DX-7II

;=============================================================================

set fn e:sysex.dx7 ;defines file name for sysex data

;

; First, we do the upload

;

flushbuffer ;prepare to receive data

sysex 0x43 0x20 9 0xF7 ;request bulk dump from DX-7

timeout 5 ;if nothing is received for 5 seconds,

;we'll timeout

receive ;receive base voice bank

sysex 0x43 0x20 6 0xF7 ;request additional voice data

receive ;receive additional voice data

save fn ;save all data

;

; Then, we do the down load

;

sysex 0x43 0x10 0x19 83 0 0xF7 ;This sysex turns off memory protect

pacing 512 ;Report status every 512 bytes

sendfile fn ;Now, send the file from above

 

 

File: EXPR.MBT

 

;=============================================================================

; This example illustrates how to use logical expressions

;=============================================================================

echo off

set i 0

printformat "%ld"

while i >= 0 & i < 16

if i > 6 & i < 9

print i "is greater than 6, but less than 9"

else

if i <= 6 | i == 10

print i "is less than or equal to 6 or exactly equal to 10"

else

print i "is == 9 or greater than 10"

endif

endif

add i 1

end

if i == 16

print i "is the terminal loop value"

endif

 

File: TEST.MBT

 

; Test

;

programchange 0 42

noteon 0 48 64

delay 2000

pitchbend 0 0x1000

delay 2000

pitchbend 0 0x2000

delay 2000

noteoff 0 48 64

delay 500

midimessage 0x91 59 64

controlchange 0 64 127

midimessage 0x91 59 0

delay 2000

controlchange 0 64 0

 

File: RX17.MBT

 

;==============================================================================

; This batch file uploads all of the song data from an RX-17

; Before running this batch file, be sure to put your RX-17 into

; the "Transmit Bulk" state by pressing MIDI and selecting function

; number 7. Otherwise, the RX-17 will not respond.

;==============================================================================

flushbuffer

timeout 5

; Universal bulk request LM__8520__ for RX-17

;

sysex 0x43 0x20 0x7E 0x4C 0x4D 0x20 0x20 0x38 0x35 0x32 0x30 0x20 0x20 0xF7

receivefile rx17.dmp

 

File: MIDI.MBT

 

;=============================================================================

; This example illustrates some general MIDI uses of MIDI Batch

;=============================================================================

noteon 0 48 64 ;On ch 1, turn on note 48 at vel 64

delay 1500 ;Wait about 1.5 sec

pitchbend 0 0x1000 ;Pitch bend down half way

delay 1500 ;Wait about 1.5 sec

pitchbend 0 0x2000 ;Return pitch bend to center

delay 1500 ;Wait about 1.5 sec

noteoff 0 48 64 ;turn off note 48

delay 500 ;Wait about .5 sec

noteon 0 59 64 ;On ch 1, turn on note 59 at vel 64

controlchange 0 64 127 ;On ch 1, turn on sustain controller

noteoff 0 59 64 ;Turn off note 59

delay 1500 ;Wait about 1.5 sec

controlchange 0 64 0 ;Turn off sustain controller

 

 

Tot slot enkele van mijn eigen programmas geschreven in MBATCH waarmee dumps vanuit Proteus modules evenals van de Digitech TSR24 kunnen opgehaald en weggeschreven worden.

(Voor Basic routines waarmee deze bestanden kunnen gekontroleerd worden, verwijs ik naar hoofdstuk 1605. (Eerste boekdeel).


; **************************************************************************

; * < A Book of Moves > *

; * SONGBOOKS *

; * Dr. Godfried-Willem Raes *

; * MusicQuest MBatch Program *

; **************************************************************************

; This program should be run from MBATCH

; the syntax is : MBATCH TSR24GET.MBT

; Syntax manual : MBATCH.PRN

;

; 21.05.1995: first version - crashes!

; has to be slowed down to allow for writes to disk, between

; the individual file dumps.

; Checked with delay 1100 instructions... still too fast!

; dummy input statements inserted.

;

; This is a program that gets the complete configuration from the

; Digitech TSR24 processor as used in <A Book of Moves> / <Songbooks>

;

; The general sysex header for TSR24 is as follows:

; 0xF0 = SOX

; 0 0 0x10 = Manufacturers ID for DOD/Digitech

; 0x0n = n is midichannel (here always F)

; 0x40 = device ID number (&H40= TSR24)

; then comes:

; 0xnn = procedure number

; 0xdd .... = data bytes as needed by requested procedure

; 0xF7 = EOX

;

 

; step1: request Configuration Address TSR24_00.BOM

flushbuffer

timeout 5

sysex

data 0 0 0x10 0xF 0x40 0

eox

receivefile TSR24_00.BOM 1

delay 1100

; The answer on this request was:

; F0 00 00 10 0F 40 41 01 7A 01 4A F7

; header........ ww xx yy zz

; The meaning of this is as follows:

; ww = bit 7 of RAM adress

; xx = bits 6-0 of RAM adress

; yy = bit 15 of RAM adress

; zz = bits 14-8 of RAM adress

; The 16-bit RAM adress for configuration is &HCAFA (=51962 dec.)

 

;step2: get single presets: (preset= 0)

; there must be a wait between the individual preset dumps...

SET dum 0

flushbuffer

timeout 5

sysex

data 0 0 0x10 0xF 0x40 1 0 0

eox

receivefile TSR24P0.BOM 1

input "Press any key for next dump..." dum

 

;get single preset = 1

flushbuffer

timeout 5

sysex

data 0 0 0x10 0xF 0x40 1 0 1

eox

receivefile TSR24P1.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 2

flushbuffer

timeout 5

sysex

data 0 0 0x10 0xF 0x40 1 0 2

eox

receivefile TSR24P2.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 3

flushbuffer

timeout 5

sysex

data 0 0 0x10 0xF 0x40 1 0 3

eox

receivefile TSR24P3.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 4

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 4

eox

receivefile TSR24P4.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 5

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 5

eox

receivefile TSR24P5.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 6

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 6

eox

receivefile TSR24P6.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 7

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 7

eox

receivefile TSR24P7.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 8

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 8

eox

receivefile TSR24P8.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 9

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 9

eox

receivefile TSR24P9.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 10

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 0x0A

eox

receivefile TSR24P10.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 11

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 0x0B

eox

receivefile TSR24P11.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 12

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 0x0C

eox

receivefile TSR24P12.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 13

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 0x0D

eox

receivefile TSR24P13.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 14

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 0x0E

eox

receivefile TSR24P14.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single preset = 15

flushbuffer

timeout 10

sysex

data 0 0 0x10 0xF 0x40 1 0 0x0F

eox

receivefile TSR24P15.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

 

; step 3: interactive: ask user for more...

SET meerpresets N

INPUT " More presets to save? (Y/N) " meerpresets

IF meerpresets = Y

SET preset 127

SET filename TSR24###.BOM

WHILE preset > 0

INPUT " Preset-number to save? (0= END)" preset

INPUT " Filename to save to ? " filename

flushbuffer

timeout 5

IF preset < 128

sysex

data 0 0 0x10 0xF 0x40 1 0 preset

eox

ELSE

sysex

data 0 0 0x10 0xF 0x40 1 1 preset

eox

ENDIF

receivefile filename 1

input "Press any key for next dump..." dum

delay 1100

END

ENDIF

SET meerpresets N

 

;step4: get single algorithm 0 (0-63 are user-algos)

; if a non existing user algorithm is requested, an error message

; is returned: F0 00 00 10 0F 40

; 61 00 08 00 01 00

; 00 00 20 00 00 F7

; = B1=8 , B2=1 => requested algo nonexisting

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 0

eox

receivefile TSR24A0.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 1

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 1

eox

receivefile TSR24A1.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 2

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 2

eox

receivefile TSR24A2.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 3

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 3

eox

receivefile TSR24A3.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 4

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 4

eox

receivefile TSR24A4.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 5

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 5

eox

receivefile TSR24A5.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 6

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 6

eox

receivefile TSR24A6.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 7

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 7

eox

receivefile TSR24A7.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 8

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 8

eox

receivefile TSR24A8.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 9

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 9

eox

receivefile TSR24A9.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 10

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 0x0A

eox

receivefile TSR24A10.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 11

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 0x0B

eox

receivefile TSR24A11.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 12

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 0x0C

eox

receivefile TSR24A12.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 13

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 0x0D

eox

receivefile TSR24A13.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 14

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 0x0E

eox

receivefile TSR24A14.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

;get single algorithm 15

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x31 0x0F

eox

receivefile TSR24A15.BOM 1

input "Press any key for next dump..." dum

delay 1100

 

; ************************************************************************

;step5: get bulk dump:

flushbuffer

timeout 10

sysex

data 0 0 0x10 0x0F 0x40 0x49

eox

receivefile TSR24ALL.BOM

input "Press any key for next dump..." dum

delay 3300

; ************************************************************************

 

 

;step6: get module table (this cannot be sent back!!!) = ASCII-list

; handy for programming documentation!

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x50

eox

receivefile TSR24MOD.BOM 1

input "Press any key for next dump..." dum

delay 2200

 

; ************************************************************************

;step7: get algorithm link table (of current algo only though...)

flushbuffer

timeout 5

sysex

data 0 0 0x10 0x0F 0x40 0x52

eox

receivefile TSR24TBL.BOM 1

; input "Press any key for next dump..." dum

delay 1100

 

;step8: return to program screen

flushbuffer

timeout 1

sysex

data 0 0 0x10 0x0F 0x40 0x60

eox

; this has no return

 

flushbuffer

 

; All dumps completed now.

; The whole TSR24 setup is saved to disk.

; All files written are named 'TSR24nnnn.BOM'.


Deze dumps kunnen terug geschreven worden via volgend programma:

; **************************************************************************

; * < A Book of Moves > *

; * SONGBOOKS *

; * Godfried-Willem Raes *

; * MusicQuest MBatch Program *

; **************************************************************************

; This program should be run from MBATCH

; the syntax is : MBATCH TSR24PUT.MBT

; it needs all files created by TSR24GET.MBT

;

; 21.05.1995: first version

;

; This is a program that dumps the complete configuration from the

; Digitech TSR24 processor as used in <A Book of Moves> / <Songbooks>

; from the computer into the TSR24

;

pacing 128

; step1: request Configuration Address TSR24_00.BOM

; TSR24_00.BOM 1 - not to be sent back

 

;step2: put single presets: (presets= 0 - 15)

sendfile TSR24P0.BOM

sendfile TSR24P1.BOM

sendfile TSR24P2.BOM

sendfile TSR24P3.BOM

sendfile TSR24P4.BOM

sendfile TSR24P5.BOM

sendfile TSR24P6.BOM

sendfile TSR24P7.BOM

sendfile TSR24P8.BOM

sendfile TSR24P9.BOM

sendfile TSR24P10.BOM

sendfile TSR24P11.BOM

sendfile TSR24P12.BOM

sendfile TSR24P13.BOM

sendfile TSR24P14.BOM

sendfile TSR24P15.BOM

; **************************************************

; step4: get single algorithm 0 (0-63 are user-algos)

sendfile TSR24A0.BOM

sendfile TSR24A1.BOM

sendfile TSR24A2.BOM

sendfile TSR24A3.BOM

sendfile TSR24A4.BOM

sendfile TSR24A5.BOM

sendfile TSR24A6.BOM

sendfile TSR24A7.BOM

sendfile TSR24A8.BOM

sendfile TSR24A9.BOM

sendfile TSR24A10.BOM

sendfile TSR24A11.BOM

sendfile TSR24A12.BOM

sendfile TSR24A13.BOM

sendfile TSR24A14.BOM

sendfile TSR24A15.BOM

 

; ************************************************************************

;step5: put bulk dump:

sendfile TSR24ALL.BOM

; ************************************************************************

;step6: get module table (this cannot be sent back!!!) = ASCII-list

; handy for programming documentation!

; file= TSR24MOD.BOM

; ************************************************************************

;step7: get algorithm link table (of current algo only though...)

sendfile TSR24TBL.BOM

; ************************************************************************

;step8: return to program screen

flushbuffer

timeout 1

sysex

data 0 0 0x10 0x0F 0x40 0x60

eox

; this has no return

 

; All dumps into the TSR24 completed now.

; All files written are named 'TSR24nnnn.BOM'.


MBATCH programmas voor de Proteus volgen hier:

; **************************************************************************

; * < A Book of Moves > *

; * Godfried-Willem Raes *

; * MusicQuest MBatch Program *

; **************************************************************************

; This program should be run from MBATCH

; the syntax is : MBATCH PRO3_GET.MBT

; This is a program that gets the complete configuration from the

; PROTEUS/3 sound module as used in <A Book of Moves>

; step1: get all user presets: (64-127) = Bank2 = PR3_BNK2.BOM

flushbuffer

timeout 10

sysex

data 0x18 4 0 0 0x7F 0x7F

eox

receivefile PR3_USER.BOM 64

 

;step2: get all factory presets: (0-63) = Bank1 = PR3_BNK1.BOM

flushbuffer

timeout 10

sysex

data 0x18 4 0 0 0x7E 0x7F

eox

receivefile PR3_FACT.BOM 64

 

;step3: get the tuning table data:

flushbuffer

timeout 5

sysex

data 0x18 4 0 4

eox

receivefile PR3_TUNE.BOM 1

 

;step4: get the program map

flushbuffer

timeout 5

sysex

data 0x18 4 0 6

eox

receivefile PR3_PMAP.BOM 1

 

;step5: get all master settings:

flushbuffer

timeout 10

sysex

data 0x18 4 0 8

eox

receivefile PR3_MAST.BOM 1

 

;step6: get version code:

flushbuffer

timeout 5

sysex

data 0x18 4 0 0xA

eox

receivefile PR3_VER.BOM 1

 

;step7: get presets bank1: = PR3_FACT.BOM

flushbuffer

timeout 10

sysex

data 0x18 4 0 0 0 8

eox

receivefile PR3_bnk1.BOM 64

 

;step8: get presets bank2: = PR3_USER.BOM

flushbuffer

timeout 10

sysex

data 0x18 4 0 0 1 8

eox

receivefile PR3_bnk2.BOM 64

 

;step9: get presets bank3: (128-191)

flushbuffer

timeout 10

sysex

data 0x18 4 0 0 2 8

eox

receivefile PR3_bnk3.BOM 64

 

;step10: get instrument list:

flushbuffer

timeout 10

sysex

data 0x18 4 0 0x0E

eox

receivefile PR3_NAME.BOM 1

 

;step11: get configuration message

flushbuffer

timeout 5

sysex

data 0x18 4 0 0x0C

eox

receivefile PR3_CONF.BOM 1

; All dumps completed now.

; The whole PROTEUS/3 setup is saved to disk.

; All files written are named 'PR3_nnnn.BOM'.

Wegschrijven van deze dumps verloopt gelijkaardig als bij de Digitech TSR24:


; **************************************************************************

; * < A Book of Moves > *

; * Godfried-Willem RAES *

; **************************************************************************

; This program file should be run with MBATCH.EXE

; It dumps all settings needed for a performance of <A Book of Moves>

; to the PROTEUS/3 Module.

; 07.10.1993: first version

; This will only work, if before, PRO3_GET.MBT did run and made all the 'PR3_nnnn.BOM' datafiles needed here... Obviously these files have to be in the same directory as this program.

pacing 128

; send user presets (PR3_USER.BOM = PR3_BANK2.BOM)

sendfile PR3_USER.BOM

; send master settings

sendfile PR3_MAST.BOM

; send program map

sendfile PR3_PMAP.BOM

; send tuning table

sendfile PR3_TUNE.BOM

; send presets bank1

; sendfile PR3_BNK1.BOM

; send presets bank2

; sendfile PR3_BNK2.BOM

; send presets bank3

; sendfile PR3_BNK3.BOM


Filedate: 970928

Terug naar inhoudstafel kursus: <Index Kursus>

Naar homepage dr.Godfried-Willem RAES