Path: blue.weeg.uiowa.edu!news.uiowa.edu!uunet!winternet.com!drift!irsman From: irsman@drift.winternet.com (Ian Schmidt) Newsgroups: comp.sys.apple2 Subject: Apple II Music and Sound FAQ v2.0 [lotsa new info!] Date: 12 Oct 1994 22:46:22 GMT Organization: Cygnix Worldwide, the tunage guys! Lines: 591 Message-ID: <37hovu$gmj@blackice.winternet.com> NNTP-Posting-Host: drift.winternet.com Presenting: The Apple II and IIgs Music and Sound FAQ, Version 2.0 (12-OCT-94) Written by Ian Schmidt (irsman@iastate.edu) Thanks for corrections and updates to Joe Walters, Dave Lyons, Dave Huang, Mitchell Spector, Scott Gentry, Mark Lyon, and Allan Crout. Send additional questions/comments/blatent error reports to: irsman@drift.winternet.com A quickie what's new: Fixed a glitch or two in the Other Systems table. Added new information to the history section. Added the 8-bit II Cards section. Fixed the usual typos. Table of Contents: This FAQ includes an indexing system. To find any section, search in your favorite editor for the characters ~~ followed immediately by the letter code of the section you want. Sections with new/clarified/changed material have | before them in the index. Section What ---------------------------------------- |AA An introduction to music and sound AB Types of sound files used on the IIgs. AC How to digitize sounds AD How to edit sounds AE Types of music files BA An overview of SoundSmith-style editors BB An overview of MIDI CA Technical specifications for the IIgs Ensoniq chip DA About IIgs stereo cards EA About 8-bit II sound cards. |FA What about them other machines? And video games? ----------------------------------------- ~~AA An introduction to music and sound on computers. Music and sound have been a computerized pursuit since at least the 1960s, when enterprising hackers discovered that by programming the large mainframes of the time to do different operations, different tones could be generated on a common AM radio from the interference (this is still a problem today :-). The first musical synthesizer was the telharmonium, built in 1906 by a man named Thaddeus Cahill. The actual instrument was located nearly a mile away from the concert hall, and consisted of a bank of 145 alternators to produce various strengths and frequencies of sine waves. Each alternator produced from 12 to 15 kilowatts of power to drive speakers. The telharmonium was played via a 2-manual (ie, 2-keyboard) organ-style console, and featured velocity sensitive keys (the sound was louder the harder the keys were played). Early synthesizers developed in the 1960s (known as Mellotrons) consisted of a huge bank of tape loops, with each key playing a different tape. Primitive analog tone generators were also in use. These early synthesizers first got wide industry exposure via Walter aka Wendy (never mind) Carlos' "Switched-On Bach" album. At this time (mid to late 60s), Robert Moog developed the direct ancestors of today's synthesizer. Moog's synthesizers were programmed via 'patch bays', wherein the user would connect a series of jacks in a specific configuration via patch cords to get a certain tone. This use of the word 'patch' for a sound setting on a synthesizer persists, despite that today a 'patch' is usually a data file stored on disk or in ROM. The Moog's debut in a Top 40 song was Del Shannon's "Runaway". A Moog was used along with a tube-based analog synthesizer called a theremin in the Beach Boys' classic "Good Vibrations". The possibilities of synthesizers weren't really exploited until the onslaught of 70s 'art-rock' bands such as the Who, Supertramp, ELP (Emerson, Lake, and Palmer), Genesis, Yes, Pink Floyd and Rush. Synthesizers have continued to advance to the point where they are now the only instrument needed to make a typical Top 40 or rap album. This was foreseen somewhat by Boston, who included a "No Keyboards!" logo on one of their early albums despite the obvious inclusion of a Hammond organ on several songs. Computer control of music developed somewhat later, however. Several companies in the early 1980s had competing systems for allowing electronic synthesizers to interface to computers and each other, Oberheim being one of the more notable. Around 1983 or so, a group of companies developed the now ubiqitous MIDI (Musical Instrument Digital Interface) standard. It is now very difficult to find a synthesizer without MIDI capabilities, and all popular computers can be interfaced to MIDI instruments, including the Apple II. The first development after MIDI was introduced was the "sequencer" program, a program which allowed the recording and playback of MIDI data streams, as well as sophisticated editing functions. This allowed perfect playback of songs every time, as well as more advanced functionality such as the ability to synchronize MIDI data with SMPTE (Society of Motion Picture and Television Engineers) time code, a fact which made it very simple to add MIDI-based music to television shows and theatrical films and synchronize to a resolution finer than 1 frame. SMPTE and MIDI were used heavily in the production of the soundtrack for the recent blockbuster "Jurassic Park" for example. At about the same time as the first sequencers were arriving, computers began to get sound chips with some semi-decent capabilities. Machines such as the TI-99/4A and Atari 800 had chips capable of playing at least 3 independent tones at any one time. However, the tones were preset, usually to a square wave, which has very little musical interest. This went to the next step when a young engineer developed the SID sound chip for the Commodore 64 computer. The SID chip could play 3 tones at once [plus 1 channel devoted to 'white noise' percussive sounds], and each of the tones could be selected from a range of several waveforms. In addition, advanced effects such as "ring modulation" were avalible on this chip. The C=64 soon allowed many to compose some amazing tunes, but the best was yet to come. The engineer who designed the SID went on to join a company called Ensoniq, where he designed the DOC (Digital Oscillator Chip) which powered the company's now legendary Mirage synthesizer. The Mirage was unique in that it was the first major synthesizer to offer sampling, wherein you could digitally record any sound you wanted, from trumpets to snare drums to water dripping, and use it as an instrument. Best of all, the DOC chip could play up to 32 samples at any one time, making it useful to emulate a whole orchestra with one Mirage. Now, to get some Apple II-ish relevance. During the design of the Cortland (aka IIgs), Apple was planning on using a chip not unlike the one on the Mac II series. This chip played 4 samples at once, but was limited in it's stereo capabilities (you got 2 samples on the left, and 2 on the right, and that's it) as well as overall flexibility (it's limited to 1 fixed sampling rate of 22,052 Hz). Luckily, Ensoniq sent a sample of the DOC chip to Apple, and it ended up in the hands of a music enthusiast working on the IIgs project. This engineer fought with management until they decided to use the DOC chip for the IIgs. Originally, it was to be an extra-cost option, but it later was made a standard feature, something we can all be thankful about :-) Back to generalized things, the next development was to combine sampling and sequencing software on capable computers. This resulted in the *Tracker genre on the Amiga, as well as Music Construction Set, Music Studio, and other programs on many platforms. These programs typically had a sequence file and a series of sample files used as instruments, with some notable exceptions (the *Tracker series on the Amiga had all-in-one 'modular' files, hence the name MOD). ~~AB Types of sound files found on the IIgs Several types of sample files are used. Here are the most common. Name Extension FType Description --------------------------------------------------- Raw no std. BIN Contains only raw sample data. The auxtype is normally the sample rate divided by 51. (See section CA for more on why this is). ACE .ACE $CD Contains raw sample data compressed with ACE, Apple's Tool029 sound compressor. ASIF no std. $D8 Contains sample data plus additional data. Notable due to its use by SoundSmith. AIFF .AIFF $D8 Interchange format popular on the Macintosh. Not used much on the IIgs. HyperStudio no std. $D8 Contains raw or ACE compressed data plus additional information. rSound no std. $D8 Resource fork contains one or more rSound and rResName resources. Used by HyperCard IIgs and the Sound CDev. ~~AC An introduction to sampling Sampling is conceptually simple; an incoming analog sound signal is converted to a digital number (0-255 on the IIgs). Getting good samples depends on a number of factors: o Sampling rate. This is how often in samples per second the incoming signal is actually noticed and saved. In general, you want to have a sampling rate of twice the frequency of the highest pitch sound you intend to sample. (The reasoning behind this is known as the Nyquist Sampling Theorem). Compact discs sample at 44,100 Hz, which means they can accurately track signals up to 22,050 Hz, beyond the range of human hearing. Long-distance telephone calls are sampled at 8,000 Hz, since the characteristic part of human voices is generally from 1000-3000 Hz. o Stereo card quality and shielding (the Audio Animator makes the best samples of any card I've tried, by far). o Input signal level (the higher the better, except that there is a threshold known as the 'clipping level' above which the sampler will be unable to track the signal. Analog tape recorders do something very similar). Once a sample is made, it can be manipulated in a variety of ways via mathematics. Because this processing is digital, no degradation of the signal can occur, unlike with analog processing. Some effects which can be done include: o Cut and pasting parts of the sample around. o Mixing/overlaying two samples. o Flanger/Chorus effects. o Amplification and deamplification. o Echoing o Filtering and equilization and much more...check out a modern rack-mounted guitar digital signal processor for all the things possible :) To digitize a sound (I'll use AudioZap as the example, others are similar): o Hook everything up. o Check the oscilloscope. The wave should be barely touching the top and bottom of the 'scope. Any higher and the sound is clipping; any lower and you'll get a poor quality recording. Adjustment methods vary by card; for the Sonic Blaster card AZ can adjust it in software. Otherwise, consult your card's manual. o Select a recording rate (lower numbers on AZ = faster). o Click Record and cue up your tape or CD. o Select Ok and then start the tape or CD. o Click the mouse and stop the tape or CD when you are done. You've just made a sample! congratulations! Experiment...you can't hurt anything, but may discover fun/neat things to do! ~~AD Some basics on editing sounds. (This section attempts to be program-independent, but in some cases specific refrences to AudioZap may sneak in :-) I'll assume you now have a sound loaded up, and whatever program is showing you a nice wave graph. Now, you can pick out portions of the wave by simply clicking and dragging the mouse over a part of the wave, and letting go when you have as much as you want. If you now try to Play, you'll only hear the portion you have selected. If you need to adjust your selection range, many programs allow you to shift or apple-click and extend the endpoints instead of just starting over with a new range. Once you have an area selected, you can cut/copy/paste/clear just like you would text in a word processor. When pasting a waveform, you simply click once where you'd like, and select Paste. The program inserts the previously cut or copied piece of wave and moves the wave over to make room, just like with a word processor. For more specific information, consult the documentation for the program you use. ~~ AE Types of music files Name Extension FType Description --------------------------------------------------- MCS None MUS Music Construction Set tune. TMS .SNG BIN Music Studio song. SS None MUS SoundSmith song. NTMOD None INT NoiseTracker GS module NTSNG None BIN NoiseTracker GS song. MOD None $F4 Amiga ProTracker module ($F4 is temporary). MIDI .MID MDI Standard MIDI file. ------------------------------------------------------------------------------ ~~ BA A brief overview of SoundSmith style editors. SoundSmith (and all other MOD derived editors) use a very simplistic way to representing music, to wit: 0 C5 1000 --- 0000 1 --- 0000 --- 0000 ... additional tracks here 2 G5 33FF G5 53FF 3 --- 0000 --- 0000 4 C5 1000 --- 0000 This is often known as a 'spreadsheet' format since there are rows and columns much like a spreadsheet. Let's take a look at an individual cell: Number of cell | Instrument number | | Effect data | | /| 2 G5 33FF /\ | || Effect number || Note and octave For this note, it's #2 of 63 in the pattern, it's a G in octave 5, using instrument number 3, effect 3, and data FF. What effect 3 actually means depends on the tracker in question. On SoundSmith and derivatives, it means "Set the volume to --", in this case set it to $FF (255) which is the maximum. Now, into a larger structure. 64 lines of cells makes up a block, or pattern as it is sometimes called. (MED on the Amiga allows blocks of varying lengths, but we won't consider those here). You can terminate a block early with a special effect. On the Amiga, an actual effect number is used. On SoundSmith, entering the note/octave as NXT makes that line of cells the last line played in that block. Now that we've covered cells and blocks, we can get into the large-scale structure of things. To make a complete song, we can give the player a 'block list' which tells it to play a specific sequence of blocks in a specific order. For instance, we could have it play block 4, then block 0, then block 1, then block 2, then block 2. An entry in the block list is known as a 'position'. MOD-derived formats typically allow 128 positions, and 64 (MOD) or 71 (SoundSmith) blocks. A Practical Example: Crank up MODZap 0.9 or later and a favorite tune. Set it to the "Classic Player". Now, remember those numbers you never understood before, off to the left of the scrolling cells? Here's what they mean, in terms of what you just learned: *grin* This is the # of entries in the block list > 35 --- 0000 This is the current block list entry playing > 04 --- 0000 This is the block # currently playing > 01 --- 0000 This is the current cell # in the current block > 36 A#4 0384 As you watch, the current cell # will normally (barring certain effects) smoothly go from 00 to 63. When it hits 63, it will go to 00 again and the current block list entry number will increment by 1. When it does, the current block number will change if needed (remember, a block can appear multiple places in the block list). ~~ BB An Overview of MIDI MIDI is a specification developed to allow computers and electronic musical instruments to communicate with each other. Physical MIDI hookups can get rather complicated; here is a brief primer: MIDI hookups are a lot like your stereo, in that each device has IN and OUT ports. However, MIDI devices also have a port known as THRU, which retransmits information from the In port (more on why this is a Good Thing later). MIDI devices are thus connected in a modfified daisy-chain arrangement, with the Out of the master (usually a computer) connected to the In of Slave #1, and Slave #1's Thru connected to Slave #2's In, and so on. The Outs of all devices go to the In of the master. Here is a diagram of a simple hookup: ----------------------------------- | ---------------- | | | ___________ | ----- | | | | | | | | | In In Out In Out Thru In Out Thru Computer Synth Drum Machine (Master) (Slave #1) (Slave #2) MIDI is based on 16 'channels'. Each channel is typically assigned to one specific device you have connected in your chain. In the example above, you might have the synth set to listen to channels 1-9, and the drum machine set to listen to channel 10 (this is a typical assignment). With this setup, when the computer transmits a note on channel 10, it will first go to the IN of the synth, which will simultaneously retransmit it via it's THRU port and note that it doesn't want to use the data. The note will then appear on the drum machine's IN port. The drum machine will transmit it on it's THRU port (to which nothing is connected in the example) and start the note. This allows flexibility; if for instance you wanted you could connect a second drum machine with different sounds, set it to channel 10 also, and have a unique mix :) I will not cover MIDI recording and editing here, to avoid getting too technical :) ~~ CA Technical Specs for the GS Ensoniq chip The 5503 Ensoniq Digital Oscillator Chip (DOC) contains 32 fundamental sound-generator units, known as 'oscillators'. Each oscillator is capable of either making an independent tone by itself, or of being paired up cooperatively with it's neighbor in a pairing known as a 'generator'. The generator arrangement is used by most programs, for it allows more flexibility and a thicker, lusher sound. The DOC plays 8-bit waveforms, with the centerline at $80 (128 decimal). $00 (0 decimal too) is reserved for 'stop'. If a sample value of 0 is encountered by a DOC oscillator, the oscillator will immediately halt and not produce any more sound. The DOC additionally has an 8-bit volume register for each oscillator, with a linear slope. The dynamic range of the DOC (the 'space' between the softest and loudest sounds it can produce) is approximately 42 dB, or about on par with an average cassette tape. Each oscillator has it's own 16 bit frequency register, ranging from 0 to 65535. In a normal DOC configuration, each step of the frequency register increases the play rate by 51 Hz, and computing the maximum theoretical play rate is left as an exercise for the student. :) When oscillators are paired to create generators, there are 4 possible modes: Free-run: the oscillator simply plays the waveform and stops. No interaction with it's 'twin' occurs. Swap: Only one oscillator of the pair is active at a time. When one stops, the other immediately starts. Loop: The oscillator simply plays the waveform and if it hits the end without encountering a zero, it starts over at the beginning. Sync/AM: One oscillator of the pair modulates the volume of the other with the waveform it's playing. Not commonly used. Oscillators play waves stored in up to 128k of DRAM. The Ensoniq has it's own memory refresh system. Note that Apple only supplies 64k of DRAM for the DOC (this is known as the DOC RAM). The output of an oscillator can be directed to any one of 16 possible channels. Apple only makes 8 channels avalible via the 3 bits on the sound expansion molex connector, and all current stereo cards limit this to 1 bit, or two channels. ~~ DA About IIgs Stereo Cards Mfr Name Notes --- ---- ----- MDIdeas SuperSonic First IIgs stereo card. Not very well constructed, but sounds nice. Digitizer option pretty good. MDIdeas Digitizer Pro Daughterboard for SuperSonic, but also takes up another slot in your GS. Pretty good, but very few were sold. Applied GStereo I've never used one; included for Ingenuity completeness. Applied FutureSound Most advanced card made. Includes Visions sophisticated noise reduction, coprocessor, and timing generator for ultimate control of sampling rates. Applied Sonic Blaster Generally poor to average card; boneheaded Engineering decision to use non-shielded ribbon cable results in hissier than average output and digitizing. Applied Audio Animator The one they got right. Has digitizing Engineering circuitry external to the GS itself to avoid noise, plus a MIDI interface. Econ Tech. SoundMeister Generally above average quality. Nothing much to say. Pro version with direct-to-harddisk recording cancelled. ~~ EA Sound cards for 8-bit IIs The Mountain Computer Music System (MCMS) consists of two cards joined together and going in any slots except 0 and 7. It supplied 16 digital programmable oscillators arranged into 2 banks of 8 for stereo purposes, plus D/A convertors, digital filters, output amplifiers, and a light-pen interface port. The software provides full synthesis and sequencing capabilities including hardcopy printout. The alphaSyntauri is either a 4 or 5 octave velocity-sensitive keyboard plus a single interface card which works with the MCMS. Highlights include better software which can do spectral analysis and an excellent synthesized Hammond B-3 organ sound. The alphaSyntauri was used both on recordings and live in concert by Herbie Hancock. The Passport Soundchaser is also a keyboard with interface card and software that supports the MCMS. It provides good real-time performance control, and has been used by such artists as Brent Mydland of the Grateful Dead. The Soundchaser was later partially converted to be MIDI compatible. The PVI Drum-Key was a drum machine on a card, providing 26 drum and percussion sounds, plus 100 rhythm patterns and 26 songs, although there is no provision for user-created sounds or tweeking the existing ones. PVI's engineers later helped found Ensoniq. The IQS Spectrum Analyser is a spectral analyser card capable of sampling up to 4096 points of data about a sound wave. It also included graphing software and software to create sounds for the MCMS. The Decillionix DX-1 Sampling Card is an interface card and software package allowing sampling and playback at rates from 780 Hz to 23 kHz. It included several utilities allowing samples to be triggered from the keyboard, joystick, alphaSyntauri, Soundchaser, or MIDI compatible devices, plus a utility to convert samples into MCMS format. The Alf Music Synthesizer provides 3 channels of square waves or pulse waves and included sequencing software. It doesn't provide the degree of programmability that the term "Synthesizer" would normally indicate. Songs created for the Alf can be converted for use on the AE Phasor board, as well as a demo program created by the makers of the GS SuperSonic board which was later renamed and rereleased as "XMAS.MINIVAMPS" by Charles Turley (aka Dr. Tom). The Mockingboard C is the speech-capable version of the Mockingboard, which includes 2 General Instruments AY-3-8193 with 3 channels of sound per chip, and sockets for two speech chips, and an onboard stereo amplifier (which connects to external speakers). The sound chips are programmable to some extent to create new sounds, but not fully so like the alphaSyntauri. Many games and music programs support this card. The Roland CMU-800 is a hardware/software music system consisting of an external synthesizer module and an Apple II interface card. The board contains several tone generators as well as some drum sounds similar to the Roland TR-606 analog drum machine. The software allowed step recording and saving to disk of sequences. A CV interface was also provided for connection to synthesizers of the time using the CV interface (a precursor to MIDI). The AE Phasor board can generate 12 channels of sound (4 AY-3-8193 chips), as well as 1 channel of noise. The capabilities are the same as the Mockingboard, only with twice the channels. The Phasor also allows you to route the Apple II internal sound through it's amplifier so you hear everything on speakers connected to it. It also is somewhat easier to program than the Mockingboard for speech generation. Shan's Digicorder is a box which connects to your joystick port and provides 1-bit sound sampling and playback through the internal speaker. The sound quality isn't as good as the IIgs or other more modern hardware, but it can still be surprisingly good for simple sounds. Plenty of BASIC and assembly examples for use are provided, along with software to record, edit, and play sounds. ~~ FA What about them other machines? Here's a rundown of sound on other computers... Computer or Card Wavetable voices WT bits FM voices Stereo? Digitize? ----------------------------------------------------------------------------- Apple IIgs 32 8 None Yes(4) Yes 8 bit Soundblaster 1 8 11 No Yes 8(4) Soundblaster Pro 2 8 20 Yes Yes 8 Soundblaster 16 2 16 20 Yes Yes 16 bit Soundblaster 16 AWE32 32 16 20 Yes Yes 16 Pro Audio Spectrum 16 2 16 20 Yes Yes 16 Gravis UltraSound 32 8/16 None(2) Yes Yes 16(4) Gravis UltraSound Max 32 8/16 None(2) Yes Yes 16 Ensoniq SoundScape 32 8/16 20 Yes Yes 16 Reveal Wave FX/32 32 8/16 20 Yes Yes 16 Logitech SoundMan Wave 20 16 22 Yes Yes 16 Commodore Amiga (all) 4 8 None Yes Yes 8(4) Mac (non AV, 0x0) 4 8 None Yes(3) Yes 8(4) AV 0x0 Mac Infinite(1) 8/16(10) Infinite(1) Yes Yes 16 PowerPC Mac 2 16 None Yes Yes 16 AV PowerPC Mac Infinite(9) 8/16(10) Infinite(9) Yes Yes 16 Game Machine Wavetable voices WT bits FM voices Other voices Stereo? ------------------------------------------------------------------------------ Atari 2600 0 0 0 2 No Intellivision 0 0 0 4(8) No Nintendo Ent. System 1(5) 8 4 0 No Sega Genesis 1(5) 8 6 0 Yes Sega CD 3(7) 8/16(7) 6 0 Yes Super NES 8 16(6) 0 0 Yes Notes: "Wavetable" as used here means "a channel capable of playing back a digitized waveform". This is NOT the generally musically accepted meaning of the term, but it IS how it is commonly used when referring to computer sound boards. "8/16" for WT playback bits means the chip is capable of directly processing 8-bit or 16-bit samples without conversion (the GUS's GF1 chip and the AV Mac's DSP chip obviously fit these criteria). 1 - The AV Mac's DSP chip can theoretically mix an infinite number of wavetable voices or synthesize an infinite number of FM voices. However, this is limited in practice by the speed of the chip and any other things you have it doing (voice recognition, modem replacement, etc). 2- The Gravis UltraSound can emulate FM synthesis in software. 3- Macs before the Mac II were mono-only. 4- This requires additional hardware. 5- The Genesis and NES's wavetable channel is pretty hackish, and not very high quality; nonetheless it works for speech. 6- The SNES's sound chip accepts 16 bit samples which have been ADPCM compressed (the same type method as ACE on the GS). 7- The Sega CD has two channels of 44.1khz stereo 16-bit CD audio in addition to the capabilities of the Genesis. 8- The Intellivision uses the General Instruments AY-3-8192 chip found on Apple II boards such as the Phasor and Mockingboard. This provides three tones and one percussive noise at once. 9- The PowerPC AV Macs have no dedicated DSP chip; they use the main CPU, which can cause application performance degradation (see also note 1). 10- AV Macs of both CPU types have a 2-channel 16-bit CODEC to actually reproduce the audio, but the DSP or 60x chip are capable of conversion. ------------------------------------------ Copyright (c) 1993-94 Ian Schmidt and Cygnix Development. Contents may be freely distributed as long as no editing occurs without permission, and no money is exchanged. Exceptions are hereby explicitly provided for Joe Kohn's Shareware Solutions II, the services CompuServe, GEnie, and Delphi, and for user groups everywhere. The Apple II: It just keeps going and going and going.... Oh, and for the benefit of Marc: -30- -- Ian Schmidt - irsman@drift.winternet.com - Rush in '96! - INSOC: "If you've got to belong to something, belong to us and we'll make you PC"