From
[email protected] Wed Jun 30 11:52:14 1993 X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil] ["23004" "Wed" "30" "June" "93" "03:49:32" "EDT" "
[email protected]" "
[email protected]" nil "631" "czmidiguide from midi archive" "^From:" nil nil "6"]) Received: from research.att.com by infix.cs.ruu.nl with SMTP id AA05186 (5.65c/IDA-1.4.4 for
); Wed, 30 Jun 1993 11:52:11 +0200 Received: by blink.att.com (4.1/SMI-3.2) id AA00974; Wed, 30 Jun 93 03:49:32 EDT Original-From: blink!midi-request (Mostly MIDI Mailing List) Message-Id: <[email protected]> From: [email protected] To: [email protected] Subject: czmidiguide from midi archive Date: Wed, 30 Jun 93 03:49:32 EDT ############# # The following is 'czmidiguide' from the midi-archive. ############# ----------------------------------------------------------------------------------------------- CASIO CZ MIDI GUIDE condensed version ------------------------------------------------------------------------------------------------------- or: Everything you Never Wanted to Know about MIDI but are going to ------------------------ Find Out Anyway ------------------------------------------------------------------------------------------------------------------------THIS IS AIMED SPECIFICALLY AT CZ101,CZ1000 and CZ5000 OWNERS. NOTE: I beleive the data given to me by Casio to be a) correct, and b) public domain ( since they just give it to you if you are persistent enough. Please forgive spelling, syntactic, or grammatical errors since I am trying to condense the manual as I go along... ------------------------------------------------------------------------------Right, at long last, I have been able to get a reply out of CASIO UK about the MIDI standards of the CZ series of synthesizers. For those of you who know how to play your keyboard by remote control from a computer, this will be of some interest, since it covers transmission of programming information ( both to and from the CZ ), setting of the controllers you previously couldn't access like tone mix level, and other bits besides. First off, let's recap on the simple stuff. The MIDI is a digital interface to musical instruments, and relies on serial transmission of data. These data are usually talked of in terms of bytes, and I shall be using hexadecimal numbers in this posting. There are basically two types of bytes sent over MIDI - control bytes and data bytes. Control bytes are distinguished by having values over 0x80 ( 80 hex, 128 decimal ), and these have valious meanings: 1) NOTE ON ---------A note on message consists of sending a "NOTE ON" control byte, the note number you want to turn on, and the velocity at which you want to play the note. The note on control is 90 plus the channel number. So, for example, if you want to
play note 32 ( = hex 20) at speed 64 (= hex 40), on the midi instrument receiving on channel two, then you would send: 92 NOTE ON, channel 2
20 Note #32
40 Velocity 64
If you wish to turn two or more notes on at the same time, the control byte need not be retransmitted. Eg to turn note 35 on as well, you could send 92 NOTE ON, ch2
20 40 ---32 on--
23 40 ---35 on--
These codes can be transmitted both ways on all the CZ 101,1000,5000, but since they do not detect note velocity, it is always transmitted and recognized as 64 (= 40 hex). 2) NOTE OFF ----------Just send a note on message with velocity 0. Eg to turn note 35 off, send 92 NOTE ON,Ch 2
23 00 --35 off--
3) CONTROL CHANGE ----------------There are several controls that can be set from MIDI. Just send a "CONTROL CH" byte , which is B0 plus the channel number, the number of the control that you wish to change, then the value you wish to set it to. Eg for CZ101 portamento time, send B0 CONTROL, ch 0
05 10 --ctrl 5=16--
The controls are: CZ101/1000 01 05 06 41
Vibrato on/off Portamento time Master tune Portamento on/off
Send Send Send Send
0 for off, 7F for ON number 00..63 (0..99) number 00..7F 0 for OFF, 7F for ON
Modulation wheel Portamento time Master tune Sustain pedal Portamento on/off
Send Send Send Send Send
number 00..7F number 00..63 number 00..7F 0 for OFF, 7F for ON 0 for OFF, 7F for ON
CZ5000 01 05 06 40 41
4) PROGRAM CHANGE ----------------This allows you to change between the preset sounds ( and your internal sounds and cartridges ). Just send C0 plus the channel number, then the program number. Eg to set CZ101 on channel 1 to Synth Bass:
C1 PROGRAM ch 1
07 Program 7
Note that the preset tones are given numbers : CZ101/1000 0..0F 20..2F 40..4F
Preset sounds 1..16 Internal sounds 1..16 Cartridge sounds 1..16
CZ5000 00..1F 20..3F
Preset sounds A1,A2,A3....D6,D7,D8 Internal sounds A1,A2.....D6,D7,D8
5) PITCH BEND CHANGE -------------------This is acheived by sending E0 plus the channel number, then two bytes denoting the new value of pitch bend. The first byte is the most significant, and the second the least significant. Note also that the lower 6 bits of the lower byte are not used, and that the central position of the wheel corresponds to the byte sequence 40 00. HIGHEST
7F 40
HIGHER CENTER
40 00
LOWER LOWEST
00 00
So, to bend the instrument on channel two UP by about half its maximum amount, send E2 BEND channel two
60 00 ---1/2 up--
6) AFTER TOUCH -------------Is not supported on the CZ101/1000/5000. Sorry! 7) MODE CHANGE -------------This is very similar to the CONTROL CHANGE message, and can be regarded as a special case. OMNI OMNI POLY POLY
ON OFF ON OFF
send send send send
E0 B0 B0 B0
+ + + +
channel, channel, channel, channel,
7D, 7C, 7F, 7E,
00 00 00 00
OMNI mode plays any MIDI data received at the MIDI IN plug on the back of the machine, regardless of channel. POLY mode is equivalent to the SOLO button on the front panel. With the CZ101, for instance, POLY OFF ( =SOLO ) allows the synth to be used as four monophonic synthesizers under remote control. LOCAL ON LOCAL OFF
send B0 + channel, 7A, 7F send B0 + channel, 7A, 00
Local mode means that the keyboard is "connected" to the sound producing part of the CZ within the machine itself. With LOCAL ON ( the default setting ), playing the keyboard both sends note messages out of the MIDI port, and also makes sounds at the same time. If you want to do wierd things like keyboard splitting, LOCAL OFF will allow you to see what the keyboard is doing without the CZ making any sound at all. You could then act on that information and send the keyboard a command depending on the keys that has nothing to do with them, eg program change or pitch bend. The possibilities are endless ! SEQUENCER MESSAGES -----------------The CZ5000 has its own internal sequencer, which can be controlled by: F8 FA FB FC FD
Clock byte: transmitted 24 times per quarter note ( crotchet ) Start: same as pressing the PLAY button on the front panel Continue: continue song where last stopped Stop: stops song play at current position Active sense: basically, a cry of "Is there anybody out there". If no reply is received within about 1/3 second, it shuts the voice off.
SYSTEM EXCLUSIVE MESSAGES ------------------------At last, the really meaty stuff. :-) These all have the basic form: F0 SYS EX MESSG
machine ID YES, YOU
some bytes DO THIS
F7 END OF SYS EX
Ok, so not very specific, bu that was deliberate to allow manufacturers to use all the lovely bells and whistles they put on their machine over the MIDI ! Since these are usually controlled by computer, I have set them out as a computer/synthesizer dialogue. Note that the computer MUST wait for replies before proceding, or all will fail ! Here we go, then 1) SET BEND RANGE ----------------Computer:
F0 44 00 00 70+channel 40 data F7
Eg to set bend range to 8 on channel 4, send F0 44 00 00 74 40 08 F7 2) KEY TRANSPOSE
---------------Computer:
F0 44 00 00 70+channel 41 data F7
Data is as follows: Key: G A A# B B# C C# D E E# F F# Data: 45 44 43 41 41 00 01 02 03 04 05 06 Eg to set key on channel 0 to C#, send F0 44 00 00 70 41 01 F7 3) TONE MIX ----------Computer:
F0 44 00 00 70+channel 42 data F7
The data is 00 to turn tone mix off, or 41..49 for mix level 1..9 Eg to set tone mix on channel 0 to 7, send F0 44 00 00 70 42 47 F7 4) ASK ABOUT PROGRAMMER ( Send request 2 ) ----------------------Computer: CZ101/1000: Computer: CZ101/1000: Computer:
F0 44 00 00 70+channel 19 00 F0 44 00 00 70+channel 30 70+channel 31 data1 data2 F7 F7
data1 is the program selected ( see PROGRAM CHANGE ) data2 returns the vibrato/portamento on/off setting: data2 00 Vibrato OFF Port'o OFF
10 OFF ON
20 ON OFF
30 ON ON
Eg an exchange such as Computer: F0 44 00 00 70 19 00 CZ101: F0 44 00 00 70 30 Computer: 70 31 CZ101: 27 30 F7 Computer: F7
"Want data on channel 0" "Gotcha.. data ready" "Ok, give it to me" "Internal 8, v on, p on"
REMOTE PROGRAMMING -----------------The send request 1 and receive request 1 messages. These dump a lot of data across the MIDI, which is the same for both messages, except that the data go the other way. The exchanges are: Send request Computer: CZ101/1000: Computer: CZ101/1000: Computer:
F0 44 00 00 70+channel 10 program F0 44 00 00 70+channel 30 70+channel 31 F7 F7
Receive request Computer: CZ101/1000: Computer: Cz101/1000:
F0 44 00 00 70+channel 20 program F0 44 00 00 70+channel 30 F7 F7
The program byte is the same as that set by the PROGRAM CHANGE function, with the addition that you can request the temporary sound area as well ( number is 60 ). This is the area that is used if you have altered a preset and not saved it into internal memory. is a sequence of 256 bytes containing a LOT of info. Now Casio have done a lot of funny things with these, like splitting bytes in half and encoding things in wierd ways so please bear with me. To keep everything this side of infinite length, I shall adopt the same strategy as the manual, which is to write data in bytes, although they are transmitted in half- bytes. For example, me writing a byte as 5F requires you to transmit or receive as 0F 05 ( wierd, huh ? ). This will obvoiusly save a lot of space. So, here goes again :-) There are 25 distinct sections within Sec#
Length Symbol (bytes)
Contents
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
1 1 2 1 3 3 3 2 2 2 1 16 1 16 1 16 2 2 2 1 16 1 16 1 16
line select data, octave range detune up or down detune range vibrato wave number vibrato delay time vibrato rate vibrato depth dco1 waveform dca1 key follow dcw1 key follow end step number of dca1 envelope dca1 envelope rate/level end step number of dcw1 envelope dcw1 envelope rate/level end step number of dco1 envelope dco1 envelope rate/level dco2 waveform dca2 key follow dcw2 key follow end step number of dca2 envelope dca2 rate/level end step number of dcw2 envelope dcw2 rate/level end step number of dco2 envelope dco2 rate/level
pflag pds pdl,pdh pvk pvdld,pvdlv pvsd,pvsv pvdd,pvdv mfw mamd,mamv mwmd,mwmv pmal pma pmwl pmw pmpl pmp sfw samd,samv swmd,swmv psal psa pswl psw pspl psp
1) PFLAG Looking at bits, 0000 00 Not used^ OCTV
00 LS
OCTV controls octave range: 00=octave 0, 01=+1, 10=-1 LS is the line select: 00=1, 01=2, 10=1+1', 11=1+2' So, fo Octave +1, line select 1+1', PFLAG=00000110 = 06 2)PDS For detune +, PDS is 0, for detune - it is 01 3)PDETL,PDETH Two bytes controlling the depth of the detune. The first byte is the FINE data. FINE: Byte:
0..15 00..0F
16..30 11..1F
31..45 21..2F
46..60 31..3F
The second contains both the octave and note data: OCT: NOTE: Byte:
0 0..11 00..0B
1 0..11 0C..17
2 0..11 18..23
3 0..11 24..2F
4) PVK This is the vibrato wave number, encoded as follows WAVE NUMBER: Byte:
1 08
2 04
3 20
4 02
5) PVDLD,PVDLV This is the vibrato delay time, transmitted in three bytes. Delay 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
Bytes 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 28 00 29 00 2A 00 2B 00 2C 00 2D 00 2E 00
19 1A 1B 1C 1D 1E 1F 21 23 25 27 29 2B 2D 2F 31 33 35 37 39 3B 3D
Delay 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
Bytes 32 00 33 00 34 00 35 00 36 00 37 00 38 00 39 00 3A 00 3B 00 3C 00 3D 00 3E 00 3F 00 40 00 41 00 42 00 43 00 44 00 45 00 46 00 47 00
4B 4F 53 57 5B 5F 63 67 6B 6F 73 77 7B 7F 87 8F 97 9F A7 AF B7 BF
Delay 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
Bytes 4B 00 4C 00 4D 00 4E 00 4F 00 50 01 51 01 52 01 53 01 54 01 55 01 56 01 67 01 58 01 59 01 5A 01 5B 01 5C 01 5D 01 5E 01 5F 01 60 02
DF E7 EF F7 FF 0F 1F 2F 3F 4F 5F 6F 7F 8F 9F AF BF CF DF EF FF 1F
47 48 49
2F 00 3F 30 00 43 31 00 47
72 73 74
48 00 C7 49 00 CF 4A 00 D7
97 98 99
61 02 3F 62 02 5F 63 02 7F
For delays in the range 0..31, just transmit 00..1F, 00, 00..1F eg for delay of 12, send 0C 00 0C. This is convenient since it saves me typing in another column of boring numbers ;-) 6) PVSD,PVSV Again, here comes another table for conversions. The first column (0..24) is omitted since the only difficult thing needed is to add 01 00 20 to each entry ( The first few go 00 00 20, 01 00 40, 02 00 60, ... 06 00 E0, 07 01 00, ..) Rate 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
Bytes 19 03 1A 03 1B 03 1C 03 1D 03 1E 03 1F 04 20 04 21 04 22 04 23 05 24 05 25 05 26 05 27 06 28 06 29 06 2A 06 2B 07 2C 07 2D 07 2E 07 2F 08 30 08 31 09
40 60 80 A0 C0 E0 00 60 A0 E0 20 60 A0 E0 20 60 A0 E0 20 60 A0 E0 20 E0 60
Rate 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
Bytes 32 09 33 0A 34 0A 35 0B 36 0B 37 0C 38 0C 39 0D 3A 0D 3B 0E 3C 0E 3D 0F 3E 0F 3F 10 40 11 41 12 42 13 43 14 44 15 45 16 46 17 47 18 48 19 49 1A 4A 1B
E0 60 E0 60 E0 60 E0 60 E0 60 E0 60 E0 60 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0
Rate 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
Bytes 4B 1C 4C 1D 4D 1E 4E 1F 4F 20 50 23 51 25 52 27 53 29 54 2B 55 2D 56 2F 57 31 58 33 59 35 5A 37 5B 39 5C 3B 5D 3D 5E 3F 5F 41 60 47 61 4B 62 4F 63 53
E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0 E0
7) PVDD,PVDV These are again encoded as three bytes in a most obscure way. Below 32, the encoding is 00..1F, 00, 01..20 eg for depth 13, send 0D 00 0E. Depth 25 26 27 28 29 30 31 32 33 34 35
Bytes 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 20 00 21 00 22 00 23 00
1A 1B 1C 1D 1E 1F 20 23 25 27 29
Depth 50 51 52 53 54 55 56 57 58 59 60
Bytes 32 00 33 00 34 00 35 00 36 00 37 00 38 00 39 00 3A 00 3B 00 3C 00
4F 53 57 5B 5F 63 67 6B 6F 73 77
Depth 75 76 77 78 79 80 81 82 83 84 85
Bytes 4B 00 4C 00 4D 00 4E 00 4F 01 50 01 51 01 52 01 53 01 54 01 55 01
E7 EF F7 FF 07 1F 2F 3F 4F 5F 6F
36 37 38 39 40 41 42 43 44 45 46 47 48 49
24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31
00 00 00 00 00 00 00 00 00 00 00 00 00 00
2B 2D 2F 31 33 35 37 39 3B 3D 3F 41 47 4B
61 62 63 64 65 66 67 68 69 70 71 72 73 74
3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A
00 00 00 00 00 00 00 00 00 00 00 00 00 00
7B 7F 83 8F 97 9F A7 AF B7 BF C7 CF D7 DF
86 87 88 89 90 91 92 93 94 95 96 97 98 99
56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63
01 01 01 01 01 01 01 01 01 02 02 02 02 03
7F 8F 9F AF BF CF DF EF FF 0F 3F 5F 7F 00
8) MFW These two bytes transmit the waveform for DCO1, and also the modulation ie ring, noise or none. First byte 000 000 0 0 First=1 000 Fisrt=2 001 First=3 010 First=4 100 First=5 101 First=6 110 First=7 110 First=8 110 Second=1 Second=2 Second=3 Second=4 Second=5 Second=6 Second=7 Second=8 NO MODULATION RING MODULATION NOISE MODULATION
000 001 010 100 101 110 110 110
1 1 1 1 1 1 1 1
Second byte 00 000 000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
00 00 00 00 00 01 10 11 00 00 00 00 00 01 10 11 000 100 011
So, for instance, to set first = 4, second= 2, ring modulation, we have 100 001 1 0 00 100 000 = 1000 0110 0010 0000 = 86 20 9) MAMD,MAMV These two bytes set the DCA1 key follow: Key follow: 1st byte: 2nd byte: 10) MWMD, MWMV
0 00 00
1 01 08
2 02 11
3 03 1A
4 04 24
5 05 2F
6 06 3A
7 07 45
8 08 52
9 09 5F
These two bytes set the DCW1 key follow Key follow: 1st byte: 2nd byte:
0 00 00
1 01 1F
2 02 2C
3 03 39
4 04 46
5 05 53
6 06 60
7 07 6E
8 08 92
9 09 FF
11) PMAL This sets the position of the end step on DCA1. Step 1..8 gives bytes 00..07. 12) PMA This consists of 8 repetitions of Rate,Level. Given that you wish to set rate r, the data you need to send is Byte= 119 x r ------99 Conversely, if byte=0, rate=0, if byte=7F, rate=99, otherwise r=99 x byte --------- + 1 119 Add 80 hex if the level will be coming down on this step. The level goes up linearly, with 0 being 00, up to 99 is 7F, so that Byte= 127 x level ----------99 and
Level= 99 x byte --------- + 1 127
except at byte=0 where level=0, and byte=127, where level=99 In all these conversions, fractional parts are ignored, so a result of byte=24.6987 would be taken as byte=24. 13) PMWL End step number for DCW1. Same as PMAL 14) PMW This sets the steps in DCW1, and consists of 8 repetitions of Rate,Level. The format is similar to PMA, so that you add 80 ( 128 dec ) to the rate if the level is coming down this step, and that you add 80 to the level if you wish to set a sustain point. The level data is handled the same as PMA, but for some strange reason the rate data is encoded differently. So
byte= 119 x level ----------- + 8
99 and
level= 99 x (byte-8) ------------- +1 119
except where byte=8, level=0, and where byte=77, level=99 15) PMPL Another end step setting, this time for DCO1. Same as PMAL and PMWL 16) PMP Another envelope setting, this time for the DCO1 rates and levels. Again uses a completely different encoding scheme. byte= 127 x rate ---------99
and
rate= 99 x byte --------- + 1 127 except where byte=00, rate=0, where byte=7F, rate=99 For the level, level data 0..63 translate as bytes 00..3F, and level data 64..99 translate as bytes 44..67. 17) SFW These two bytes set the waveform for DCO2. They use the same format as MFW does for DCO1, except that the modulation bits are ignored ( it is best to set these bits to zero , just in case ). 18) 19) 20) 21) 22) 23) 24) 25)
SAMD,SAMV SWMD,SWMV PSAL PSA PSWL PSW PSPL PSP
All the above use the same formats as their counterparts for the first set of DCO,DCW,DCA, and perform exactly the same functions on the DCA2,DCW2,and DCO2.
This concludes what I hope has been an informative article ( if rather a long one :-) ). Thong
[ The views above are my own (except any quotes !) and not anyone elses.. so ] [ flame me personally, not them ] +------------------------------------------------------------------------------+ | | | "Thong" Ellis, Reading University Computer Science VAX "Sage", England | | | | "But there aren't any REAL people here at all..." : Roosta | | | +------------------------------------------------------------------------------+