home *** CD-ROM | disk | FTP | other *** search
/ TAP YIPL / TAP_and_YIPL_Collection_CD.iso / PHREAK / BOXES / MACREDBX.TXT < prev    next >
Text File  |  1994-06-19  |  2KB  |  39 lines

  1.  
  2. From: luebkejs@steam.engin.umich.edu (Jeff Luebke)Subject: Re: generating red 
  3. box tonesDate: 2 Feb 1994 18:50:00 GMT
  4.  
  5.  
  6.  
  7. OK.  Quite a few people emailed me about the program for generating red box
  8. tones for the Mac, so I'm posting it.  A little explanation first:  The program
  9. that I wrote this program on <department of redundancy department...> is a
  10. package called Mathematica.  It's a symbolic equation manipulator, and it is
  11. *very* cool for doing math and calculus.  It's not public domain however, and
  12. it is quite expensive (the full fledged version sells for around $800.  
  13. OUCH!).  If you're in college, chances are fairly good that it may be 
  14. supported by the engineering department on their network.  Check around.  OK,
  15. enough of the preamble, here's the program:
  16.  
  17.         p=0.033;
  18.         f1=1700;
  19.         f2=2200;
  20.         s[t_]:=Which[0<=t<p, 1, p<=t<2p, 0,
  21.                      2p<=t<3p, 1, 3p<=t<4p, 0,
  22.                      4p<=t<5p, 1, 5p<=t<6p, 0,
  23.                      6p<=t<7p, 1, 7p<=t<8p, 0,
  24.                      8p<=t<9p, 1, t>=9p, 0];
  25.         tone=(Sin[2Pi f1 t]+Sin[2Pi f2 t])s[t];
  26.         Play[tone,{t,0,9p}];
  27.  
  28. That's it.  The variable p is the timing of the tones (in seconds).  
  29. f1 and f2 are the two frequencies (in Hz).  
  30. The nice thing about this is that this tone is exact, unlike many RS 
  31. conversions which depend on what crystal you use.  My suggestion:  go get a
  32. sappy recordable valentine card from Hallmark and record these tones to carry
  33. around with you.
  34.  
  35. Have fun!
  36.  
  37. Jeff Luebke
  38. luebkejs@engin.umich.edu
  39.