home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Da Capo
/
da_capo_vol1.bin
/
programs
/
amiga
/
midi
/
midiplay
/
arexx
/
d10tonechange.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-08-28
|
724b
|
45 lines
/* This script is made for Roland D10. Modify it to work on your setup.
This script changes tone number of timbre on channel 1.
Parameters: GroupNumber ToneNumber */
options results
parse arg Group0 Tone0 .
ManuID = 41
DevID = 0
ModelID = 16
CmdID = 12
Address = "0 0 0"
Group = x2c(Group0)
Tone = x2c(Tone0)
MyStr = Address c2x(Group) c2x(Tone)
Checksum = d2c(128-CalcChecksum(MyStr))
address 'MidiPlay_rexx'
'sysex' ManuID DevID ModelID CmdID MyStr c2x(Checksum)
exit
/* This function calculates the checksum of a hexadecimal string */
CalcChecksum:
parse arg DStr
val = 0
do while DStr ~= ""
parse var DStr M1 M2
r1 = c2d(x2c(M1))
val = c2d(bitand(d2c(val + r1),'7f'x))
DStr = M2
end
return val