Welcome to the Piano World Piano Forums
Over 2.7 million posts about pianos, digital pianos, and all types of keyboard instruments
Join the World's Largest Community of Piano Lovers (it's free)
It's Fun to Play the Piano ... Please Pass It On!

SEARCH
Piano Forums & Piano World
(ad)
Piano Life Saver - Dampp Chaser
Dampp Chaser Piano Life Saver
What's Hot!!
Mr. PianoWorld - the full interview
-------------------
European Tour for Piano Lovers
JOIN US FOR THE TOUR!
--------------------
Posting Pictures on the Forums
-------------------
Forums RULES & HELP
-------------------
ADVERTISE on Piano World
Find a Professional
Our Classified Ads
Find Piano Professionals-

*Piano Dealers - Piano Stores
*Piano Tuners
*Piano Teachers
*Piano Movers
*Piano Restorations
*Piano Manufacturers

Advertise on Piano World

(ad)
Piano Buyer Guide
Piano Buyer Spring 2018
ad
Pierce Piano Atlas


Who's Online Now
105 registered members (AZ_Astro, Beowulf, anotherscott, ando, Alex C, AprilE, 20 invisible), 1,430 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
(ad)
Estonia Pianos
Estonia Pianos
Quick Links to Useful Piano & Music Resources
Quick Links:
*Advertise On Piano World
*Free Piano Newsletter
*Online Piano Recitals
*Piano Recitals Index
*Piano & Music Accessories
*Live Piano Venues
*Music School Listings
* Buying a Piano
*Buying A Acoustic Piano
*Buying a Digital Piano
*Pianos for Sale
*Sell Your Piano
*How Old is My Piano?
*Directory/Site Map
*Virtual Piano
*Music Word Search
*Piano Videos
*Virtual Piano Chords & Scales
Previous Thread
Next Thread
Print Thread
Temperament Tuner #2575562
10/02/16 12:12 PM
10/02/16 12:12 PM
Joined: May 2001
Posts: 3,586
H
Hakki Offline OP
3000 Post Club Member
Hakki  Offline OP
3000 Post Club Member
H

Joined: May 2001
Posts: 3,586
Hello all,

It's been awhile since I have not posted.

Recently I wrote a program for tuning the F3-A4 equal temperament.

Here is the link to the program:
https://app.box.com/s/rb6kpmf8ujmllvqotfz4x4vs52q1gq3g

It is a java program and needs jre installed on the computer beforehand.

You can install jre from here:
http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html

The usage is simple. Just measure the inharmonicity of notes between F3 and A4 by pressing the # key. When all the notes are measured the tuning is calculated and ready for tuning.
The dial indicator shows +/- 15 cents. c+- buttons are for offsetting the A4 440 if you need to.

Make sure that the microphone recording is free from any artificial enhancements supplied by the sound cards, such a noise removal or etc.

I hope you enjoy the results.


Last edited by Hakki; 10/02/16 12:16 PM.
(ad 800)
PTG Convention
PTG Journal
Re: Temperament Tuner [Re: Hakki] #2575612
10/02/16 04:22 PM
10/02/16 04:22 PM
Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
C
Chris Leslie Offline
1000 Post Club Member
Chris Leslie  Offline
1000 Post Club Member
C

Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
Hakki, I could not launch the file on my computer (AppleMac). My computer is set up right because I use Java myself.


Chris Leslie ARPT
Piano technician
http://www.chrisleslie.com.au
Re: Temperament Tuner [Re: Hakki] #2575617
10/02/16 04:41 PM
10/02/16 04:41 PM
Joined: May 2001
Posts: 3,586
H
Hakki Offline OP
3000 Post Club Member
Hakki  Offline OP
3000 Post Club Member
H

Joined: May 2001
Posts: 3,586
Chris, I have tested it only on Windows 10 and 8.1.
It needs an available default recording device to launch. Also you can try the java -jar HBTuner_V1.jar command from the command line and see if that works.

Re: Temperament Tuner [Re: Hakki] #2575624
10/02/16 05:00 PM
10/02/16 05:00 PM
Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
C
Chris Leslie Offline
1000 Post Club Member
Chris Leslie  Offline
1000 Post Club Member
C

Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
Running from the terminal console I get:

Exception in thread "main" java.lang.NoClassDefFoundError: HBTunerV1
Caused by: java.lang.ClassNotFoundException: HBTunerV1
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

If I run other .jar files from the same folder they work ok.

