[audacity4blind] Re: Tone Generator

  • From: Robert Hänggi <aarjay.robert@xxxxxxxxx>
  • To: audacity4blind@xxxxxxxxxxxxx
  • Date: Thu, 21 May 2015 00:57:36 +0200

2015-05-20 21:01 GMT+02:00, Stan Bobbitt <sbobbitt@xxxxxxxxxxxx>:

I used Sound Forge audio studio and JAWS for windows 16. I couldn't get the

time exact enough for the quarter notes using audacity. With sound forge I
can take it down to 1 millisecond if needed.
Stan B


Audacity is as precise as you want it.

Normally, you would set up the score within the code.
There are three essential functions to do this:
(sim <sound1> <sound2>)
adds to sounds.
We can set the shift for a sound with
(at <time> (cue <sound>))

The following code uses some of these aspects.
'(simrep ....)' is used to add 48 notes at once. the variable I
invreases by 1 on each iteration, thus I've used it to set the time
(0, 0.2, 0.4 etc)
The note is not a triangle wave form but a physical sound model instead.
The different instruments are indicated.

(set-sound-srate (setf *sr* *sound-srate*))
(defun ding (pitch dur inst)
(mult (pwl 0 0.05 dur 0.0 dur)
(cue (snd-modalbar 0 (step-to-hz pitch ) inst dur *sr*))))
;
; possible instruments (last number for the "ding" function below)
; MARIMBA 0
; VIBRAPHONE 1
; AGOGO 2
; WOOD1 3
; RESO 4
; WOOD2 5
; BEATS 6
; TWO-FIXED 7
; CLUMP 8
;
(simrep (i 48)
(at (* 0.25 i) (ding (+ f4 i) 0.7 4)))


An important point is also that we can switch from Hertz to halfsteps
and vice-versa, this makes it much easier to create a melody.

(step-to-hz <pitch>) could be used instead of the frequency value in
Steve's code.
You can enter a number (e.g. 88 or 88.1 for a note 10 cents off) or a
key name followed by nothing, f (=flat) or s (=sharp) and the desired
octave.
Examples:
a4, ds3, gf7 ...

The sample code starts on f4.
If you want to know the Hz for a given note, enter as last line in the
Nyquist prompt:
(print (step-to-hz a5))
or the other way around:
(print (hz-to-step 273)) but this gives the midi number and not the name though.

Robert

The audacity4blind web site is at
//www.freelists.org/webpage/audacity4blind

Subscribe and unsubscribe information, message archives,
Audacity keyboard commands, and more...

To unsubscribe from audacity4blind, send an email to
audacity4blind-request@xxxxxxxxxxxxx
with subject line
unsubscribe

Other related posts: