Paul Beach wrote:
> It is trivial to calculate Equal Temperment; see Excel modul below for
> the usual 12 tone as well as 31 tones. Nonlinear is usually mentioned
> in the context of differential equations. The 12 tone scale is in every
> computer music scale, as I have done, and always unavailable for
> modification. If there is a reason to do a glide or glissado, frequency
> modulation works quite well in Audacity.
>
> Sub et()
> a440 = 440
>
> 'Equal Temperment 12 tone
> Cells(1, 1) = a440
>
> For i = 2 To 12
> Cells(i, 1) = 2 ^ (i / 12) * 440
> Next i
>
> 'Equal Temperment 31 tone
>
> Cells(1, 3) = a440
> For k = 2 To 31
> Cells(k, 3) = 2 ^ (k / 31) * 440
> Next k
> End Sub
Edgar writes:
If you only want to work with equal temperament, but a different numer of
semitones than 12, the implementation in Nyquist is quite easy. The only
point is that then it would probably not make much sense to work with
MIDI natation any longer. But since the Nyquist lowlevel interface works
in terms of physics (frequency in Hertz and time in seconds) it's not
neccessary to use MIDI notation at all.
If you have e.g. an a440 and want to compute the next higher semitone
in 31TET, 2 ^ (1/31) *440, in Nyquist this would look like:
;; logarithmic math with Nyquist and XLISP:
;; nth power of x: (exp (* (log x) n))
;; nth root of x: (exp (/ (log x) n))
(setf newhertzvalue (exp (* (log 2.0) (/ 1.0 31.0))))
IMPORTANT: write 31.0, a Lisp FLONUM, because (/ 1 31) would be a FIXNUM
(integer) computation and result in a value of zero. It's sufficient if
ONE of both numbers is a FLONUM to get a FLONUM result.
A general 31TET transformation function would look like:
(defun 31tet (k)
(* (exp (* (log 2.0) (/ k 31.0))) 440.0))
NOTE: You only need to exchange the "31.0" by another factor to get a
different TET scaling.
Because all Nyquist MIDI functions internally work with FLONUMS (the
MIDI "step" in Nyquist is just a word but not a real "step") you can
use the "31tet" function like:
;; a sinewave, 4 31TET semitones higer than a440
;;
(osc (hztostep (31tet 4)))
;; a sinewave, 6 31TET semitones lower than a440
;;
(osc (hztostep (31tet 6)))
One step further, a 31TET sine oscillator would look like this:
(defun 31tetosc (k)
(osc (hztostep (31tet k))))
The same way you can modify any Nyquist oscillator you like to a
different TET tuning scale. For oscillators which need Hertz values
just omit the "hztostep" transformation.
NOTE: How much the Nyquist pitch transformation environment works
with the TET functions is a different question (still not tested yet).
 edgar

The author of this email does not necessarily endorse the
following advertisements, which are the sole responsibility
of the advertiser:
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
