Reel Time Tuning Analysis
(By Graeme)
FAQ
Index
GUI version
Tartini
R
Checking R works
Mac X11 Problems
Nothing happens when I run Polygraph.bat
Changing the graph title
Changing the filenames - doing multiple plots
ARGUMENT '443' --ignored-- etc
What data that Tartini collects is filtered out, and how do I change it?
Moving the tuning slide - What would happen?
Auto centering A4 or another note
What Temperament should I use?
Altering Tuning on a Flute
My graph looks terrible - help!
Can I reverse the order of the notes on the graph?
Need help customizing?
Sample rtest.txt file
Question not answered here?
If you have a question not answered here email Graeme.
groxburgh@infoscience.otago.ac.nz
GUI version
If you include the command line arguments eg:
"C:\Program Files\R\R-2.6.2\bin\R.exe" --no-save < Polygraph.r 440 "-5" "Plot of Irish Flute" 10 "0" equal
then these will be used, but if you don't include them eg:
"C:\Program Files\R\R-2.6.2\bin\R.exe" --no-save < Polygraph.r
Then you'll get a GUI window where you can choose the various settings, name your files etc. etc.
Or on Windows you can launch the GUI by making a shortcut with the above rather than running it as a batch file.
You can leave this window open while you try out various settings, or plot different instruments.
The GUI also has some features not currently available from the command line or batch files.
You can preview the results before writing to .jpg or .pdf by choosing the appropriate display for Windows, X11 etc.
You can choose the input data filename.
There is space for comments which will appear below the graph. You could use this to enter information about the instrument etc.
You can enter the filenames for the output graph and data file.
If you enter "long" (without the quotes) as the filename the output graph and data file will have a name generated from the first line of the comments,
plus the pitch, temperament etc.
If you want to have different values for the defaults in the GUI just edit polygraph.r and change the relevant values all of which are very near the top of the script.
Back to Top
Tartini
You need to get Tartini working first and check you can export a plain text file.
If you're having trouble getting Tartini to work we can't help much. The program is not under active developement at the moment
but hopefully will be again in the future. You can try contacting the authors.
Some people have reported some issues when using it with it locking up at times. We suggest you have a minimum of other
programs running at the same time to reduce the chance of problems.
Back to Top
R
You need to get R installed and check it runs. Check you have a version that is supposed to work on the OS you have. Polygraph.r will probably
work with other versions of R even though we've only checked 2.6.2
Like with Tartini if you're having trouble getting R to run there's not much we can do. There should be help available from where you downloaded R
and you should start looking there.
Back to Top
Checking R works
It should be enough just to start R then close it, but if you like, try cutting and pasting these 3 lines into the R console
(and hit enter after each line if nothing happens)
x <- c(1,2,3,4,5,6,7,8)
y <- c(3,4,5,6,7,8,9,10)
boxplot(x,y,col="gold")
You should get a graph. Now quit R unless you're keen on programming some more!
Back to Top
Mac X11 problems
If you're using a Mac and you're getting an X11 error message you can bypass this problem by sending the output
to a .pdf file instead of a .jpg by changing the setting in the GUI or editing the Polygraph.r file (TextEdit will do). Near the end find
# output graph to JPEG file rather than within R console
jpeg("Polygraph.jpg", width = 800, height = 600, units = "px",)
and change the line above to read
pdf("Polygraph.pdf")
Back to Top
Nothing happens when I run Polygraph.bat
Not on Windows Polygraph.bat is for Windows, but you might find the contents of Polygraph.bat useful if you're using MacOS or Linux.
Make sure you've read the setup instructions.
On Windows
Check that Polygraph.bat and Polygraph.r are in the same directory, along with the file you exported from Tartini which must be named rtest.txt
If nothing happens when you run Polygraph.bat it could be because R is not in the directory that Polygraph.bat is told to look.
Polygraph.bat starts:
"C:\Program Files\R\R-2.6.2\bin\R.exe"
So check the location is correct and edit Polygraph.bat (Notepad will do) to point to the right location if you have installed R somewhere else.
Back to Top
Changing the graph title
You can change the graph title in the GUI or in the .bat file. Just edit "Plot of Irish Flute" to be what title you want.
Changing the filenames - doing multiple plots
You can also modify the .bat file to automatically label the graph, and rename the outputfiles saving them in a different directory.
It takes a while to describe but is easy to set up and extremely easy to use. The description here is for Windows
but the process is pretty similar on the Mac using a Terminal window.
We run this from a command prompt in Windows Type in "plot FluteTest1" and it does the analysis,
and saves the files as FluteTest1.txt (was rtest.txt) It labels the graph FluteTest1 and names the file FluteTest1.jpg (was polygraph.jpg)
plus FluteTest1.txt (was rout.txt - a list of the median values) in whatever directory you set up.
Here's an example batch file:
"C:\Program Files\R\R-2.6.2\bin\R.exe" --no-save < Polygraph.r 440 "-5" "%1" 10 "0" equal
rem For use with version 1.2.x
copy rtest.txt lotsoftests\%1.txt
copy polygraph.jpg lotsoftests\%1.jpg
copy rout.txt lotsoftests\%1-out.txt
This would be saved and named "plot.bat" and can be used in place of "Polygraph.bat"
This is saving the files to a subfolder called "lotsoftests" which needs to be created first.
In Windows when running multiple plots, just keep the command prompt window open; record with Tartini,
export channel to plain text saving the file as rtest.txt the in the command prompt type "plot FluteTest2" (without the quotes)etc.
Next time you can just use the up arrow key to bring back "plot FluteTest2" backspace and change 2 to 3 and all the
graphs will be labeled, and the files named and saved. Don't have any spaces in "FluteTest3" or whatever names you're using.
ARGUMENT '443' --ignored-- etc
You've tried changing some of the "arguments" in the batch file eg 443 instead of 440 and see ARGUMENT '443' __ignored__ flash past.
But the output graph does appear to be different. Yes the __ignored__ is a bit misleading so just ignore it!
If however you have tried changing some values and the graph is not altered it might be because: The .r script will ignore all the
arguments if there are the wrong number of them, so you can't use
.......Polygraph.r 443
to alter just the pitch. You need to use
........Polygraph.r 443 5 "Plot of Irish Flute" 10 "0" equal
Back to Top
What data that Tartini collects is filtered out, and how do I change it?
Firstly we throw out all the data where Tartini has recorded no note at all. Then the filtering we do depends on the setting in the GUI or the value passed to it
in the batch file (or equivalent on Mac etc.)
........Polygraph.r 440 5 boxplot 10 "0" equal
The "argument" above after the 440 is set to 5 as a default and this determines the amount of filtering.
Setting it to 0 would mean no filtering at all.
If the value is not 0 first of all we throw out the quarter of all the data with the lowest volumes. Then we filter on how stable the pitch is.
Using a positive number eg 5 means a data value is thrown out if the data value on either side is more than 5 cents different in pitch.
Using a negative number eg "-5" means a data value is thrown out if the data value on both sides is more than 5 cents different in pitch.
If trying a negative number you need to put quotes around it as above. You can experiment with these values and the amount of data actually included in the plot
(not thrown out) is printed at the foot of the graph. Playing really fast with lots of ornamentation will result in a lot lower % of the data being used.
However you'll notice that even with tight filtering (throwing out lots of data) there's often not much difference in median value compared to no filtering at all.
This is one of the things that we found on initial testing which gave us some confidence that the system was giving us "reasonable" results.
Back to Top
Moving the tuning slide - What would happen?
The program can show you what would happen if you move the tuning slide - not much use if you have the instrument in hand
because you'd just move it and look at what happened. But if you only have a recording this could come in useful.
It's very easy to use but a bit harder to explain. You can do this in the GUI or you could alter a value or two in the .bat file. We have
........Polygraph.r 440 5 boxplot 10 "0" equal
For a small change in slide position you can just alter one value the "0". Change this to "1.5" if lengthening the slide by 1.5mm
or "-2" if shortening the slide by 2mm, like this:
........Polygraph.r 440 5 boxplot 10 "-2" equal
(The quotes are necessary if shortening to pass the -ve number correctly).
However if you have an instrument that is quite a bit away from A440 you need to alter both the pitch and the slide numbers.
Suppose you have a high pitch A452 flute recording. This is around 50cents sharp so you won't get a good graph from it because
half of the data will be assigned to the wrong note! Change the value 440 in the .bat file to 452 and the graph will plot correctly.
To see what would happen if you extended the tuning slide 12mm, you also change the value "0" in the .bat file to "12". So you now have
........Polygraph.r 452 5 boxplot 10 "12" equal
This does mean that you can only use the pitch shift for a D flute and not a high D whistle, Bb flute etc.
One last point is that this will only work for boxplot. If you're doing a vioplot then set the "0" to "1.5" or some other value to set
the smoothing factor in vioplot. Back to Top
Auto centering A4 or another note
You can get the program to automatically put G4, A4, B4 or D5 at zero cents and move all the other notes as if you'd moved the tuning slide to get A4 in tune. Just select this from the GUI version. (This will not work if doing a chromatic plot.) Or edit the .bat file - change "equal to "zeroG4", "zeroA4" etc to do this. You can't use this and justD temperament at the same time.
Well not directly from the .bat file. You could easily edit the .r file to do so however. And you can easily edit the .r file
if you want to center on a different note than G4, A4, B4 or D5.
What Temperament should I use?
This is up to you. Many accordions will be tuned to Equal Temperament,
whereas the pipes are probably tuned to something like JustTemperament in D (JustD).
A guitar might be tuned to Equal Temperament and a fiddle may well be played in one or the other or something else again.
Nobody seems to die when these are played together! There's a plot of fiddle at the foot of this page
here, and an accordion plot near the top of this page
here.
If your natural tendency on your flute is one or the other or somewhere in between you should be fine.
Perhaps you could use this software to look at what good players do.
If you think that answer is a bit short you probably also realise that we could have a whole website about this topic and people
have different opinions. It's possible that this software will show that there are bigger fish to fry.
Back to Top
Altering Tuning on a Flute
If you have problem note or two here's a page on how to do a reversible lowering of the pitch of a note by modifying the flute
using beeswax. Or you might be able to alter how you blow the flute as explained here.
Back to Top
My graph looks terrible - help!
If you can't figure out what's happening email a copy of your rtest.txt file to Graeme and he'll have a look.
Back to Top
Can I reverse the order of notes on the graph?
Yes. It's in the GUI version or you can edit the Polygraph.r file. Near the end find these lines:
boxplot(notes, ............
# boxplot(rev(notes), ............
and change these to:
# boxplot(notes, ............
boxplot(rev(notes), ............
Back to Top
Need help customizing?
If you can't figure out what to alter in the .r file send an email to Graeme explaining your problem.
Back to Top
Sample rtest.txt file
Here's a sample rtest.txt file. This is Graeme playing the Monzani flute.
Back to Top
|