[This source has been copied as it is straight off 2000, eds. note, 2005]
UNDER ACTUAL TXT TO HTML-TXT COMPOSITION (2002)
(Some parts may yet be hard to read)


FMNOISE?.BA? - Simple FM noise output by cont, ycont, Yss1989-,sdD+J,dnc. (c) 2000 by Yss - study material: english version rev 0.03
--------------------------------------------------------------------------

 

** You may want to D/L and keep this material for future reference.
** To go DIRECTLY to FM programming notes, start reading the section "ABOUT THE DATA" down below.
** To skip the notes and just make some FM noise follow "ABOUT NOISE MAKING".

** Whenever possible, keep FMNOISEE.* together.
-- Give everyone else a chance.
** Use freely and enjoy, guys.

 

 

 

What's here (topics):

 

ABOUT FMNOISEE.EXE    - Tells about the sample program FMNOISEE.EXE
INTRO                 - Brief interesting facts to read.
ABOUT THE DATA        - Top of simple FM 'noise' generation.
FM PROGRAMMING STUFF  - The goods.
REGISTER PROGRAMMING..- Using the goods.
ABOUT NOISE MAKING    - A really quick way to make some FM noise.
ABOUT NOISE           - Some easy to grasp theory.

 

 

 

 

 

 

 

 

 

ABOUT FMNOISEE.EXE
------------------

How much 'bombing' can the earth take? Every time whales are exterminated, every time trees are rageously brought down, any time there's irrational and unmeasured predation upon our precious natural resources, our planet earth is also 'bombed'.

FMNOISEE.EXE is just a BASIC program made to test the accuracy of the method shown here for simple FM noise generation. While running, use <ESC> to quit it, 'K' or [enter] to "knock" (start noise) and P to pause "bombing".

 

 

 

 

 

 

 

INTRO
-----

There's information here on how to make FM 'noise' on an IBM-PC/AT computer, not how to make harmful everyday noise, and definitely NOT how to NOISE-up people's heads by giving them bad/unuseful information.

Sometimes it's best not to know than to know wrong.

From experience, a system's design is usually proportional to the amount of useful data or useful hardware specifications available for such a design.

From that point of view, professional observations would point out that 'soundblaster' sound cards must be poor in design. Well, that happens to be our opinion (from tests), not just in design but most important of all on sound output quality (attention pro musicians).

 

The reason for any professional programmer to bother programming such a card can be the same reason that drives them to program VGA technology, to use Windows, or the same reason that lures the masses into buying whatever is sold to them, because it's what's commonly "available".

 

Not only are the specifications on the soundblaster card poorly documented and scarce. They are also abusively expensive, limited in scope and they try to force programmers into using the poorly written C drivers they provide in order to make weak use of the card itself. They don't even easily clue a programmer on how to use the hardware, and they claim it's all for the sake of "compatibility". Utter nonsense.

Anyone who paid hundreds for the infamous "soundblaster developer kit" and who got stuffed in the head with tons of useless variable names in order to make a simple "tweet" sound knows exactly what is being said here [advice: don't pay a dime for the soundblaster developer kit, you'll be paying for trash for the most part].

Thank God for people willing to share information. Thank God for those who just won't hide information away as if they were part of some cult, but instead who are willing to share it and to contribute some individuality and creativity into the world.

After lots of painful and dissapointing testing, as an usual rule, guys like that will give away a truly useful piece of documentation, free of the usual garbage, free of the misleads, free of those redundant C variable references, and of course, FREE of charge.





Any comments or questions, write to pixelrat@hotmail.com.
Enjoy.
Yss.

 

 

 

 

 

 

ABOUT THE DATA
--------------

Game programmers will like this stuff.
The purpose of the material presented in FMNOISEE is for it to work as a quick-and-dirty reference, for a programmer who wants to simply get some FM noise done, such as a game programmer. The program FMNOISEE.EXE shows an example output of the use of this study material, and then gives out the programming information. Any programmer with a bit of sense and logic will be able to use this information properly.

This material won't go into programming details or aspects on the FM chip, since it's not its purpose.

 

 

 

 

 

FM programming overall stuff:
----------------------------

As we should all know:

-0388 and 0389 (hex) are the ports assigned to FM sound operation:

1-write the FM register # to access into 0388.
2-then write the value to write to such register into 0389.

Wait about five microsecs after writing to 0388 before writing to 0389.
Wait about twenty-five microsecs after writing to 0389 before writing to 0388 again.

-FM sounds can be generated by using any of 9 apparently independent voice channels. The word 'apparently' is used because all the facts on the chip itself aren't yet completely available to us.

-Each voice channel uses 2 operators whiich can be paralleled or mixed serially one upon the other (modulated).

-There are over 240 write-only 8-bit regissters on the FM chip.



