Adding an accessible spectrum to Audacity

Hi!
I am Marco Oros. I have a special request. Please, can You add an accessible plot spectrum for the blind?
I would like to explain It.
After plotting a spectrum, there will be an information edit box with a frequencies and amplitudes. I would like to use a plot spectrum function, but I am blind and I have this idea to helping a blind people with this.
Thank You!
Marco

Hi Marco,

You can export the spectrum plot and read that in your screen reader.


Gale

What about a sweep whose loudness matches the frequency-analysis …

Or a couple of seconds of noise with the same frequency-analysis …

I’ve already written such a plug-in for personal use.
It replaces the selection with the spectral sweep (normalized).
It will be installed under “Effects”, not under Analyze.
You can change the contrast to hear peaks better. Stereo channels have to be split in order to make it work.

You’ll get a textual output in addition, if you press the debug button.
With frequency, level, and musical pitch near those frequencies.

Some Window functions are not implemented. The Flat top is an addition to Audacity’s plot spectrum and displays the amplitude more accurate (but the peaks are wider).
Feedback appreciated.

Robert
rjh-accesstrum.ny (4.84 KB)

Great minds think alike :smiley:

Pedantry points for me : Your accesstrum plugin has “Poison” where is should be “Poisson”.

Good catch Trebor–fish or venom, had always my problems with those in French. :smiley:

Hi people!
Thanks to Your help. I am sorry to reply very later. I have tested those functions both (export spectrum to txt and accesstrum). This accesstrum is very great.
But, for blind sound scientists I have one advice. Try use size around 8000 and han window function.
Also, I don’t know, what size and window is the best for every spectral analysers.
Thanks and sorry for My English.
Marco

Hello.
There is a new add-on for NVDA screen reader named Audio chart, which can be a good alternative to accessible spectrum, if You can aply this audiochart on amplitudes of frequencies. Here is link to stable version of audio chart addon .