I wonder if you are not setting up the manifest file correctly? I could send you an example of mine.

Edit: I removed the underscore in the name just in case but makes no difference.

Last edited by Chris Leslie; 10/02/16 05:01 PM.

Chris Leslie ARPT
Piano technician
http://www.chrisleslie.com.au
(ad)
Piano & Music Accessories
piano accessories music gifts tuning and moving equipment
Re: Temperament Tuner [Re: Hakki] #2575638
10/02/16 05:38 PM
10/02/16 05:38 PM
Joined: May 2001
Posts: 3,586
H
Hakki Offline OP
3000 Post Club Member
Hakki  Offline OP
3000 Post Club Member
H

Joined: May 2001
Posts: 3,586
Chris, I don't have access to a Mac. I am afraid I am not able to fix the problem. In any case I used java se 8u102 to compile if that would help.

Re: Temperament Tuner [Re: Hakki] #2575660
10/02/16 08:14 PM
10/02/16 08:14 PM
Joined: Jan 2010
Posts: 3,087
Montreal, Quebec, Canada
M
Mark Cerisano Offline
3000 Post Club Member
Mark Cerisano  Offline
3000 Post Club Member
M

Joined: Jan 2010
Posts: 3,087
Montreal, Quebec, Canada
I have created an ear training app using html5 and JavaScript. No platform issues, just some browser compatibility, which oddly enough is because the browser is behind the times, not the other way around. I love that about web apps.

Is there a reason why you and Chris like Java? I guess I'm looking for the pros. (vs the cons). If it's because you are comfortable with it, I get it. I still think I'm better at qbasic than JavaScript! 😄


Mark Cerisano, RPT, B.Sc.(Mech.Eng), Dip.Ed.(Music)
www.howtotunepianos.com
Re: Temperament Tuner [Re: Hakki] #2575688
10/02/16 10:25 PM
10/02/16 10:25 PM
Joined: May 2010
Posts: 103
Fort Worth, TX
N
Nathan M., RPT Offline
Full Member
Nathan M., RPT  Offline
Full Member
N

Joined: May 2010
Posts: 103
Fort Worth, TX
I think you pretty much said it -- with a web app you're at the mercy of the browser. With java you're at the mercy of which JRE is installed. Pick your poison smile

That being said, web apps really have caught up so much in terms of capability these days. Pretty much the only argument people seem to be making for desktop apps is that they have easy access to system notifications, and that sort of thing. That and the ability to run disconnected, but I'm pretty sure you can work around that one by saving the webpage to disk...


Nathan Monteleone
Piano Technician / Rebuilder
PTG Registered Piano Technician

My pianos (in various states of rebuild):
- 1900 Mason and Hamlin AA
- 1911 J&C Fischer 6'2" grand
- 1935 Story and Clark vertical
Re: Temperament Tuner [Re: Hakki] #2575690
10/02/16 10:29 PM
10/02/16 10:29 PM
Joined: May 2010
Posts: 103
Fort Worth, TX
N
Nathan M., RPT Offline
Full Member
Nathan M., RPT  Offline
Full Member
N

Joined: May 2010
Posts: 103
Fort Worth, TX
Hakki and Chris -- I was able to download and run the app successfully on my machine (Macbook pro running OSX 10.11.6, Java 8 update 101). Didn't actually try to use it as my wife's sleeping so I can't go plunking on the piano right now. But the UI came up and everything seemed to be in order.


Nathan Monteleone
Piano Technician / Rebuilder
PTG Registered Piano Technician

My pianos (in various states of rebuild):
- 1900 Mason and Hamlin AA
- 1911 J&C Fischer 6'2" grand
- 1935 Story and Clark vertical
Re: Temperament Tuner [Re: Hakki] #2575730
10/03/16 03:44 AM
10/03/16 03:44 AM
Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
C
Chris Leslie Offline
1000 Post Club Member
Chris Leslie  Offline
1000 Post Club Member
C

Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
Launches ok on my wife's Windows computer, but not my Mac. I cannot use it however because there is no piano near the computer.

Can you explain a little about how your algorithms work? How ETDs determine the stretched P1 frequencies in the temperament section has always been a mystery to me. Also, how do you measure pitch, FFT, or some sort of phase shift method, and what is the tolerance?


