Click here to Skip to main content
Click here to Skip to main content

Pitch

By , 9 Jun 2003
 

Sample Image - maximum width is 600 pixels

Introduction

This program is intended to help musical students increase their skills in acquiring perfect pitch and in recognising intervals.

The History of Pitch

The idea for this program goes back to 1993. My son, who was a music student, wanted to acquire ‘perfect pitch’ after seeing an advertisement of how one could train themselves. I sent off to New York and purchased the audio tapes and booklet at some rather dear price. In the next few months we had many sessions where I sat playing notes on a guitar testing him. I decided to try to computerise the procedure so he could test himself and record a history of how he was progressing. Had an Amiga in those days and wrote an AREXX script which randomly played different notes and then accepted keyboard input for his answers. I remember it had problems but did work. Main problem was the timbre.

When I bought an IBM pc in 1994 my daughter, also a muso, suggested I write a better program and also test intervals (relative pitch). Having done a little C but no C++ I bought a few of the SAMS and QUE books and started. It took a long time to get the midi bit controlled. Somewhere about 1997 I packed it away even though I had some ideas on doing a chords function. This year I looked at it again and found that the THREED objects required a licence on my current compiler. Still not sure what happened there as they came with one of the books I bought. Found “The Code Project” and many free button objects to replace the THREED ones. Reprogrammed that in February.

There are a few things I’m unhappy with in the program. I couldn’t get a timer for the whole program. There are currently 2 sections, Perfect Pitch and Relative Pitch, which have there own timer functions. Just didn’t know how to do it. The Score windows are poor. Never thought of a good way to display the results. Also wanted to do something on Chords but I’m not even sure now what I wanted to do. Might have time to look at this again later this year but not now. So I thought I’d put the code into the public domain. It is all original except for the midi definitions in the PitchDlg.h file and the new button controls like ShadeButton. I can not give credit on the midi definitions as I’ve lost where they came from. No apologies for the coding techniques. I am not a C programmer. I have been a mainframe programmer for 43 years (showing my age here) and most of those were using assembler and its predecessors. The last 6 years my main language was PL/X, an internal IBM language very similar to PL/I. Am hoping someone finds the idea interesting enough to clean it up or add to it. If so, I’d appreciate a copy of any mods they make.

Points of Interest

The main window has push buttons for three music functions (Perfect Pitch, Relative Pitch and Chords). The Chords function is not written. Also the Help button is not programmed. Relative Pitch displays a window with a selection section on the left and an answer section on the right. The idea is for the user to select the intervals they want to test on. There are a few controls which allow the selected interval note range to be controlled, the time between the intervals to be set and the direction of the notes to be either only up or only down or either way.

Each function also has a right mouse button popup with instrument selection, difficulty level (not programmed), midi port selection, note length, preferences and help (not programmed). There is only one preference programmed. There is also a score push button. When hovering over it a summary of the score is display over the button. If pressed, a more detailed window is opened. The play button is activated when an interval has been selected. The play button becomes a replay button once pushed until an answer has been given. The Perfect Pitch function is similar except the selection criteria are the twelve notes in the scale. There is no 'select all' in Perfect Pitch only because it didn't seem as necessary as in Relative Pitch. There is some metrics code to account for different resolutions but it is insufficient. It remembers where each main window was placed and restarts there. The size of each window is fixed. The colours are because i like purple and pink.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

bennyrascal
Web Developer
Australia Australia
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralCompilation ErrorsmemberChris Korzeniowski28 Jun '04 - 15:30 
Hi, I tried compiling under VC.NET 2003 and got loads lots of errors, involving casting in RelDlg.cpp and PerfDlg.cpp.
 
Looking at the lines, it's 166 and 167 in PerfDlg and almost all of 156 - 194, both of which are the message maps.
 
Not knowing MFC, the only inference I can make is the definition of the functions are bad, in MFC 7.
 
Would anyone know how to fix this?
GeneralRe: Compilation Errorsmemberbennyrascal29 Jun '04 - 6:46 
Chris
 
Pitch was last written in VC6 before .Net existed. i just finished a semester at TAFE which included VB.Net, C#.Net and Java. C# was my best subject so i would normally spend time during the next 4 week's break to convert Pitch to it. However, i made a major decision after my exams.....bye, bye Windows. i am now in the deep end with multiboot SUSE, RedHat and Mandrake systems. Still, i'll see what i can do during my hols.
 
benny
QuestionWhat about Pitch Detection AlgorithmmemberDavid Mikhaeli29 May '03 - 1:26 
The program doesn't work on my computer from some reason but maybe you should add a pitch detection algorithm (HPS,Cepstrum?) to make this program more user friendly... as a matter of fact I already did something close to this program but didn't have time to finish it...
 
David Michaeli
davyos_m@yahoo.com
AnswerRe: What about Pitch Detection Algorithmmemberbennyrascal30 May '03 - 18:57 
Need more info on what failed. i have just sent new source to the webmaster to fix a prob with no sound. i also found that the 'release' version crashes. Not sure how to trace without debug. Try building the 'debug' version and executing it.
 
benny
GeneralNo SoundmemberWagner20 May '03 - 5:31 
I wanted to take a look at the source and try it out. When I press play I don't get any sound. I dropped a break point in and everything return without error. I was wondering if anyone out there could help me out.
 
---
 
Okay I figured it out. I downloaded Wrapper Library for Windows MIDI API and found a port setting there that allowed the MIDI stuff to be played. I tried to set the port in this application, but found that you can not set it. The context menu handler is incomplete. I had to go in and hard code it to port 1. No big deal. Anyway after that it worked fine.
GeneralRe: No Soundmemberbennyrascal20 May '03 - 9:19 
Thought i has fixed that problem a few years ago. Since my current PC only has one sound port it is difficult for me to test. i will change the code and see if i can test it on another computer and then update the PitchDlg.cpp file which handles this.
 
benny
GeneralRe: No Soundmemberbennyrascal30 May '03 - 18:38 
Problem fixed with Robert's help. The right mouse button pop-up 'port' option was not functioning correctly.
 
benny
QuestionDoes that "Perfect Pitch" course work ?memberStone Free13 May '03 - 23:10 
I have seen advertisements for Perfect Pitch ever since I started buying american guitar mags like "Guitar World" but was always dubious about their claims.
AnswerRe: Does that "Perfect Pitch" course work ?memberbennyrascal14 May '03 - 0:01 
My son didn't do it long enough to give an opinion. i remember there were comments in the course of how one could relate tones to colours. What definately works is relative pitch. My daughter use to get 97% or more correct when she used it..

AnswerRe: Does that "Perfect Pitch" course work ?membercraigherren3 Sep '03 - 12:09 
I have a recent revision of the Perfect Pitch course and stumbled onto this page because I'm now a programmer who decided to try the very same thing. I can say in listening to the couse and having been a musician that you quickly recognize that it is possible to develop perfect pitch as advertised. The "trick" is having the discipline to follow the exercises outlined to develop your ear. In this case the discipline is more important than the effort applied. A tool like the one begun here is a great way for someone with a busy schedule to keep that discipline.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 10 Jun 2003
Article Copyright 2003 by bennyrascal
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid