You are on page 1of 67
CASIO DIGITAL SAMPLING KEYBOARD MODEL FZ-1 DATA STRUCTURES (For Software Developers) fi { PREPARED ON: MARCH 16, 1967 ORIGINALLY WRITTEN BY: T. SASAKI - R&D TRANSLATED BY: 0. ISHIYAMA - OVERSEAS DIVISION CASIO TOKYO nd Table of Contents Outline of “Disk” |, Fundamental Format ‘2. Head Format ~3. Directory Format 4. File Format 5. Data Packing Outline of “Parameters” 1. Details of Voice -2. Details of Bank 3. Details of Effect Outline of "Dump" Procedures for Dump . Outline of External Port Details of Remote Code . Details of Open Code Details of Data Code . Details of External Port Hardware Outline of MIDI Details of Remote MIDI Details of Open/Close MID! 4 Optional Software 4-1. Expanded Programs 4-2. ROM Entry 4-3.- Work Address Oyanuwe 27 28 29 31 33 35 36 40 42 42 45 46 46 47 ! Outline of “Disk” A floppy disk drive unit is built in the F2~1 machine for use with high-density type 3.5° micro floppy disks. The disk drive is used for inputting/outputting data and parameters and also for loading expanded software programs, Fundamental Format Head Format Directory Format File Format Packing Data 1-1. . Fundamental Format The system program which is installed in the F2-1 machine hes 6 format created on the basis of the IBM format and the F2-1 formats a disk: Double sided, 80 tracks, 8 sectors/track, 1,024 bytes/sector The total capacity comes to 1,310,720 bytes loc @: head - 4 sector to be used for system 1: dir - 4 sector to be used for file names 2- 1279: sectors to be used for data ee } A logical sector Jac whose formula is as shown below is occupied with headers, directories, and data. loc = (16 x track) + (8 x head) + (sector ~ 1) truck; 9-79 head: oo-1 sector: 1-6 1-2, Head Format Head data, consisting of Disk Identification 2/sk /2 and Cluster Allocation Table £47, is placed exclusively at the logical sector 2, Disk ID CAT a) Disk ID (128 bytes) ~ Disk Identification Disk Name (12 characters) 2 Password (12 characters) eee unused [ee The Disk ID identifies a disk with the record of a disk name and a password. iyi b) CAT (768 bytes) - Cluster Allocation Table MSB \ LSB Ny c7 Co IC1S ca Clac; "1" for Used, “e" for Unused. The CAT indicates a status for entire sectors; The figure “1" denotes entire sectors are already used and “sg” denotes not yet used. The correspondence with sectors is the sequence from LSB to MSB, and from Low address to High address. The logical sector /ac verifies these by the formula: Ogloc<1279 If a figure @ is obtained from the formula CATIloc/61&(1<<(loc®8)), then the entire sectors are not yet used. If it is not #, then they are already used. C3 1-3. Directory Format The Directory date @/r is 8 sector where records file names, identifications and start logical clusters 6re recorded and placed exclusively at the logical sector 1. Dir 8) Dir data File Name (12 characters) ext sloc The Dir data consists of 16 bytes per file and 4 piece of floppy disk can store up to 64 files. The portion of a file is shown above. b) File Name: Consists of 12 characters in the ASCII standard. The blank(s) is filled with SPACE (2ah). If the first 1 byte is NULL (aah), then the directory is regarded &s blank. c) ext: A figure for 2 bytes indicating the data contents in the file. The lower byte denotes date content in each file, and the higher bytes denotes a file address. The F2-1 allows you to save/load waveform data uninterruptedly on 2 pieces of floppy disk. The higher byte for ex? takes & ‘as value for the first floppy disk and does 1 for the second disk: Lower Bi e for ext Date Content Full Dump Data Voice Data Bank Data Effect Date Sequence Data Expanded Program Data anwn-® d) sloc: Denotes Start Logical Cluster, a logical sector heading the data which upcoming file will contain. 1-4. File Format A file consists of a file head (1 sector) end file contents (N sectors). Each sector starts from the sector designated by ir and the location of each sector is assigned at random over the entire erea of a disk by the aaF (data Block Pointer) in the file head. A File Head LAA | File Contents 8) File Head: A file head consists of 4 dBP area (256 bytes) and a work area (768 bytes). The dBP (date Block Pointer) consists of a s¢ (Start Sector) and es (End Sector). These are pointers of 2 bytes each existing in the logical sector; ss points the head and e¢ points the end of each sector even when file contents are randomly located over the entire area of a disk. There exists 64 dP’s in a dBP area, which is @ cluster of dBP’s. A file will end if 6 dBP of ss=es=a exists or when all the 64 dBP’s are consumed over. (256 bytes) dBP Ares (768 bytes) L ~~ J Work Area Sane dBP ss es b) File Search: The FZ-1 searches a file in the following method: File Nome ext | sloc a) (2) bo s6a ess |sstest la a iad ae (3) - pwr . (1) Searches with Qyr to find a file by the file name and eyz. (2) Learns from the file s/ac which sector contains the file head and reads data from the sector ssg to the sector esa. (3) Reads date from the sector ssi to the sector es! by the designetion of next dBP. (4) The file ends when the next dBP comes to ss2=es2=a. A~aYVs 1-5. Data Packing All data are structured by 1,024 bytes into 4 block. The portions which ‘are divided by the block bytes will be explained with charts according to the file date. Files in general are randomly located in a whole disk area; however, the illustration shows files in consecutive locations. A parameter classification which is used within a block contains nothing but a file field for the dump over External Port and MIDI. Refer to the Outline of Parameters for the detailed contents of Bank, Voice and Effect parameters. xx (nn bytes) Chart ~ Legends: 4) The big box denotes a block of 1,024-byte data. b) The classification inside the box indicates that “nn” bytes are consumed for “xx”. c) The rectangule without upper line shows that block will follow after the block. d) Itemized explanation will be provided with n arrow out of 4 box if the classified box is too small. pleces of the same b) Full Date ext=2 File Head dBP (256 bytes) vn} bn} wn Unused (762 bytes) |_\ wave number (2bytes) LS bank number (2 bytes) Bank Data(656 bytes) Hl bn VoiceData(! 92bytes) IL (vn+3)/4 WaveData( 1 024bytes: voice number (2bytes) Bank Parameters (a bank/block) Parameters for 6 Bank are packed into “bn” pieces of block. Effect Parameters ere located only in the first deta block and occupies 6 24-byte area after the 960th byte in the block. Effect (24 bytes) Voice Parameters (4 voices/block) Every 256 bytes of Voice Parameters are packed into a block. The block contains data fof 4 voices and occupies (vn+3)/4 pieces of block. PCM Waveform Data (512 samples/block) Date for 16-bit waveforms ere packed into blocks occupying “wn” pieces of block. One sample consists of 2-byte data and the upper byte is positioned in the higher address c) Voice Data ext=1 File Head BP (256 bytes) 1 a wn L_\wave number (2 bytes) Na constant @ ( 2 bytes) aconstant 1 (2 bytes) File Contents VoiceData(192bytes)| Parameters for a voice are located, WaveData(1024bytes} PCM waveform date (512 samples/block) Sixteen-bit data for waveforms is packed ‘and occupies “wn” pieces of block. wn @) Bank Data ext=2 File Head dBP (256 bytes) va [1 [wn |__\wave number (2 bytes) Unused (762 bytes) Na constant 1 (2 bytes) voice number (2 bytes) File Contents Bank Data (656bytes)} One bank emount of Bank Parameters is located in this block. Voice Data ( 192 bytes) Voice Parameters (4 voices/block) + Every 256 bytes of Voice Parameters are packed into a block. The block contains data for 4 voices 1} and occupies (vn+3)/4 pieces of block. ~ (vne3)/4l WaveData(1024bytes| PCM Waveform Data (512 samples/block) Data for 16-bit waveforms are packed into blocks occupying “wn” pieces of block wn 2) Effect Date ext=3 File Head dBP (256 bytes) g a ga File Conte nts Co @ constant & (each 2 bytes) Effect Parameters occupy a portion of 24 bytes succeeding to the 960th byte in the block. File Head 1) Program Data ext=5 Effect (24 bytes) dBP (256 bytes) File Contet nts: wn a | a | wn i \ wave number (2 bytes) a constant & (each 2 bytes) Program Data The object code of VSO (8086) is packed into and occupies “wn” pleces of block. Program Data cannot be transfered over MIDI or External Port. 2. Outline of “Parameters” The FZ-1 is provided with 3 different parameters for Voice, Bank and Effect. This chapter will explain the details of each parameter. Parameters Voice Parameter ;-] Bank Parameter Effect Parameter 2-1. Details of Voice Voice data is an assemblage of the parameters which point an address on the PCM encoded waveform memory, an address of the loop, or determines the envelope curve corresponding directly with a PCM-sampled waveform or a synthesized waveform. The size of parameters 1s 192 bytes and total data of the voice parameters occupies the area of 12,288 bytes maximum since the FZ~1 internal memory can contain up to 64 voices. in the work eree voice parameters start with the label named “voic™ to be addressed by every 192 bytes in the sequence from Voice 1 to Voice 64. The content for these 192 bytes is shown in the listing “basic data structure define”. It is defined as a structure of “C” of which name is “struct voicedata”. The 2-digit hexadecimal numbers existing in the most right end of comment columns are the offset addresses when the header for voicedata is set to 8. The byte sizes for each parameter factor are Jotig:4 bytes, int: 2 bytes, short: 1 byte. If e data requires multiple blocks, the byte size will be N times as big as this. (MAXE is a constant 6 in this case.) For each byte, a higher byte is positioned at the high adress. List A: Basic Data Structure Define struct voicedata ¢ besic-data structure define — eng wa vat re wavematarraddress iE waved; na ond ones, ——gensts ~/t-generator—start~address—-09e, genedi i end oce- > int Loop 7* ga mode status (see gaa) 10+ ere $xToop-sustatn-nunber—{0-3)—t2e7: eneeE lochaends 7+ loop end number (O-$) 136. yong Hoops t-tniaxea;-—re-toop-start—address—————T4n ; ys son pissbt2 for leop fine #/ ‘Long: —Looped EMAXKET;- e#—Loop—end- address: Bat j 7a ce bis For jumploop Fig en ie La0pxfeMAXEl+—/s—loop—x feed time sar Unsigned int looptmcHaxXel;,/ loop time ( or times) eanes Vane dcp: ye dep volce pitch vith detuneT4¥/! | ghort——————der-_>_—va-frequency-offiset-value 7 6er! sib: aa ye filter @ offset value TT#/" hort dea_eus; 7* dea envelop sustain point, 7897! eee eae reenee } short dca_rateC(MAXE]; /* dca envelop rate value Aes) | tins tgned-short-deazstaptHAXEl+~/+—dea~envelep-atop-value——Oee/ shored sus; ___#4-def-envetop—sustain-point—err | short,” def_end; 7¢* dof envelop end point BDe,! share —detipavetnaxeiy—/e-def-envelop-rate-value———Bcey! Unsigned short defastopCHAXEl; /* def envelop stop value © ~ 94471 Unsigned Int 1fo_delay; ye fo delay time 1 yy 4 9087" tnetgned-short—tforname iro-uavertormdetine ea} ger’ unsigned ¢e ifo attack value ores Sher pe-tfe-pate-t-tine-inerement—JA0"/" shore 7s ife plteh depth ates hone fa-Lte-amp-—depth— Aex/' shore 7s leo ttiter depth Eons 1 to deq¢-—_- 4-1 hott eter depth short velideq_kty /* initial touch deq fellow short 7» dea keyboard follow depth Ag#/* Shere en tcanotenate-seating-deptheatey short 7 7* def keyboard follow depth A8*/ ~—shont——_—-_de§nsj da f_noterate—scal-ing—depth-Agty —short——____ /+—initial—touchamp—key—followAAt/ short 7* Anitial touchamp rate scaleABe/ short —/e-initial—touchdcf-key—followaces short vel_def_rs 7* initial touchder rate scaleADx/" unsigned short huid; 7+ high width MIDI code AEN /: —unsigned-short—1widj————_/+low AFA, unsigned short centi 7* keynote centor BOx/ unsigned short samp; /* sampling frequency - Blas” char nameCt43 7s uave name 4— —/4-total-byte--— 060 wavst, waved genst, gened Joop Toop’ sus loop end - ~ Shows the head and end addresses of a PCM encoded waveform data for a designated voice by a Word Address. wavst [gdLl[adH]: “a” is input in their upper 4-bit portions after one byte of dete is developed into lower 4 bits and into upper 4 bits. {Msuml: Denotes ® check sum. The volue comes from the logical AND function on “7F and “a compliment for 2” of the total addition number for developed 126 bytes. Same as Disk or Port, 1024 bytes of data are regarded as a data unit. For the transfer of this, 8 transaction between the Date MIDI and the OK MIDI repeats itself 16 times. Refer to the outline of Parameters for the details of Data and also refer to the outline of Disk for the way of packing data into 1024 bytes. D) Details of Effect MIDI [Fall 44llo2Maall PN)... 7 Blond EMV bool 7] “en” denotes an effect number: The number ga for the bender depth, and the numbers #1 and #2 ere unused. “vy" denotes a value among the figures og thru 7F. en Mo pitch fo emp. Mfa filter dea def mod w 3 24 25 a? 68 Toot v aA 28 at BE oF after t " 12 13 15 16 Note: Exclusive info for Effect is transmitted the same way as the Control Commands. E) Details of Close MIDI The Close MIDI is 6 MIDI System Exclusive Data which will be transmitted to the data receiver succeeding to the end of Data MIDI transfer. [Fell 44]le2llaell 7)... el? WeneeemdF Al 4. Optional Software The F2-1 is capable of loading expanded software and executing the program. This chapter offers specific knowledge on the FZ-1 to developers of optional software. Expanded ROME Program rr wal Work Address Prograrn Example 41 Expanded Program The FZ-1 features that the deta in 6 program file (ext=5) on its disk can be loaded to en address 6000h and after in the memory of the CPU work area and the FAR CALL to the address 6000h cen be executed. The F2-1 installs VSO chip (of NEC make) for the CPU. Since the V50 is upper compatible at the code level with Intel's 6086, you can develop Programs on the chip 8086, 8 much more popular micro processor. The tools necessary for development of programs will be: a) Assembler and compiler for V50 (or 8086) b) Conversion tool frorn Object File to F2-1 Prograrn File For the details of F2-1 Prograrn File, refer to the Outline of “Disk”. Expanded programs should be crested at 6000h for its execution address ‘and the 36k byte area (6000h ~ EFFFh) can be used. 4-2. ROM Entry The F2-1 is well designed so that every sub-routine existing in the firmware can be utilized with Break. The sub-routines are named by function nurnbers, There exists two types of parameters for each sub-routine; some are given in stack and the others are given directly to the WORK AREA. A sub-routine which returns a value has always a value in BW (BX for the 6086). Registers which are retained at all the sub-routines are nothing but SP and BP. The segments except DSI are retained. An example of a sub-routine call is shown below: Function No. St mpx (dt, d2, d3); L push DSe:WORDPTR d3 push DSge:WORDPTR d2 push DSa:WORDPTR d1 push “51 BRK 3 ADD SP, #8 Succeeding to the push to stack behind the parameters and the final push of the function number, the command BRK 3 execution makes it possible to call “mpx" the sub-routine within the ROM, 4-3. . Work Address The work addresses to be used for the FZ-1 will be shown in the list For details of each work, refer to the detafls of F2-1.Work, List E: 6 pata orc o4oon Keyéount ~~ “pps aye lastresp DBS 1 Keymap 3s ech eee 2 olddca 16 neudea 16 key 1 = — T 1 .4 —~ 4 2 ES _ 2 es 2 1 1 8 8 _ a t 1 3 0463 part pes 3 2 46D nowled DBs 1 046e rand pes z 0470 jump" ~ DBs 2 oa7e _ 0473 a 0476 1 0477 - “y 047A 1 rr 3 oa7e 1 oa7F =o a OABR 2 ” oae4 “3 0486 a o4ee 2 048A 2 roms 0150 a 04sE 2 0490 2 oagse 2 0494 2 0496 4 0432 ppist ~~ 04p6°~ ppted 043A ppast wo gage paar oace meount O4CH mievel— 0406 peek min Rg bbo “be Lipos leur hd opp trig hie gain Rate length siatabrs— deviuin 0520 restat “o5ae7 - Rendde ose4 cat ~ a16e™ xysheet vores_nuin bank_num “wave num cny_sta ‘env=pes env_np - ‘08D “wens ize mi mo “>. DBs ~ egg mm 1 2 godtime ses 4 oldtine DBs 4 2 2 tempo DBS. ~hastértune "DBs 2 wsaki/nx336/ext/a “70116 Assembler, PAGE LOCATION OBJECT CODE LINE SOURCE LINE _ : ove pes _ 2 ~ ODFE~ DBs 4 ___, oe02 pps _2 a E04 DBS 4 . oz08 Das S248 = 2203 — DBS ieee 5288 _. ____ DBS. 4 S200, pes 4 woe 5420 _DBS_ 4 ty "880 pss 2 Ne sere Das 2 Bs ce ssa 1-Z3 | Fe 2d al 2 x gna ndd Sr rc | 2b ee z =e 8 2 § LT aan| om] hod Lisa 0d od 10d (@300N SSze) L-9seo12 adn [od ss 3 9 s 2 @ , 8: 3 a 2 2 SHIT -sygn0s——sn BaF 133 BT povs set ersor-os ui sew om = = sayguee2® ston oawnovdetistnan LiL ‘nnwononss8 yur /-24 ~~ © aovd geet ee@t@t Lt ew ont cezaueg (£9-0) seqenu (120) saqunu queg Ae: ~ yxbuay puon aud feud auy pauorsun f 93T0A Puorad fUAe PIED s>;OA 13RGIs [seeasesaaeneneneseee Ly [auyrmAq-Ourpuozed Jedeeeeeaannanassense 9% "ON NOTLONN #40 yabuay puosed ead 22t0n piosed UA £ USTTRSUENg-gNUTIGSSySIUT ue 46 02 pueauos iseis puczes puss Jasenenesnsagseteaten 9° “ON NOLLONAY saeraeeeserers . Jenneneeseateaeeneens SON N ants suruuna ey sz op ezsrerasur a 4g er Fuss Han Jeesasenenanen waeeee fF 7 haypow 2 e 2 (2-0) dequny soreseuss + Zi soueus spe! 2 “ a res Jue pune a oz — : drew 2h “ON NOLLINNA eeeneasenseoensessee/ ys a wones a fs u 2 a 3 ay itty. 30097ASK:HONOL = A a5Te eee aoueus sou /youNa =A dF os susues399_4/ uw Sn EE ee - amrextususa71 t G-0 Aeyues 7 ae aU{yap souaatns tesues -2o--== arnt peenansnnenenee ow Frm youva__ (63 24 youwaes nap a3etes. Ws: [senteensecaeennesens 12 “ON NOTLONAS, stasscennnnenne/ | seg © zeei sevet L ayp uy sued atts yous suetazuny Usues 1 ameu ESI ‘ON NOLLINIG seeseeaseaaeeweneeees “--————" 1q1H" Lud" SLO Hues WRAaAER 484s) Wasa ea HST TEESE 355 BET—ON-NOT. eiep Uod Josssie tnany Jasenneneneenseneess LEL “ON NOTLONNS eneeenes ‘guony7ss2appe—eaep—ans— pete eee] fC paras yaatanzans : 9Gesn eiep uod dessa zetnantes : Jatesesennenersnnezes “9E1 "ON MOE prsrrancuys— aes 9 seg © Lest S2:8t ueyisuny— 9 e6eg © 961 Serer L 4 seg * Leet s2:8t (22kq) unos erep pues daauyed e1ep pues 2¢ 9a a6esn ung e6esn- puny sueu (aakqy unos Pay eiuyod eeS ASST ETRE TT TERE [beneeeeeeeaceenseeee £22 "ON NOLLONNS tesaeeneensneneaagee/—— eying shaasa tynae seus a6esn [eassaanesanesee yung Jeaasasaeeneenes: 3ygnq oak seguna aka 352 (Cseappe au Tsar ps6 teed posed usenieq ure ¢ Deane eaeeennesaee ee y=2ywunos-asyseaeGs ‘Stuy Piep iusauo> !p auy peudtsun 01 eOeg © 296i serait

You might also like