Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:28 06 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MicroMite controlled 4-CH stereo...

     Page 6 of 8    
Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9588
Posted: 05:02pm 12 Nov 2015
Copy link to clipboard 
Print this post

Not a fan of the dB scale for volume controls, then?

Just about all commercial amps use the dB scale, but I have to agree with those who say that bigger numbers equal more volume - nice and easy to understand etc...

I have a problem with the way that the 7419 chip deals with the volume past 0dB, but will post about that later. Basically, +1dB to +15dB are byte values 1-15, but -1dB to -79dB are byte values 16-95. SO, if you volume DOWN past byte value 16, the volume suddenly jumps from 0dB to +15dB - not good, so I have to work out how the hell to get around that!




Smoke makes things work. When the smoke gets out, it stops!
 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 327
Posted: 05:24pm 12 Nov 2015
Copy link to clipboard 
Print this post

  CircuitGizmos said   Please number your amplifier volume from 1 to 11.

:-)

I Love The movie This is Spinal Tap. And have been sitting on my hands trying not to bring up that reference!

Great build Grogster! But seriously... The volume control really does need to go to 11!

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6269
Posted: 06:41pm 12 Nov 2015
Copy link to clipboard 
Print this post

A crude translation of user input level fro zero to 95
translated to the corresponding 7419 values.
FOR gain_user = 0 TO 96
gain_device = gain_xlate(gain_user)
PRINT gain_user,gain_device," ",RIGHT$("00000000"+BIN$(gain_device),8)
NEXT gain_user

END

FUNCTION gain_xlate(a)
LOCAL b
' zero = mute
'1 = -79dB
b=max(a,0)
b=min(a,95)
IF b = 0 THEN
gain_xlate=96
ELSEIF b > 79 THEN
gain_xlate=b-80
ELSE
gain_xlate=96-b
END IF


END FUNCTION

FUNCTION max(a,b)
'returns the maximum of the two float values
IF a>b THEN
max=a
ELSE
max=b
END IF
END FUNCTION

FUNCTION min(a,b)
'returns the minimum of the two float values
IF a<b THEN
min=a
ELSE
min=b
END IF
END FUNCTION


You may not need the sanity checks - MAX and MIN if you have done that elsewhere.
If you don't want soft-step, add 128 decimal to the value.

Jim
VK7JH
MMedit
 
JohnL
Senior Member

Joined: 10/01/2014
Location: Seychelles
Posts: 128
Posted: 09:42pm 12 Nov 2015
Copy link to clipboard 
Print this post

Just in case you are not fully aware.

Human hearing is Logarithmic NOT Linear.

Also , Double or twice the loudness = factor 2 means about 10 dB.

http://www.sengpielaudio.com/calculator-levelchange.htm

http://www.audiocheck.net/soundtests_nonlinear.php

 
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 11:08pm 12 Nov 2015
Copy link to clipboard 
Print this post

You could use an array to hold the values to be sent and then you can show the array element number on the screen whilst the required value is passed to the device to be controlled.

Eg.

A(0) = 1
A(1) = 2
A(2) = 3
A(3) = 5
A(4) = 8
A(5) = 13
A(6) = 21
....

edit add

something like this perhaps..
volout(0) = 96 'mute
volout(1) = 95
volout(2) = 94
volout(3) = 93
..
volout(79) =16
volout(80) = 0
volout(81) = 1
volout(82) = 2
volout(83) = 3
..
volout(97) = 15

do
if btn-vol-up then vol = vol + 1
if btn-vol-down then vol = vol - 1
output_to_device = volout(vol)
loopEdited by ajkw 2015-11-14
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9588
Posted: 12:16am 13 Nov 2015
Copy link to clipboard 
Print this post

Thanks for the comments, fellas. I do like the array idea, and that would also allow me to have a 00-99 type volume control.

JohnL is quite correct though - audio is measured in dB for a reason.
Having said that, a linear volume control does seem to be much more popular with anyone you ask, putting aside it's technical inaccuracy for the moment....
Smoke makes things work. When the smoke gets out, it stops!
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 08:08am 13 Nov 2015
Copy link to clipboard 
Print this post

My opinion about volume 'scale':

00 = off/mute/silent
99 = max volume (rattle the walls)
00-80ish=useable range without 'hurting' your ears
81ish-99= annoy the neighbours

The people that talk 'dB' are technically correct, but if I set my amp volume to a 'random' level, I bet they could't tell me what -dB level it was set to! So keep it simple (just like the MicroMite) and have a 00-99 scale that means something to you when you see the setting.