Chris Leslie ARPT
Piano technician
http://www.chrisleslie.com.au
Re: Temperament Tuner [Re: Hakki] #2575757
10/03/16 07:44 AM
10/03/16 07:44 AM
Joined: May 2001
Posts: 3,586
H
Hakki Offline OP
3000 Post Club Member
Hakki  Offline OP
3000 Post Club Member
H

Joined: May 2001
Posts: 3,586
Chris, since Nathan has managed to launch it on his Mac maybe you can PM him for the full details. I will try to answer your questions when I get home.

Re: Temperament Tuner [Re: Hakki] #2575805
10/03/16 11:09 AM
10/03/16 11:09 AM
Joined: May 2001
Posts: 3,586
H
Hakki Offline OP
3000 Post Club Member
Hakki  Offline OP
3000 Post Club Member
H

Joined: May 2001
Posts: 3,586
Chris, I can't elaborate on how ETDs calculate the temperament, but I can explain the algorithm I use. Of course I only tested it on my own piano and got good results, and I think it should work on any other piano too. This needs confirmation from the members who might try it on different pianos.

Anyway, I am using FFT to measure the partials and calculate the inharmonicty. The accuracy is below 0.1 cent. At first I considered algorithms such as Nedler-Mead derivative free search or Generalized reduced Gradient to estimate the inharmonicty and the fundamental. Then it seemed to much of a programming overhead for the extra benefit. So I decided to calculate all the inharmonicity values between all possible combinations of partials and take the median. I checked my results against the GRG-II non-linear algorithm that Excel Solver uses, and they were really very close.

For the calculation of the temperament, I am using a continuous improving search algorithm that minimizes error functions. It is actually very similar to what an aural tuner would do. M3s, contiguous M3s and M4s are estimated and then the temperament is iterated several times improving the estimates in each iteration, and changing the direction of the iteration as needed. Finally the algorithm stops when the error functions reach a pre-determined minimum. The absolute measuring accuracy of the tones is between 0.28-0.67 cents theoretically, depending on which frequency is being measured. but I have not measured the accuracy of repeatability, but it should be lower.

I already have an enhancement ready for the next version. But I am planning to implement it along with any other suggestions that I might get.

Hope this helps.

Re: Temperament Tuner [Re: Hakki] #2575897
10/03/16 04:23 PM
10/03/16 04:23 PM
Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
C
Chris Leslie Offline
1000 Post Club Member
Chris Leslie  Offline
1000 Post Club Member
C

Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
Thanks Hakki. Looks like you have been having a fun, and frustrating I am sure, time.

When calculating iH from the partials, rather than taking an average of all combinations is it possible to only use the few most prominent partials? To do this will also require an amplitude parameter for each partial.

When you run an FFT on the note being measured, are you able to restrict the frequency bandwidth? The usual way seems to be to go across the whole frequency spectrum for the analysis the catch all the harmonics. This is very time consuming and computer intensive. You may do this already, but the way I have experimented with is to run an algorithm over a restricted frequency band. So for example, to measure A4 at 440Hz I analyse 50cents either side of 440Hz, then 50cents either side of 880Hz, then 50 cents either side of 176Hz etc up to whatever partial seems enough, say up to six partials. Although this may seem more complex it save alot of computing time and only concentrates in the areas where we know that piano partials will be.


Chris Leslie ARPT
Piano technician
http://www.chrisleslie.com.au
Re: Temperament Tuner [Re: Mark Cerisano] #2575923
10/03/16 07:19 PM
10/03/16 07:19 PM
Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
C
Chris Leslie Offline
1000 Post Club Member
Chris Leslie  Offline
1000 Post Club Member
C

Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
Originally Posted by Mark Cerisano, RPT
I have created an ear training app using html5 and JavaScript. No platform issues, just some browser compatibility, which oddly enough is because the browser is behind the times, not the other way around. I love that about web apps.

Is there a reason why you and Chris like Java? I guess I'm looking for the pros. (vs the cons). If it's because you are comfortable with it, I get it. I still think I'm better at qbasic than JavaScript! 😄

Mark, Javascript is too restrictive for many of the things we like to program but it has it's place. I like Java though because it is relatively easy and has lots of support and examples. Also, I like to construct my graphical interfaces by hand with primitive graphical elements which are good and native within Java.
Qbasic is a great language to use and seems to be able to do just about anything. Trouble is that some professionals may turn up their noses because it is "Basic", but it really can do anything that "C" can do but much simpler. Just be sure to use proper constructs and not lapse into writing spaghetti code.

Last edited by Chris Leslie; 10/03/16 07:21 PM.