Hello. I have tried It in new version of Audacity and It didn’t work. In bug is following:
Frequency Level Name Octave Offset
error: array index out of bounds - 1
Function: #<Subr-AREF: #0A29E7F0>
Arguments:
#()
1
Function: #<FSubr-DO: #0A29F800>
Arguments:
((I 1 (1+ I)))
((= I (1+ HALF)))
(SETF FREQ (* I (/ SOUND-SRATE SIZE)))
(FORMAT T “~a\t~a\t~a~%” FREQ (AREF LOG-SPEC I) (F-TO-PITCH FREQ))
Function: #<FSubr-LET*: #0A29D6E0>
Arguments:
(FREQ (HALF (/ SIZE 2)) (NO-OF-FRAMES (1- (/ (TRUNCATE LEN) HALF))) (S-SUM (SND-CONST 0 0 1 (1+ HALF))) (CHIRP (SND-PWL 0 1 (LIST 0 0 HALF (/ SOUND-SRATE 2) (1+ HALF)))) (SPEC (DOTIMES (I NO-OF-FRAMES (S-SQRT S-SUM)) (SETF S-SUM (SIM S-SUM (SCALE (/ 1 NO-OF-FRAMES) (POWER-SPECTRUM (SND-FFT TRACK SIZE HALF WIN))))))) (LOG-SPEC (SND-SAMPLES (LINEAR-TO-DB SPEC) NY:ALL)) (SMOOTHED (EXTRACT-ABS 0 (1+ HALF) (SND-AVG (SEQ (CUE (SND-CONST 0 0 1 (/ HOLD 2))) (CUE SPEC)) HOLD 1 OP-PEAK))))
(FORMAT T “Frequency\tLevel\tName\tOctave\tOffset\n”)
(DO ((I 1 (1+ I))) ((= I (1+ HALF))) (SETF FREQ (* I (/ SOUND-SRATE SIZE))) (FORMAT T “~a\t~a\t~a~%” FREQ (AREF LOG-SPEC I) (F-TO-PITCH FREQ)))
(PRINT (SND-SAMPLES SMOOTHED 1) (MAKE-STRING-OUTPUT-STREAM))
(SETF CHIRP (SCALE-SRATE CHIRP 50))
(SETF SPEC (SCALE-SRATE (IF (= CONTRAST 0) (DIFF (SND-AVG SPEC 64 1 OP-PEAK) SPEC) (SND-EXP (MULT CONTRAST (SND-LOG SMOOTHED)))) 50))
(DOTIMES (I SLOPES) (SETF SPEC (SUM SPEC (MULT (/ -0.05 SOUND-SRATE) (SLOPE SPEC)))))
(SETF PEAK (PEAK SPEC NY:ALL))
(SETF SPEC (SCALE (/ 0.99 PEAK) SPEC))
(SETF OUTPUT (MULT SPEC (HZOSC CHIRP)))
OUTPUT
1> Frequency Level Name Octave Offset
error: array index out of bounds - 1
Function: #<Subr-AREF: #0A0EF710>
Arguments:
#()
1
Function: #<FSubr-DO: #0A0F0720>
Arguments:
((I 1 (1+ I)))
((= I (1+ HALF)))
(SETF FREQ (* I (/ SOUND-SRATE SIZE)))
(FORMAT T “~a\t~a\t~a~%” FREQ (AREF LOG-SPEC I) (F-TO-PITCH FREQ))
Function: #<FSubr-LET*: #0A0EE600>
Arguments:
(FREQ (HALF (/ SIZE 2)) (NO-OF-FRAMES (1- (/ (TRUNCATE LEN) HALF))) (S-SUM (SND-CONST 0 0 1 (1+ HALF))) (CHIRP (SND-PWL 0 1 (LIST 0 0 HALF (/ SOUND-SRATE 2) (1+ HALF)))) (SPEC (DOTIMES (I NO-OF-FRAMES (S-SQRT S-SUM)) (SETF S-SUM (SIM S-SUM (SCALE (/ 1 NO-OF-FRAMES) (POWER-SPECTRUM (SND-FFT TRACK SIZE HALF WIN))))))) (LOG-SPEC (SND-SAMPLES (LINEAR-TO-DB SPEC) NY:ALL)) (SMOOTHED (EXTRACT-ABS 0 (1+ HALF) (SND-AVG (SEQ (CUE (SND-CONST 0 0 1 (/ HOLD 2))) (CUE SPEC)) HOLD 1 OP-PEAK))))
(FORMAT T “Frequency\tLevel\tName\tOctave\tOffset\n”)
(DO ((I 1 (1+ I))) ((= I (1+ HALF))) (SETF FREQ (* I (/ SOUND-SRATE SIZE))) (FORMAT T “~a\t~a\t~a~%” FREQ (AREF LOG-SPEC I) (F-TO-PITCH FREQ)))
(PRINT (SND-SAMPLES SMOOTHED 1) (MAKE-STRING-OUTPUT-STREAM))
(SETF CHIRP (SCALE-SRATE CHIRP 50))
(SETF SPEC (SCALE-SRATE (IF (= CONTRAST 0) (DIFF (SND-AVG SPEC 64 1 OP-PEAK) SPEC) (SND-EXP (MULT CONTRAST (SND-LOG SMOOTHED)))) 50))
(DOTIMES (I SLOPES) (SETF SPEC (SUM SPEC (MULT (/ -0.05 SOUND-SRATE) (SLOPE SPEC)))))
(SETF PEAK (PEAK SPEC NY:ALL))
(SETF SPEC (SCALE (/ 0.99 PEAK) SPEC))
(SETF OUTPUT (MULT SPEC (HZOSC CHIRP)))
OUTPUT
1>
Please, could You look on this?
Thank You.

Was this the result of using the “rjh-accesstrum.ny” effect?
If so, then it is due to a bug in that effect.

Information for Robert J. H.
In the updated Nyquist library, NY:ALL is now 2^59 (much bigger than in previous versions of Nyquist). On 32-bit Windows, “limit” must be less than 2^31 in SND-SAMPLES. Setting “limit” to NY:ALL results in an empty array.

Yes, It is just in this effect.
But It worked with previous versions.

The problem is most likely due to the recent update to the Nyquist library.
I have sent an email to Robert (author of this plug-in) about the problem.

Hello.
I apologize to write here to this topic. So, due to next update of Audacity, now effect works perfectly, but I have also question:
Could You add this plug-in to list of Nyquist plug-ins, as accessible spectrum for the blind?
Thank You.
Marco

Are you referring to the rjh-accesstrum.ny effect?
If so, I’ll be happy to upload it to Missing features - Audacity Support if someone writes the necessary documentation for it (See the other effects listed there to see what is required).

OK.
I think on this effect, as You have mentioned.
I would like to be happy to write documentation for this plugin. Problem is, that I am not English native speaker.
I can send You via private message My concept of documentation for this accessible spectrum, but maybe It won’t be good. English is My second language, not My mother tongue.

I’d prefer that you post to the public forum - understood that your English is not your first language.
If you post here, I’ll see if I can get hold of Robert (the author of the plug-in) to look over it. Updating the wiki is a painful process as it frequently times out, so I only want to upload it once.

I am sorry, to which public forum? Is this not public forum?

Yes, just post here.I’ll find it, we can refine it together, and then I’ll upload it to the wiki for everyone.