0-9 (or 10, or 11) doesn't give enough resolution in my 'ears'!

And the scale on my main cinema ONKYO amp is shown as 0-99 (but I've never got past 85 yet).

Finally, 0-99 allows you to use bigger numbers than -xx to 0dB

WW



Edited by WhiteWizzard 2015-11-14
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 08:36am 13 Nov 2015
Copy link to clipboard 
Print this post

My Take on the Volume
Personally I like it db and code below solves the TDA7419's odd volume scale problem
The DisplayVolume Sub takes care of the sign so the display is from +15 to -80


'=====================================================
Sub VolumeUp
Volume = Volume + 1
If Volume >= 15 Then Volume = 15
If Volume < 0 Then
VolumeD = (Volume * -1) + 16
Else
VolumeD=Volume
EndIf
DisplayVolume
End Sub

'====================================================
Sub VolumeDown
Volume = Volume -1
If Volume <= -80 Then Volume=-80
If Volume < 0 Then
VolumeD = (Volume * -1) + 16
Else
VolumeD=volume
EndIf
DisplayVolume
End Sub

'====================================================


Jman
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 08:40am 13 Nov 2015
Copy link to clipboard 
Print this post

34
12db

Show them both?
Micromites and Maximites! - Beginning Maximite
 
VK2MCT
Senior Member

Joined: 30/03/2012
Location: Australia
Posts: 120
Posted: 11:15am 13 Nov 2015
Copy link to clipboard 
Print this post

Most oldly worldly audio equipment used a logarithmic potentiometer rather than a linear one for the volume control.
As I recall, if a linear pot was used there would be very fast volume increase at the beginning of rotation.
John B
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9588
Posted: 05:56pm 13 Nov 2015
Copy link to clipboard 
Print this post

Thanks everyone, for your input.(pardon the pun!)

Special thanks to jman, as he is helping out lots(via email) with the mathematics of the code for the 7419, leaving me to concentrate on the GUI and other stuff. I am also learning heaps about manipulating bits in a byte, which I was totally lost with at the start, so it's all good.

That bloody 7419 volume scale is odd that they don't have sequential data byte values from one end of the scale to the other. What were ST thinking when they made it like that?!(rhetorical)

I have been looking at the alternative audio processor from RHOM, and it just uses straightforward sequence of data bytes from +15dB to -80dB for the volume - 71h to CFh. Job done. None of this odd behaviour around 0dB like the ST chip.

I also feel quite confident with I2C commands now, having issued HEAPS of them to both the 7419, and the slave MM running the relays for the speaker switching.


Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9588
Posted: 02:03am 19 Nov 2015
Copy link to clipboard 
Print this post

UPDATE

Most things are now working, including Bass, Middle, Treble, Volume, Speaker selector, Subwoofer volume, and all four speaker attenuators. All of this is done through the remote control. You can also save the settings you like, and the amp will start-up with those settings, even after power off(by using VAR SAVE and VAR RESTORE talked about in the other thread).

Latest demo video
16.5MB, 4:31

I have not blown a speaker, despite the sound like it - it was all the stuff on the desk under the subs resonating with the bass volume. The camera does not do the volume justice. I built two 12" subs last weekend to connect to the two sub outputs. Now that I have the levels set right, I can't push it past about +5dB on the master volume or it is too loud for me!

The only thing this video does not show, is the source selector, but I think that is on one of the other videos. The memory card ran out while doing this wee video, so I never got a chance to show the source selector, but nothing has changed there except that when you choose an input, it now shows that number before going back to the main screen.

EDIT: Oh, and BTW - the volume/gain/attenuator controls are all in dB. While I can certainly see the merrits of using 00-99 kind of thing, the device uses the dB spec, most modern amps do as well, and it was far easier to cross-reference what the preamp was doing if I use the native dB scale it uses, on the LCD. There would be nothing to stop anyone taking the code, and reworking it for 00-99 if they wanted to. Code is just slightly over 700 lines now - amazing how the code grows as you do various things...
Edited by Grogster 2015-11-20
Smoke makes things work. When the smoke gets out, it stops!
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 03:15am 19 Nov 2015
Copy link to clipboard 
Print this post

BRILLIANT !!

Surely this is a serious contender for a magazine article (or two)

In a nicely finished enclosure I see this being a very professional looking & feeling complete product.

Excluding case and speakers (and time!), what would you guesstimate is the rough component cost?


 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9588
Posted: 03:13am 20 Nov 2015
Copy link to clipboard 
Print this post

Price depends mainly on your choice of amp modules and associated PSU for them.

Using the setup I have here, the amp modules are 100W stereo class-D modules, but that 100W is at 10% THD, which is, surprisingly, still a standard benchmark! I don't like 10% THD as a benchmark, so looking at the datasheet, these amps can do about 70W RMS @ 0.1% THD with a 32v single-rail supply, which is still exceptionally good power output for a fifteen buck stereo amp module! (LINK)

All up, I guess the project has cost about US$150 including the amps, external PSU, case, LCD, remote, all components and PCB manufacture. Definitely not counting time - many hours spent on the code development by myself and jman.

The original concept remains the same in that it is a front-end for power amps of your choice and/or budget, but the modules I am using do exteremely well and are also very cheap indeed.

The ONLY issue I have with the current 7419 chip, is that with no input selected(or mute), the background white-noise is more then I am happy with. You can't hear any of that with the volume up, naturally, and there are no hums or other noise on the output, but the "Tape hiss" is enough to annoy me, so I have designed a new pre-amp mainboard that substitutes the 7419 for the ROHM BD37534FV audio processor chip, and I will port the working code to the new chip. With all the GUI working now, it is just a matter of porting the I2C commands.("Just a matter of" he says!) Both the TDA7419 and the BD37534 are about the same price - US$7 for the 7419, US$4.50 for the 37534. The 7419 is SOIC, whereas the 37534 is SSOP.

Whichever one performs the best, will be the final design I build a constructor pack for and release as a downloadable ZIP file.

EDIT: Opps - you asked for price without case. About US$100 then, as the case was about US$45 or so.Edited by Grogster 2015-11-21
Smoke makes things work. When the smoke gets out, it stops!
 
jman

Guru

Joined: 12/06/2011
Location: New Zealand
Posts: 711
Posted: 10:59pm 28 Dec 2015
Copy link to clipboard 
Print this post

Hi

Grogster was kind enough to send me a set of PCB's for this project awhile
back. So to repay the debt I have been assisting with the code.
The Spectrum Analyser works with the original SPI LCD and a MX170 but runs a little slow matherp kindly wrote a driver for the ILI9325 parallel LCD with this driver
running on MM+ (64pin) the Spectrum Analyser now runs really well

Spectrum Analyser

The bit after about 1 minute shows it really well

Regards
Jman
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 12:20am 29 Dec 2015
Copy link to clipboard 
Print this post

Hi John,

Looks really good there!
Would the spectrum analyser 'software' work on 'any' MM TFT (i.e. SPI or Parallel) or is it specific to the ILI9325.

I am fully aware about speed - just wondering if it would work at all on a SPI TFT 'as is'.

Thanks - and keep up the great work . . . .

WW

EDIT: And how about it running on a SSD1963... ?
sorry for all the questions Edited by WhiteWizzard 2015-12-30
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9588
Posted: 12:20am 29 Dec 2015
Copy link to clipboard 
Print this post

Yes indeed, jman has been of great coding help with this project. He's added support for an RTC and a rotary-encoder control as well as the IR control I started off with. He's also got that fantastic analyser display working - sexy or what?!(rhetorical)

I am developing the 1B PCB's for this project now, which will make use of a MM+ 64-pin controller and the parallel LCD that jman uses in his demo video. We have plans to make use of the MM+ fancy GUI controls for the menus and making selections etc, but I also expect that the rotary-encoder and IR methods will also remain.

I will update this thread with the new PCB version, once I have built one.
Smoke makes things work. When the smoke gets out, it stops!
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 12:25am 29 Dec 2015
Copy link to clipboard 
Print this post

Hi Grogs,

Do you know about it running on a SSD1963 display too??
(Was 'editing' my post when you replied!) . . .
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9588
Posted: 12:26am 29 Dec 2015
Copy link to clipboard 
Print this post

Phil - the analyser is supplied by the 7419 audio processor chip, and jman's code just talks to the 7419 to get this data, then plot the bars on the screen. So, you need the 7419 chip and audio going through it before you could use the analyser output.

From the 7419 manual:





Anything's possible, but I would expect the answer to your question is no.....
Smoke makes things work. When the smoke gets out, it stops!
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 12:29am 29 Dec 2015
Copy link to clipboard 
Print this post

Thanks G - that's useful info
 
     Page 6 of 8    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025