Chris Leslie ARPT
Piano technician
http://www.chrisleslie.com.au
Re: Temperament Tuner [Re: Chris Leslie] #2575938
10/03/16 08:51 PM
10/03/16 08:51 PM
Joined: May 2010
Posts: 103
Fort Worth, TX
N
Nathan M., RPT Offline
Full Member
Nathan M., RPT  Offline
Full Member
N

Joined: May 2010
Posts: 103
Fort Worth, TX
Originally Posted by Chris Leslie
Mark, Javascript is too restrictive for many of the things we like to program but it has it's place.


You might be surprised... (I sorta lost an argument with a coworker on this one a year or two ago). For example they have libraries to do FFT's in Javascript. They're not as fast as a native implementation, but fast enough for some purposes. With Canvas you can have complete control over the way things are rendered, if you like. And there are nice libraries of custom controls built on top of that. I was kind of sad to find this out because I'm not too crazy about Javascript as a language, particularly the whole thing of not having to declare variables frown But ever since the html5 stack got up and running it's become a lot cleaner and more capable than it was in, say, 2010.


Nathan Monteleone
Piano Technician / Rebuilder
PTG Registered Piano Technician

My pianos (in various states of rebuild):
- 1900 Mason and Hamlin AA
- 1911 J&C Fischer 6'2" grand
- 1935 Story and Clark vertical
Re: Temperament Tuner [Re: Chris Leslie] #2575948
10/03/16 09:36 PM
10/03/16 09:36 PM
Joined: May 2010
Posts: 2,499
Vancouver, Canada
DoelKees Offline

2000 Post Club Member
DoelKees  Offline

2000 Post Club Member

Joined: May 2010
Posts: 2,499
Vancouver, Canada
Originally Posted by Chris Leslie
Thanks Hakki. Looks like you have been having a fun, and frustrating I am sure, time.

When calculating iH from the partials, rather than taking an average of all combinations is it possible to only use the few most prominent partials? To do this will also require an amplitude parameter for each partial.

When you run an FFT on the note being measured, are you able to restrict the frequency bandwidth? The usual way seems to be to go across the whole frequency spectrum for the analysis the catch all the harmonics. This is very time consuming and computer intensive. You may do this already, but the way I have experimented with is to run an algorithm over a restricted frequency band. So for example, to measure A4 at 440Hz I analyse 50cents either side of 440Hz, then 50cents either side of 880Hz, then 50 cents either side of 176Hz etc up to whatever partial seems enough, say up to six partials. Although this may seem more complex it save alot of computing time and only concentrates in the areas where we know that piano partials will be.

Calculating iH from the partials: Method I found working best is to first eliminate very weak partials, then eliminate outliers (that do not fit the standard IH curve), and do a non-linear least squares fit on the remaining measured partials to get the IH coefficient.

Kees

Re: Temperament Tuner [Re: Nathan M., RPT] #2575968
10/03/16 11:13 PM
10/03/16 11:13 PM
Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
C
Chris Leslie Offline
1000 Post Club Member
Chris Leslie  Offline
1000 Post Club Member
C

Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
Originally Posted by Nathan Monteleone
Originally Posted by Chris Leslie
Mark, Javascript is too restrictive for many of the things we like to program but it has it's place.


You might be surprised... (I sorta lost an argument with a coworker on this one a year or two ago). For example they have libraries to do FFT's in Javascript. They're not as fast as a native implementation, but fast enough for some purposes. With Canvas you can have complete control over the way things are rendered, if you like. And there are nice libraries of custom controls built on top of that. I was kind of sad to find this out because I'm not too crazy about Javascript as a language, particularly the whole thing of not having to declare variables frown But ever since the html5 stack got up and running it's become a lot cleaner and more capable than it was in, say, 2010.


Thanks Nathan. I guess I am getting to far behind with things frown


Chris Leslie ARPT
Piano technician
http://www.chrisleslie.com.au
Re: Temperament Tuner [Re: Hakki] #2576074
10/04/16 12:47 PM
10/04/16 12:47 PM
Joined: May 2001
Posts: 3,586
H
Hakki Offline OP
3000 Post Club Member
Hakki  Offline OP
3000 Post Club Member
H

Joined: May 2001
Posts: 3,586
Chris, you are right. I am restricting the bandwidth for the FFT while measuring the frequencies. Also, I am not using an average of the calculated inharmonicity values, but rather the median.

