czmidi

  • Upload
    jamesyu

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

  • 8/14/2019 czmidi

    1/11

    ------------------------------------------------------------------------------------------------ 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) publicdomain ( since they just give it to you if you are persistent enough.Please forgive spelling, syntactic, or grammatical errors since I amtrying 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 theMIDI standards of the CZ series of synthesizers. For those of you who knowhow to play your keyboard by remote control from a computer, this will be ofsome interest, since it covers transmission of programming information ( bothto 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 tomusical instruments, and relies on serial transmission of data. These data areusually talked of in terms of bytes, and I shall be using hexadecimal numbersin this posting.

    There are basically two types of bytes sent over MIDI - control bytes and databytes. 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 numberyou want to turn on, and the velocity at which you want to play the note. Thenote on control is 90 plus the channel number. So, for example, if you want toplay note 32 ( = hex 20) at speed 64 (= hex 40), on the midi instrument receiv-ing on channel two, then you would send:

    92 20 40NOTE ON, channel 2 Note #32 Velocity 64

    If you wish to turn two or more notes on at the same time, the control byteneed not be retransmitted. Eg to turn note 35 on as well, you could send

    92 20 40 23 40NOTE ON, ch2 ---32 on-- ---35 on--

    These codes can be transmitted both ways on all the CZ 101,1000,5000, but sincethey do not detect note velocity, it is always transmitted and recognized as64 (= 40 hex).

    2) NOTE OFF-----------

    Just send a note on message with velocity 0. Eg to turn note 35 off, send

  • 8/14/2019 czmidi

    2/11

    92 23 00NOTE ON,Ch 2 --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 youwish to change, then the value you wish to set it to. Eg for CZ101 portamentotime, send

    B0 05 10CONTROL, ch 0 --ctrl 5=16--

    The controls are:

    CZ101/1000

    01 Vibrato on/off Send 0 for off, 7F for ON05 Portamento time Send number 00..63 (0..99)

    06 Master tune Send number 00..7F41 Portamento on/off Send 0 for OFF, 7F for ON

    CZ5000

    01 Modulation wheel Send number 00..7F05 Portamento time Send number 00..6306 Master tune Send number 00..7F40 Sustain pedal Send 0 for OFF, 7F for ON41 Portamento on/off Send 0 for OFF, 7F for ON

    4) PROGRAM CHANGE-----------------

    This allows you to change between the preset sounds ( and your internalsounds and cartridges ). Just send C0 plus the channel number, then theprogram number. Eg to set CZ101 on channel 1 to Synth Bass:

    C1 07PROGRAM ch 1 Program 7

    Note that the preset tones are given numbers :

    CZ101/1000

    0..0F Preset sounds 1..1620..2F Internal sounds 1..16

    40..4F Cartridge sounds 1..16

    CZ5000

    00..1F Preset sounds A1,A2,A3....D6,D7,D820..3F Internal sounds A1,A2.....D6,D7,D8

    5) PITCH BEND CHANGE--------------------

  • 8/14/2019 czmidi

    3/11

    This is acheived by sending E0 plus the channel number, then two bytesdenoting 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 thelower byte are not used, and that the central position of the wheel corres-ponds 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 60 00

    BEND channel two ---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 aspecial case.

    OMNI ON send E0 + channel, 7D, 00

    OMNI OFF send B0 + channel, 7C, 00POLY ON send B0 + channel, 7F, 00POLY OFF send B0 + channel, 7E, 00

    OMNI mode plays any MIDI data received at the MIDI IN plug on the back ofthe machine, regardless of channel. POLY mode is equivalent to the SOLO buttonon the front panel. With the CZ101, for instance, POLY OFF ( =SOLO ) allowsthe synth to be used as four monophonic synthesizers under remote control.

    LOCAL ON send B0 + channel, 7A, 7FLOCAL OFF 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 alsomakes sounds at the same time. If you want to do wierd things like keyboardsplitting, LOCAL OFF will allow you to see what the keyboard is doing withoutthe CZ making any sound at all. You could then act on that information and sendthe 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------------------

  • 8/14/2019 czmidi

    4/11

    The CZ5000 has its own internal sequencer, which can be controlled by:

    F8 Clock byte: transmitted 24 times per quarter note ( crotchet )FA Start: same as pressing the PLAY button on the front panelFB Continue: continue song where last stoppedFC Stop: stops song play at current positionFD 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 machine ID some bytes F7SYS EX MESSG YES, YOU DO THIS 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 acomputer/synthesizer dialogue. Note that the computer MUST wait for repliesbefore 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, sendF0 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, sendF0 44 00 00 70 42 47 F7

  • 8/14/2019 czmidi

    5/11

    4) ASK ABOUT PROGRAMMER ( Send request 2 )-----------------------

    Computer: F0 44 00 00 70+channel 19 00CZ101/1000: F0 44 00 00 70+channel 30Computer: 70+channel 31CZ101/1000: data1 data2 F7

    Computer: F7

    data1 is the program selected ( see PROGRAM CHANGE )data2 returns the vibrato/portamento on/off setting:

    data2 00 10 20 30Vibrato OFF OFF ON ONPort'o OFF ON OFF ON

    Eg an exchange such asComputer: F0 44 00 00 70 19 00 "Want data on channel 0"CZ101: F0 44 00 00 70 30 "Gotcha.. data ready"Computer: 70 31 "Ok, give it to me"

    CZ101: 27 30 F7 "Internal 8, v on, p on"Computer: F7

    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 requestComputer: F0 44 00 00 70+channel 10 programCZ101/1000: F0 44 00 00 70+channel 30

    Computer: 70+channel 31CZ101/1000: F7Computer: F7

    Receive requestComputer: F0 44 00 00 70+channel 20 programCZ101/1000: F0 44 00 00 70+channel 30Computer: F7Cz101/1000: F7

    The program byte is the same as that set by the PROGRAM CHANGE function, withthe addition that you can request the temporary sound area as well ( number is60 ). 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 havedone a lot of funny things with these, like splitting bytes in half and encodingthings in wierd ways so please bear with me.

    To keep everything this side of infinite length, I shall adopt the same strategyas the manual, which is to write data in bytes, although they are transmittedin half- bytes. For example, me writing a byte as 5F requires you to transmit orreceive as 0F 05 ( wierd, huh ? ). This will obvoiusly save a lot of space.

  • 8/14/2019 czmidi

    6/11

    So, here goes again :-)

    There are 25 distinct sections within

    Sec# Length Symbol Contents(bytes)

    1 1 pflag line select data, octave range

    2 1 pds detune up or down3 2 pdl,pdh detune range4 1 pvk vibrato wave number5 3 pvdld,pvdlv vibrato delay time6 3 pvsd,pvsv vibrato rate7 3 pvdd,pvdv vibrato depth8 2 mfw dco1 waveform9 2 mamd,mamv dca1 key follow10 2 mwmd,mwmv dcw1 key follow11 1 pmal end step number of dca1 envelope12 16 pma dca1 envelope rate/level13 1 pmwl end step number of dcw1 envelope14 16 pmw dcw1 envelope rate/level

    15 1 pmpl end step number of dco1 envelope16 16 pmp dco1 envelope rate/level17 2 sfw dco2 waveform18 2 samd,samv dca2 key follow19 2 swmd,swmv dcw2 key follow20 1 psal end step number of dca2 envelope21 16 psa dca2 rate/level22 1 pswl end step number of dcw2 envelope23 16 psw dcw2 rate/level24 1 pspl end step number of dco2 envelope25 16 psp dco2 rate/level

    1) PFLAG

    Looking at bits,0000 00 00

    Not used^ OCTV 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)PDSFor 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: 0..15 16..30 31..45 46..60Byte: 00..0F 11..1F 21..2F 31..3F

    The second contains both the octave and note data:

    OCT: 0 1 2 3

  • 8/14/2019 czmidi

    7/11

    NOTE: 0..11 0..11 0..11 0..11Byte: 00..0B 0C..17 18..23 24..2F

    4) PVK

    This is the vibrato wave number, encoded as follows

    WAVE NUMBER: 1 2 3 4Byte: 08 04 20 02

    5) PVDLD,PVDLV

    This is the vibrato delay time, transmitted in three bytes.

    Delay Bytes Delay Bytes Delay Bytes25 19 00 19 50 32 00 4B 75 4B 00 DF26 1A 00 1A 51 33 00 4F 76 4C 00 E727 1B 00 1B 52 34 00 53 77 4D 00 EF28 1C 00 1C 53 35 00 57 78 4E 00 F729 1D 00 1D 54 36 00 5B 79 4F 00 FF

    30 1E 00 1E 55 37 00 5F 80 50 01 0F31 1F 00 1F 56 38 00 63 81 51 01 1F32 20 00 21 57 39 00 67 82 52 01 2F33 21 00 23 58 3A 00 6B 83 53 01 3F34 22 00 25 59 3B 00 6F 84 54 01 4F35 23 00 27 60 3C 00 73 85 55 01 5F36 24 00 29 61 3D 00 77 86 56 01 6F37 25 00 2B 62 3E 00 7B 87 67 01 7F38 26 00 2D 63 3F 00 7F 88 58 01 8F39 27 00 2F 64 40 00 87 89 59 01 9F40 28 00 31 65 41 00 8F 90 5A 01 AF41 29 00 33 66 42 00 97 91 5B 01 BF42 2A 00 35 67 43 00 9F 92 5C 01 CF

    43 2B 00 37 68 44 00 A7 93 5D 01 DF44 2C 00 39 69 45 00 AF 94 5E 01 EF45 2D 00 3B 70 46 00 B7 95 5F 01 FF46 2E 00 3D 71 47 00 BF 96 60 02 1F47 2F 00 3F 72 48 00 C7 97 61 02 3F48 30 00 43 73 49 00 CF 98 62 02 5F49 31 00 47 74 4A 00 D7 99 63 02 7F

    For delays in the range 0..31, just transmit 00..1F, 00, 00..1F eg for delayof 12, send 0C 00 0C. This is convenient since it saves me typing in anothercolumn of boring numbers ;-)

    6) PVSD,PVSV

    Again, here comes another table for conversions. The first column (0..24) isomitted 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 Bytes Rate Bytes Rate Bytes25 19 03 40 50 32 09 E0 75 4B 1C E026 1A 03 60 51 33 0A 60 76 4C 1D E027 1B 03 80 52 34 0A E0 77 4D 1E E028 1C 03 A0 53 35 0B 60 78 4E 1F E029 1D 03 C0 54 36 0B E0 79 4F 20 E0

  • 8/14/2019 czmidi

    8/11

    30 1E 03 E0 55 37 0C 60 80 50 23 E031 1F 04 00 56 38 0C E0 81 51 25 E032 20 04 60 57 39 0D 60 82 52 27 E033 21 04 A0 58 3A 0D E0 83 53 29 E034 22 04 E0 59 3B 0E 60 84 54 2B E035 23 05 20 60 3C 0E E0 85 55 2D E036 24 05 60 61 3D 0F 60 86 56 2F E037 25 05 A0 62 3E 0F E0 87 57 31 E0

    38 26 05 E0 63 3F 10 60 88 58 33 E039 27 06 20 64 40 11 E0 89 59 35 E040 28 06 60 65 41 12 E0 90 5A 37 E041 29 06 A0 66 42 13 E0 91 5B 39 E042 2A 06 E0 67 43 14 E0 92 5C 3B E043 2B 07 20 68 44 15 E0 93 5D 3D E044 2C 07 60 69 45 16 E0 94 5E 3F E045 2D 07 A0 70 46 17 E0 95 5F 41 E046 2E 07 E0 71 47 18 E0 96 60 47 E047 2F 08 20 72 48 19 E0 97 61 4B E048 30 08 E0 73 49 1A E0 98 62 4F E049 31 09 60 74 4A 1B E0 99 63 53 E0

    7) PVDD,PVDV

    These are again encoded as three bytes in a most obscure way. Below 32, theencoding is 00..1F, 00, 01..20 eg for depth 13, send 0D 00 0E.

    Depth Bytes Depth Bytes Depth Bytes25 19 00 1A 50 32 00 4F 75 4B 00 E726 1A 00 1B 51 33 00 53 76 4C 00 EF27 1B 00 1C 52 34 00 57 77 4D 00 F728 1C 00 1D 53 35 00 5B 78 4E 00 FF29 1D 00 1E 54 36 00 5F 79 4F 01 0730 1E 00 1F 55 37 00 63 80 50 01 1F31 1F 00 20 56 38 00 67 81 51 01 2F

    32 20 00 23 57 39 00 6B 82 52 01 3F33 21 00 25 58 3A 00 6F 83 53 01 4F34 22 00 27 59 3B 00 73 84 54 01 5F35 23 00 29 60 3C 00 77 85 55 01 6F36 24 00 2B 61 3D 00 7B 86 56 01 7F37 25 00 2D 62 3E 00 7F 87 57 01 8F38 26 00 2F 63 3F 00 83 88 58 01 9F39 27 00 31 64 40 00 8F 89 59 01 AF40 28 00 33 65 41 00 97 90 5A 01 BF41 29 00 35 66 42 00 9F 91 5B 01 CF42 2A 00 37 67 43 00 A7 92 5C 01 DF43 2B 00 39 68 44 00 AF 93 5D 01 EF44 2C 00 3B 69 45 00 B7 94 5E 01 FF

    45 2D 00 3D 70 46 00 BF 95 5F 02 0F46 2E 00 3F 71 47 00 C7 96 60 02 3F47 2F 00 41 72 48 00 CF 97 61 02 5F48 30 00 47 73 49 00 D7 98 62 02 7F49 31 00 4B 74 4A 00 DF 99 63 03 00

    8) MFW

    These two bytes transmit the waveform for DCO1, and also the modulation iering, noise or none.

  • 8/14/2019 czmidi

    9/11

    First byte Second byte000 000 0 0 00 000 000

    First=1 000 0 00Fisrt=2 001 0 00First=3 010 0 00First=4 100 0 00First=5 101 0 00

    First=6 110 0 01First=7 110 0 10First=8 110 0 11Second=1 000 1 0 00Second=2 001 1 0 00Second=3 010 1 0 00Second=4 100 1 0 00Second=5 101 1 0 00Second=6 110 1 0 01Second=7 110 1 0 10Second=8 110 1 0 11NO MODULATION 000RING MODULATION 100

    NOISE MODULATION 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: 0 1 2 3 4 5 6 7 8 91st byte: 00 01 02 03 04 05 06 07 08 092nd byte: 00 08 11 1A 24 2F 3A 45 52 5F

    10) MWMD, MWMV

    These two bytes set the DCW1 key follow

    Key follow: 0 1 2 3 4 5 6 7 8 91st byte: 00 01 02 03 04 05 06 07 08 092nd byte: 00 1F 2C 39 46 53 60 6E 92 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

  • 8/14/2019 czmidi

    10/11

    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 ifthe level is coming down this step, and that you add 80 to the level if youwish 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 acompletely different encoding scheme.

    byte= 127 x rate----------

    99

  • 8/14/2019 czmidi

    11/11

    andrate= 99 x byte

    --------- + 1127

    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 MFWdoes for DCO1, except that the modulation bits are ignored ( it is best to setthese bits to zero , just in case ).

    18) SAMD,SAMV19) SWMD,SWMV20) PSAL21) PSA22) PSWL

    23) PSW24) PSPL25) PSP

    All the above use the same formats as their counterparts for the first set ofDCO,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 longone :-) ).

    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 || |+------------------------------------------------------------------------------+

    #