Loading ...
Sorry, an error occurred while loading the content.

Javascript (for newbies) to convert ratios to cents and vice-versa

Expand Messages
  • Charles Lucy
    Here is a simple JavaScript which may be useful for novices. To use it copy the lines between and excluding the ******* s, paste it into an html page, and
    Message 1 of 1 , Dec 1, 2000
    • 0 Attachment
      Here is a simple JavaScript which may be useful for novices.
      To use it copy the lines between and excluding the *******'s, paste it
      into an html page, and display with a browser.
      (It works fine on Netscape with Linux, and should with most other
      systems)


      START of SCRIPT
      ******
      <p><left>Convert between ratio and cents<br>
      Enter a number in either field, then click outside the text box.
      <form>
      Ratio:
      <input type="text" name="F" value="1.5"
      onChange="C.value =(Math.log(this.value)*1200)/(Math.log(2))"><br>
      Cents:
      <input type="text" name="C" value="701.955"
      onChange="F.value = Math.exp(((this.value)*Math.log(2))/1200)"><br>
      *********
      END of SCRIPT
      --
      ~====================================================~
      Charles Lucy - lucy@... (LucyScaleDevelopments)
      ------------ Promoting global harmony through LucyTuning -------
      for information on LucyTuning go to http://www.ilhawaii.net/~lucy or
      http://www.harmonics.com/lucy/
      for Lucytuned Lullabies go to http://www.lucytune.com or
      http://www.lucytune.co.uk
      --------------------------------------------------------
    Your message has been successfully submitted and would be delivered to recipients shortly.