Re: Temperament Tuner [Re: Hakki] #2576115
10/04/16 04:25 PM
10/04/16 04:25 PM
Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
C
Chris Leslie Offline
1000 Post Club Member
Chris Leslie  Offline
1000 Post Club Member
C

Joined: Jan 2011
Posts: 1,546
Canberra, ACT, Australia
Sorry I don't have a portable computer to take to my piano at the moment, and the application will not yet launch on my Mac.


Chris Leslie ARPT
Piano technician
http://www.chrisleslie.com.au
Re: Temperament Tuner [Re: Hakki] #2576123
10/04/16 05:25 PM
10/04/16 05:25 PM
Joined: May 2001
Posts: 3,586
H
Hakki Offline OP
3000 Post Club Member
Hakki  Offline OP
3000 Post Club Member
H

Joined: May 2001
Posts: 3,586
Chris, I am currently correcting a few bugs and enhancing the temperament calculation. Will post version 1.1 soon.
Did you try loading the java se 8u102 update.

Also you might try a folder name that does not contain any spaces or characters other than letters if that is not the case already. The error you posted seems related to loading the scroll bar image (a PNG file, with PNG extension in capital letters) using the java.net.URL class.

Re: Temperament Tuner [Re: Hakki] #2576172
10/04/16 10:55 PM
10/04/16 10:55 PM
Joined: Feb 2009
Posts: 1,545
PA
daniokeeper Offline
1000 Post Club Member
daniokeeper  Offline
1000 Post Club Member

Joined: Feb 2009
Posts: 1,545
PA
I just tried it on my Linux box. I'm unning IcedTea which put out the following errors:
Code
$ java -jar /home/joegumbo/Downloads/HBTuner_
V1.jar
Exception in thread "main" java.lang.Unsuppor
tedClassVersionError: Hbtuner : Unsupported m
ajor.minor version 52.0
        at java.lang.ClassLoader.defineClass1
(Native Method)
        at java.lang.ClassLoader.defineClass(
ClassLoader.java:803)
        at java.security.SecureClassLoader.de
fineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClas
s(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100
(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLC
lassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLC
lassLoader.java:355)
        at java.security.AccessController.doP
rivileged(Native Method)
        at java.net.URLClassLoader.findClass(                         URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(Cl                         assLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.l                         oadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(Cl                         assLoader.java:358)
        at sun.launcher.LauncherHelper.checkA                         ndLoadMain(LauncherHelper.java:482)


But for this, i'll install Oracle's Java.

Congratulations!

-Joe

Edit: I'm running into some java install issues here. I'll test later.


Last edited by daniokeeper; 10/05/16 01:26 AM.

Joe Gumbosky
Piano Tuning & Repair
www.morethanpianos.com
(semi-retired)

Moderated by  Piano World 

(ad)
Sweetwater - Keyboards
Sweetwater
New Topics - Multiple Forums
Piano environment monitoring
by Chris Snyder. 10/23/18 09:57 AM
Basic Canon Practice - Mary Had a Little Lamb
by LooneyTune. 10/23/18 09:45 AM
unbalanced lineout to balanced xlr speaker in?
by varignet. 10/23/18 09:40 AM
Impressions of the Shanghai Music Show
by Campanella12. 10/23/18 08:37 AM
I have violated Chris Tomlin's copyright?
by johnlewisgrant. 10/23/18 08:34 AM
(ad)
Pianoteq
PianoTeq Petrof
Forum Statistics
Forums40
Topics187,951
Posts2,754,914
Members91,316
Most Online15,252
Mar 21st, 2010
(ad)
Accu-Tuner
Sanderson Accu-Tuner
Please Support Our Advertisers
Dampp Chaser Piano Life Saver

Sweetwater

PianoTeq Petrof
Piano Buyer Spring 2018
Visit our online store for gifts for music lovers


 
Help keep the forums up and running with a donation, any amount is appreciated!
Or by becoming a Subscribing member! Thank-you.
Donate   Subscribe
 
Our Piano Related Classified Ads
| Dealers | Tuners | Lessons | Movers | Restorations | Pianos For Sale | Sell Your Piano |

Advertise on Piano World
| Subscribe | Piano World | PianoSupplies.com | Advertise on Piano World |
| |Contact | Privacy | Legal | About Us | Site Map | Free Newsletter |


copyright 1997 - 2018 Piano World ® all rights reserved
No part of this site may be reproduced without prior written permission
Powered by UBB.threads™ PHP Forum Software 7.6.2