Joe Monzo writes:
It allows the user to input, step-time, microtonal notes into a MIDI or Cakewalk file.
Right now I only have microtonal input capability for numerator and denominator of ratios. I'm working on prime-factor input, and also ETs. (actually ETs were already crudely implemented before I made it JI).
Also in the works is a better note-duration input interface, more like musical notation (1/4-notes, 1/8-notes, tuplets, etc.)
The program takes your input of 12-Eq degree of tonic, start time, duration (in timebase ppq units), and numerator and denominator of ratio, and inserts a MIDI-note with the proper pitch-bend into your Cakewalk file.
It only does one note per run right now.
CAL uses only integer math and does not have logarithms, so I had to work around both of those limitations.
The integer math was easy - just multiply all the important numbers by 10^4 or 10^6, then divide back down at the end. But actually, this was where the problem lay which stopped the program from running - it was "seeing" 10000 as an integer data-type and truncating the calculation. It works fine now.
The lack of logarithms was a little more difficult, and I solved it by using Ellis's augmented bimodulus calculation as presented in his translation of Helmholtz, _On the Sensations of Tone_, p. 447. It is accurate to within less than 2 cents.
Everything in the program between the "do" under START PROGRAM and the closing parenthesis as the end should be *indented*. If you paste this into Cakewalk or a text editor and a word or line is not indented, an email program along the way has added a carriage return at the end of the preceeding line. Delete this, so that the non-indented words end up at the end of the previous line where they belong. Otherwise the program may not run.
CAL's syntax is like a combination of C and LISP: lots of parentheses. Indenting helps keep track of them.
Anyone is welcome to add their own improvements, or implement mine, for that matter. I've left in many comments and also some commented-out code that works to some extent. Feel free to finish it. One important note - if you send *me* an improvement, make sure it will work on my machine - I'm running Cakewalk 2.01 Pro for Windows and this is CAL version 21 (it's dinosaur software). If you include parts of the language that were added in a later version of CAL, it won't run for me.
There are four "pause" statements that have been commented out. They are for debugging purposes and are clearly marked. The double-semicolons may be removed if you would like CAL to furnish this information to you while you are improving the program.
Enjoy!
-monzo