-In general, each voice has the followinng controls for each one of its operators: ((#)base register -description)

#20 -Modulation's harmonic content (bts 3-0 -> 00:least 0F:most)
#40 -Volume (bts 5-0, 00=hiest volume)
#60 -Attack/Decay (attack bits 7-4, decay bts 3-0)
#80 -Sustain/Release (bts 7-4, 3-0, 00=longest, same abve)
#E0 -Distortion waveform (bts 1-0: 0:sine 1:? 2:? 3:sawtooth?) Bit 5 of register 01 of the FM chip has to be on for operator waveform distortions to occur.

 

-Each voice has the following controls that affect BOTH operators:

#A0 -Frequency low (8 bits)
#B0 -Keyon-off(bt5)/Octave(bts4-2)/Frequency Hi(bits1-0)
#C0 -Feedback(bits3-1)/algorithm(bit0)

To each of those base register numbers (#), add the values given in parentheses in one of the examples down below to find the correct address for any one of the nine voices. There's lots more to the registers and its programming than what is presented here, but this is at least a quick start.

 

 

 

 

REGISTER PROGRAMMING EXAMPLES
-----------------------------

Quick Examples:

** To access the volumes of voice 0's two operators:

write #40 to 0388 (volume for first operator)
write val to 0389 (desired value)
write #43 to 0388 (volume for next operator)
write val to 0389 (desired value) :

-The next operator seems to be always accessed by adding a 3 to the main operator's reg. #.
-The next operator seems to be modulatedd by the first.

 

** The register values for the volumes of voices 0 through 8 are shown below. The numbers in parentheses are the values to add to base numbers register numbers shown above next to a '#', in order to find the proper register addresses for any particular voice.

1st operator
------------

Voice 0 #40 (00) Voice 3 #48 (08) Voice 6 #50 (10)
      1 41 (01)        4  49 (09)        7 51 (11)
      2 42 (02)        5  4A (0A)        8 52 (12)

 

For the next operator: #43,44,45,4B,4C,4D,53,54,55.It can seem confusing at first, but use some logic and you'll be able tofigure out the rest. The harmonic content's register for voice 3 in it'sfirst operator is, for example, #28. For the next operator it would be#28 + 3 = #2B. In the same manner, the attack/decay registers of voice 7'stwo operators would be #71 and #74. Remember that all values are in HEX.

 

 

 

 

 

 

 

 

 


ABOUT NOISE-MAKING
------------------

(If you just want to make FM noise read and follow the following short text PRECISELY. It's all you'll need):

**** The following text is the output from sample program FMNOISEE.EXE (its only output):
Ignore this shaded part. Kept here for reference only. Run the program FMNOISEE.EXE and read carefully the text at the end of it.The text in the program wasn't added here for reasons of time.


FMNOISE?.BA? - Simple FM Noise output by cont,ycont,Yss1989-,sdD+J,dnc. (c) 2000 by Yss - study material


Knowledge comes free of charge.
Soundblaster is a mediocre soundcard. All values below are HEX.

To make a simple FM 'noise' (3 steps), do this:

1- Write the following data onto their respective registers: (see notes) (1st value is register, 2nd is data): 20 07 23 80 40 00 43 00 60 72 63 72 80 22 83 22 E0 00 E3 03 A0 98 B0 1F C0 0F BD 0F

2- In a loop, start actual 'noise' by writing rnd vals from 00-FF into #A0 and values from 20-3F into #B0. Within the same loop:

3- Trigger the noise by writing 20 into #B0, then 00. (start 'noise' cycle)

Notes: This 'noise' uses 1 voice, voice 0. FM seems to have 9 voice channels. To cut noise on exit, write 00 into #B0 and bring volumes down. #40,#43=operator volumes. Volumes -> 00-1F, -> 00=loudest. FM has over F0 internal 8-bit write-only registers. Works with YAMAHA FM operator technology.

To write a register, say register #20 with value 01:

-> write 20 to 0388, wait about 05 uSS
-> write 01 to 0389
-> wait about 19 uS before nxt op

Here's what some programmers did:

1) They ran FMNOISEE.EXE and hit <ESC>
2) They printed out the info on the screen (PRT-SCREEN)
3) They wrote some short test program based on the printed info.

 

 

 

 

 

ABOUT NOISE
-----------

Why such method works:

Noise can be thought of as an immensely vast quantity of values combined together without apparent order. It can be the immense amount of sound generated by each violently-reacting particle in an explosion, so high and variated frequency is suggested inside a 'noise'. If the noise begins loudly enough, it will reverberate sufficiently around any surrounding obstacles even if they're standing at some distance from the source of the noise (origin of an explosion), so it will be heard/felt even after it's really ended (like in the case of an explosion). Following the last considerations, a long duration and a slow fade-away of such noise will be expected. Also, low frequencies are felt much more than they are heard.

Noise can be generated on the computer by writing random or sampled data directly to the sound DAC (send 10 to 022C (always HEX), read 022C while bt7 remains on, then send the 8 bit data to the SAME 022C), and it can also be achieved through the use of FM sound generation, with less quality, but with relatively greater byte-savings and less-demanding program execution speed.

 

The method:
----------

The method shown is just a simple one of the many we're sure can be achieved by using the FM generators if the proper data can be obtained.

What it does is 3 basic things:

1) It sets the sound registers with the proper values in order to get 'noise'. Such values include characteristics for:

-Fast volume rise of the sound (short attack)
-Long duration (long duration of the souund)
-Slow decay and release (slowly fade away)
-Generation of as many harmonics as possible, since a 'noise' is made up of many values (harmonics in the case of sounds): One way to play with harmonic generation involves the use of 'feedback', harmonic content and distortion waveforms.

2) Next, it establishes a 'background' loop that will feed the voice's frequency registers with different random values in time.

The reason for this is that the setting itself of the sound registers won't generate a 'noise' adequate enough. That's because two operators are too few sound elements to work with, so some synthesis must be provided by the program in order to achieve a deeper, better result. How fast to feed it? Experimenting is good. Usually, the faster, the better.

3) Within the loop, and when required to do so, it triggers (starts) the 'noise' by the flipping of a single bit (bt5 of #B0 for this case in which voice 0 is used).

That's basically it. Since this is only an experimental example, greater quality and 'cleanliness' in the generated 'noise' can be obtained by trying different values in a logical fashion.

 

 

 

 

FINAL STATEMENT
---------------

The information presented in this material provides tutorial examples regarding the use of commercially obtainable hardware, information that should be (but isn't) freely available to anyone requesting it. Any companies or brand names mentioned here are for reference only and are the trademarks of their respective owners. The reference material presented here is for educational purpose only and the author's not responsible for its misuse or misinterpretation.





Want to go Beyond? :)