Pure ton Audiometry test on Max

Tom Bellman's icon

Hi all,

I am creating a basic pure tone audiometry test on max for my dissertation and I have the basic skeleton, just not quite there yet.
I have a couple of questions. Firstly, I want to be able to see exactly what dB level my objects, and therefore my laptop, are outputting so I can record this for my data collection. I have an 'atodb' object but that only records the dB output of the objects but I can obviously turn my laptop up and down and these numbers would not change, any suggestions? I also need the level's to go up in 5dB steps, is this possible without guessing where to click?
Secondly, I am using a USB button to record my participants responses, so they click if they can hear it and don't click if they can't. I want to use a 'coll' object which basically writes 1's (when they click) into an excel sheet in specific places but I have no idea where to start with this.
Would really appreciate some help with these things!

Please see the patch I have so far attached.

Basic-Pure-tone-audiometry-test.maxpat
Max Patch
DominikK's icon

Hmm if I understand you correctly you're looking for something that's not really possible.
Max cannot know how many dB of sound output your system actually provides. That depends on the following signal chain.
Notice that the dB Max shows you internally are dB fullscale, measured only in the in the digital domain. Although dB Fullscale and dB SPL (sound pressure level) sound similar they are two very different things. You would need to calibrate the actual output of a system with a special microphone to really now the output in dB SPL

Tom Bellman's icon

I thought this would be the case, I will have to go back to the drawing board with this one. Maybe somehow measure the SPL that my headphones are outputting so I can scale it on Max.
Thank you for your help!
Have you any ideas about the other points?

Source Audio's icon

Hi Tom,
as first switching cycles~ like that will not be helpfull.
You have to turn them on or off, or just use one cycle with different
frequencies and pack them into Freq/level lists for storage.
Making 5 db steps is easy to do, but is that a good way ?
It is big difference if we go from -70 to -75 db, or from
-5 to 0 db in Max.
The scale should be finer, if You need to do this precisely.
You can even make a freq sweep, which user could stop
using the switch.
Storage into coll is also no problem, one can use
frequency as Address and Level as Value when Freq gets heard.

Tom Bellman's icon

Hi Source Audio,

I am only going off what I have read previously about the pure tone audiometry tests and they work in 5-10dB steps.
Would you say there is an easier way? Sorry to be a pain but could you demonstrate this on my patch and send it back to me?

Thank you so much!
Tom

Source Audio's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Sure, here is a simple patch with ramp from -120 - 0. db in 10000 ms.
You can change that as You wish.
When user triggers the button, ramp stops, and
freq and level gets stored in coll
-----------
If You want I can post 5db step up version ...
And maybe add left / right ear meassurement separately ?

Roman Thilenius's icon

if the PA for the setup is already available to you, you could just measure it and memorize the data in your app, for some kind of gain to phon conversion, display or control.

this is how you can also vaguely "calibrate" a contourfilter function for a big concert PA and similar things.

about your question with the 5db steps - there is dbtoa, the opposite of atodb which wil do this for you. :)

Tom Bellman's icon

Thank you so much Source Audio!
This patch is perfect, although I am going to try and re-create it in a slightly different way as I do not want to copy your work and need to make something myself, just needed some guidance.

Just need to get my head around how this works now.
Again, thank you so much for your help.
Tom

Source Audio's icon

Hi, Tom, we are all here on the forum for getting anf giving help or advice, and that's all about it.
There is no my work your work.
So please, just ask if there is anything else that could be worked out together.

Tom Bellman's icon

Great, thank you so much again for your help!
I want my patch to match the official pure tone audiometry test as closely as possible.
So i want to be able to select certain dB levels before playing the tone, and then select the next level and frequency etc.
I imagine this is simple but I can't seem to work it out. Some pointers as to how this is done will be much appreciated.

Thanks,
Tom

Source Audio's icon

Hi Tom, that should be easy to implement.
You could use menu with set levels in db,
and Play / Stop button if You wish.
One could step through levels up or down using
for example up/down arrow keys.
Selected Level will than get stored in coll, instead of interrupted
ramp.
If You need I can make a patch for that, but please tell me what
should level scale look like, 5 db steps ?
Starting from ?
You coulkd of course just use one Float with arbitrary db scale,
but that would not be really practical.

Tom Bellman's icon

I have tried to put something together but not sure I am doing quite the right thing. Would be excellent if you could give me an example?
Lets say from 5dB up to 70dB in 5dB steps if possible.
Really appreciate your help, and I am going to try and re-build what you have made just so that I totally understand it.

Thank you
Tom

Source Audio's icon

Ok, I'll post something soon,
but the way it works in Max is different than producing
sound pressure in decibels.
There is no way to output 5 db of sound pressure from Max , because we don't know
what Yor amp/speakers/phones etc do.
So for range of 65 db, we just start from-65 db and clime up in 5 db steps up to 0 db,
which is maximum level.
Then it is another task to calibrate/adjust the external gear.

Source Audio's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Tom Bellman's icon

No no of course I understand that. The output is in the digital domain. That's my next challenge!
I think i am going to be doing my test on a pair of headphones so will just have to either use an SPL level really close to the headphones to determine a level which is consistent for all of my tests, or use speakers in a studio and keep a consistent level.
You have been an absolute saviour! Thank you for all of your help, I do appreciate it.
Wish I could help you out in some way in return!

Tom

Source Audio's icon

You are welcome !
And I also received a lot of help and tips here ...

Tom Bellman's icon

One final question.... Sorry!
How did you get the arrows to control the Level Umenu? I just want to test having the left and right arrows controlling the frequency select.

Thank you!
Tom

Source Audio's icon
Max Patch
Copy patch and select New From Clipboard in Max.

If You doubleclick the "keys-step" patcher You will see it all.
Key Codes for left and right arrows are 28 and 29.
But maybe it is easier with updated patch:

Tom Bellman's icon

Again, thanks so much for your help!

Tom