Memo DATE 4 October 1986 FROM Jim Merritt, x4592, IIGS Developer Tech Support, M/S TO TapeDeck Program Users and IIGS Seeded Developers SUBJECT IIGS TapeDeck version 0.E: Implementation/Operation Notes Introduction I have prepared an interim version of the IIGS TapeDeck, i.e, Version 0.E, which works with the latest versions of ProDOS and the RAM tools. It should prove useful to developers who wish to experiment with the sound capabilities of IIGS, or who need to record or edit disk-based sound samples that are suitable for reproduction through the IIGS's audio subsystem. This memo contains the germ of a user manual for the TapeDeck, and I intend to develop it into a full user manual by Version 1.0. For now, time constraints have forced me to pass lightly overQand in some cases, to ignoreQmany interesting aspects of the TapeDeck and its use. For expedience, I also assume that the reader understands the material in (or at least has access to) the following IIGS documents: Andrade, G., Sound Tools ERS, Rev. 1.8 Knutson, G., Ensoniq DOC ERS , Rev 1.0, and Cortland Sound ERS, Rev 1 Key Concepts The TapeDeck reserves a large amount of IIGS RAM memory as a "sound buffer," into which digitized sound is stored, and from which it is reproduced. You may think of the buffer as a sequence of recording tape, which is conceptually divided into thousands of smaller segments, each corresponding to a 256-byte page in the IIGS RAM. A memory page is the smallest unit of "tape" that the TapeDeck program can access, equalling roughly 1/16" of tape recorded at 7.5 ips (assuming material recorded at "FAST" speed, i.e. 11). This resolution permits precise editing. When the TapeDeck begins execution, the value represented by the "LocA2" scroll bar is one less than the number of memory pages that have been reserved for the sound buffer. For most systems, this number will hover around 3800 (almost 1MB), and will vary (probably decrease) from one version of the TapeDeck to the next. The sound buffer is also divided into two conceptual segments, "A" and "B." Segment A begins with the page determined by the LocA1 scroll bar, and ends with the page determined by the LocA2 scroll bar. Segment B begins at the page indicated by the LocB scroll bar, and either is as long as Segment A, or else it extends to the physical end of the buffer. The two segments may overlap. TapeDeck supports recording and playback either through the IIGS's own Ensoniq sound circuitry, or through the DX1 digital sound processing board, manufactured by Decillionix, PO Box 70985, Sunnyvale CA 94086, telephone 408 732-7758. Additional hardware, described in Gary Knutson's Ensoniq DOC ERS, is necessary to use the Ensoniq circuitry for recording, so I recommend strongly that you acquire the DX1 board if you intend to record sound samples. By the way, the choice of the DX1 board was based on expediency; it was the only board available to me when I started the project (though I must say that it has performed very well). I will gladly adapt the TapeDeck to other sampling boards if provided with the appropriate hardware. NOTE: Manipulation and playback of pre-recorded sound samples does not require the DX1 board or any other additional hardware. The TapeDeck Control Panel Recording Device: This is a set of two radio buttons, labeled "IIGS Rec" and "Digitizer Rec." The active button determines the device that will be used for recording. Initial device is Digitizer. Playback Device: This is a set of two radio buttons, labeled "IIGS Play" and "Digitizer Play." The active button specifies the device that will be used for playback. Initial device is IIGS. Direction: This is a set of two radio buttons, labeled "Forward Play" and "Reverse Play." The active button indicates the direction of tape "motion" during playback only. Recording is always in the forward direction. In Version 0.E, the direction of IIGS playback is also always forward; this limitation will be removed in a future version of the software. Initial direction is Forward. Output Mode: This is a set of two radio buttons, labeled "Mono" and "Stereo." The active button indicates the number of discrete output channels in use during playback through the IIGS Ensoniq chip, one or two. Note that the TapeDeck permits only monophonic playback through the Digitizer. In Stereo playback, Segment A is sent to the output channel whose radio button is active; Segment B is sent to the next higher channel in numeric order. For instance, if zero is the selected output channel, Segment A information would be played through that channel, while Segment B data would be reproduced through channel one. Initial output mode is Mono. Auto-Repeat: This check box shows whether, during playback, the output sample will be repeated ("looped") automatically until playback is stopped manually. Initially, this box is not checked. Loc A1, Loc A2: These scroll bars determine the respective starting and ending page numbers of Segment A in the sound buffer. They may range from 0 to the initial value reported in Loc A2 at the very beginning of TapeDeck operation. Initial value for Loc A1 is 0, while the initial value for Loc A2 varies as noted above. Loc B: This scroll bar shows the starting page number of Segment B. Currently, the value of this counter is only significant to the Mov A to B Edit-menu function, and during Stereo playback. Minimum and maximum values are the same as for Loc A1 and Loc A2. Initial value is 0. InTrig: This scroll bar indicates the minimum (absolute) value of the first sound sample accepted by the TapeDeck program during recording. It may range from 0 to 128. In general, lower values render the "input trigger" more sensitive, while higher values decrease the sensitivity. Initial value is 0 (i.e., start recording immediately; trigger on silence). OutLev: This scroll bar controls the output level of the playback device. When the IIGS is the selected device, this setting is analogous to the "preamp" level control in a component stereo system. However, this is the only setting that affects the output level of the Digitizer. Values may range from 0 to 255. Initial value is 127. SysVol: This scroll bar controls the output level of the IIGS sound system; it is analogous to the "power amp" level control in a stereo system, and corresponds directly to the system volume setting in the IIGS control panel. This setting does not affect Digitizer output level. Values may range from 0 to 15. Initial value is 8. Speed: This scroll bar determines the record and playback speed for the corresponding devices. Values may range from 0 to 127, although only the values listed in the table below are valid for IIGS playback. "Fast" corresponds to 11, "Slow" to 28. The initial value is 11. Speed is also updated automatically by the Load operation, as mentioned below. Note that it is not currently possible to set independent speed values for record and playback; one speed fits all. SPEED SAMPLE RATE (Hz) ENSONIQ REG VALUE [FR = (FHz* 32 ) / 1645] #1 67718 1317 #2 63508 1235 #3 56425 1098 #4 50863 989 #5 46175 898 #6 42399 825 #7 39150 762 #8 36363 707 #9 33947 660 #10 31822 619 FAST#11#29973#583 #12#28305#551 #13#26819#522 #14#25481#496 #15#24361#474 #16#23165#451 #17#22207#432 #18#21239#413 #19#20431#397 #20#19757#384 #21#18880#367 #22#18306#356 #23#17581#342 #24#17060#332 #25#16630#324 SLOW#28#15058#293 #30#14310#278 #35#12591#245 #40#11207#218 #45#10099#196 #50#9190#179 #75#6351#124 #100#4859#95 #120#4080#79 Fast: When this button is clicked, the speed setting changes to 11. Slow: When this button is clicked, the speed setting changes to 28, which is roughly half as fast as the "Fast" speed. Digitizer Bus Slot: This is a set of seven radio buttons, labeled from 1 to 7. The active button determines the slot in which TapeDeck expects the Digitizer board to reside. Initially, the active button is 3. Output Channel: This is a set of sixteen radio buttons, labeled from 0 to 15. The active button specifies the multiplex output channel to which the output signal from the IIGS will be directed during sound playback. This setting is irrelevant to Digitizer playback. Note that additional hardware is necessary to enable multiplex output. If your system has not been fitted with such hardware, you should never activate any button other than 0. The initial active button is 0. Menu Functions File Menu. Quit returns control to the current ProDOS system shell. Save operates on the currently selected file name (initially "/WORK/MUSIC/SAMPLE.SND" for compatibility with earlier versions of the TapeDeck). Save-As and Load activate a dialog box that permits the user to select a file name. Only the buffer area defined by Segment A (Loc A1 through Loc A2) is involved in a Save, Save-As, or Load operation. During Save or Save-As, should the destination volume contain insufficient space to hold all of the material in Segment A, only the portion that will fit is saved. If the specified sample file already exists, its old contents will be overwritten by the current sample during the operation. If the destination file does not exist, it will be created (provided the specified volume and subdirectory are available). If the destination file is too small for the current size of Segment A, the file will be expanded, as necessary, to the limits of the volume's storage capacity. Should the destination sample file be larger than Segment A, the first portion of the file will be overwritten by the current sample data, but the end of the file will retain old information. During a Load operation, if the file is too small to fill all of Segment A, there will be an area at the end of the segment that contains old sample data. Or, if the file is too large, Segment A will be filled to capacity and the excess information in the disk file is ignored. NOTE: At the end of any Load, Save, or Save-As operation, the actual number of pages loaded or saved is displayed in the TapeDeck control panel window next to the legend "Last Xfer (pages)." Also, the Speed scroll bar is adjusted after every Load operation to match the rate at which the sample was originally recorded. (The original record speed is stored in the Aux Type field of the sample file's ProDOS directory entry.) Edit Menu. The Stop function halts any record or playback operation that is currently in progress. Note that this function cannot be invoked using the mouse during Digitizer playback or any Record operation. In these situations, use the keyboard equivalent (i.e., open-apple-S) instead. The Play function sends sound corresponding to the data in Segment A to the specified Device, at the indicated Speed, in the selected Direction, at the preset Output Level. (Remember that the Direction affects only Digitizer playback. IIGS playback is always in the forward direction). Playback through the IIGS proceeds asynchronously of TapeDeck program execution. You may, for example, play with the menus, move or resize the control panel window, or adjust the controls while sound is playing. However, changes to the control settings made during IIGS playback will not take efect until the sound stops (with the single exception of the Output Level, which always changes immediately after the corresponding slider thumb is repositioned). Record accepts sound samples from the Recording Device, beginning with the first sample that meets or exceeds the specified Input Trigger level. Recording proceeds at the indicated Speed, except that speed values lower (i.e., faster) than 11 are ignored; 11 is the fastest recording speed supported by the software. Samples fill the Segment A area in the buffer. NOTE: If you abort recording or Digitizer playback by pressing Open-Apple-S, the address of the page being accessed at the time of the keypress is reported in the TapeDeck control panel window next to the legend "Last Abort at page." Copy A Seg to B copies the information in Segment A to an area of the same length that starts at location Loc B. Note that Loc B may lie inside Segment A; TapeDeck doesn't care about overlap between the two conceptual segments. If part of the conceptual Segment B extends past the physical end of the sound buffer, the part of Segment A which would be copied into memory outside the buffer is not copied. Erase fills Segment A with "pure silence." This function is useful for "preconditioning" the sound buffer prior to recording, or for cleaning up unused areas of the buffer. Known Bugs If a serious ProDOS error (i.e., media or device failure) occurs during disk Save or Load, TapeDeck may refuse to process subsequent Save or Load operations. For instance, if you inadvertently eject a disk during a Save operation, it may be necessary to reboot the TapeDeck to restore the Save and Load functions (although recording and playback should remain unaffected). Under normal operating conditions, this bug should never bite you. For now, the Loc B slider should always be set to zero during Save or Save-As operations. If it is non-zero, the original recording speed of the sample will not be saved properly into the sample file's auxilliary type. This bug occurs because of a limitation in the ProDOS-16 version 1.0 operating system. Contrary to claimes made in the ERS, version 1.0 does not maintain a four-byte auxilliary file type; instead, it manipulates a two-byte quantity, just as ProDOS-8 does. TapeDeck version 0.E attempts to store the Loc B value in the upper word of the auxilliary type (and to restore this value from the aux type field during Load operations). Storage and retrieval of the Loc B counter would make the maintenance of stereo samples more convenient. Unfortunately, aux type values wider than two bytes are disallowed by ProDOS-16 version 1.0, and so the aux type field of the sample file remains unchanged (e.g., zero for a newly-created file) whenever the Loc B value is greater than zero. During stereo playback only, a mysterious system bug appears to redirect output from one channel to the other at the very end of the sound sample. For a brief instant, one channel goes dead while the other seems to play the combined information for both channels. The workaround for this is to make sure that you load (or record) your sample into memory that has been cleansed with the Erase command. Be sure that you leave identical amounts of "silent space" at the ends of both Segment A and B. (Between 16 and 64 pages at the end of each Segment seems right for most samples and playback speeds.) The bug's effects will be masked by the fact that the "combining effect" at the very end of playback will apply only to silence and so will be inaudible. The current implementation of the Sound Tools imposes an audible delay between the launching of sound playback through the DOC chip and the appearance of the corresponding signal on the DOC output lines. The delay varies primarily with the size of the RAM buffer reserved in DOC memory, and corresponds to the time necessary to fill that buffer. Software must compensate for this delay during multiplex output, or else the sounds coming from the several output channels will not be properly synchronized. Unfortunately, the degree of compensation necessary also seems to vary with output speed, and must at the present time be determined empirically. A close approximation to the proper amount of delay compensation has been found for TapeDeck speed 15, but full automatic delay compensation for stereo playback will not be available until version 1.0. If you use copyrighted material in public demonstrations, please be sure to clear the rights to it with the appropriate copyright holder or licensing agency. Acknowledgements Thanks are due to Gus Andrade, Gary Knutson, Dan Oliver, Jay Schaffer, Jean-Charles Mourey, and Curtis Sasaki, whose efforts and cooperation made it possible for me to develop the TapeDeck in a timely fashion. Special thanks to Scott Knaster, whose implicit support of this project from the very start provided me the freedom to "do it right."