Composing my own composing software

The Ultimate On-Line Whistle Community. If you find one more ultimater, let us know.
Trurl
Posts: 20
Joined: Sun Mar 23, 2008 12:48 pm

Composing my own composing software

Post by Trurl »

For kicks, I wanted to write some programs to allow me to play my whistle and have the computer write the music. In preparation for this, I'm looking into alternatives, but the only thing I've found is Sibelius, which seems to allow this, but only through a midi synthesized instrument. Is there anyone here who uses Sibelius who can comment on this feature? Alternately, anyone know about similar software, or has interest in this?

Now...time to learn about Fourier transforms, pitch detection, and general Whistle Analysis!
Last edited by Trurl on Wed Jul 23, 2008 1:54 am, edited 1 time in total.
charlie_butterworth
Posts: 146
Joined: Tue Mar 25, 2008 10:29 pm
Please enter the next number in sequence: 1
Location: Arizona

Post by charlie_butterworth »

I use Sibelius 4, but am by no means an expert. The basic edition has a bunch of extra instruments in the Kontakt music bundle, but it doesn't include a whistle. However, the DLS sound on my Mac does have a whistle, but it sounds pathetic.

However, I really like the note input abilities and the options for grace notes which can be used for "crude" whistle ornamentation.

I hope this helps,
Charlie
User avatar
Impempe
Posts: 149
Joined: Thu Dec 02, 2004 8:06 am
antispam: No
Location: Kwa-Zulu Natal, South Africa
Contact:

Post by Impempe »

let us know when you find something that does this - I would be very interested.
Democracy without morality is impossible. Jack Kemp
User avatar
MTGuru
Posts: 18663
Joined: Sat Sep 30, 2006 12:45 pm
antispam: No
Please enter the next number in sequence: 8
Location: San Diego, CA

Post by MTGuru »

Google "Music Recognition Software" for some audio to MIDI / score packages.
Vivat diabolus in musica! MTGuru's (old) GG Clips / Blackbird Clips

Joel Barish: Is there any risk of brain damage?
Dr. Mierzwiak: Well, technically speaking, the procedure is brain damage.
Trurl
Posts: 20
Joined: Sun Mar 23, 2008 12:48 pm

...

Post by Trurl »

(Status Summary as of 07/23: I have written my own version of a single note tuner that can detect and classify any SINGLE note.)



Thanks for the info so far. As far as I can tell, commercial programs only do this for MIDI music, which is fine but it requires a MIDI synthesized instrument.

After playing around for a few hours, I can see why. It's pretty hard to handle raw music, mainly on the timing side.

So far, I've essentially written my own version of any of the millions of software tuners out there, so I can detect any single note played. Primitive but fun to write and encouraging. At present, I'm recording a sound clip from my whistle into a .wav file and analyzing that. I hope to try real time analysis at some point but I'm working with MATLAB and I'm not sure how to input my microphone data.

Here's my current issue: I'm trying to determine how to detect multiple notes played in sequence. To those of you with any interest or familiarity...I fourier transform the waveform (i.e. a waveform of low D) and then search for the strongest frequency response, which I then match to a note and a degree of sharp/flatness.

However, this method essentially eliminates time data, meaning that if I have two notes in the clip, I can detect them correctly, but I lose the data concerning note order and note duration (whole note, half note, etc.). I'm also going to run into trouble, I think, if I don't include some way to set the time signature ahead of time since note timings are relative...My current plan calls for a frequency vs. time data set which should make this possible...Any thoughts/advice/insults/etc?

I'll keep playing around and if I get something working I'll definitely share it. I realize this isn't the most useful thing (why not just use paper), but it's fun to work on.
User avatar
Pyroh
Posts: 371
Joined: Sat Jul 14, 2007 2:10 pm

Post by Pyroh »

Wow, a great idea!

For me, it would be very useful, as sometimes I just lie in my bed, try some improvisation, and if things are right, it sounds nice and I´d love to be able to play it anytime I like...but I can´t.

If I can help you with some easy stuff, I´ll be glad to.
Trurl
Posts: 20
Joined: Sun Mar 23, 2008 12:48 pm

...

Post by Trurl »

Glad to hear you're interested! I may pester you once the nitty gritty stuff is out of the way (which is starting to look feasible). Are you familiar with coding at all?

In the meantime, would someone with a high quality recording set-up be so kind as convey to me a .wav file containing any 3 notes of your choice so long as they are in the same octave? I've only got my built in microphone which picks up a fair bit of noise. I'm working on filtering and removing outliers, but I'd like to see what a higher class recording set-up produces. Please PM me if you'd like to help. For your troubles I'll send you the analytical graphs I get from your music! Exciting, no?
User avatar
RonKiley
Posts: 1404
Joined: Sun Mar 16, 2003 12:53 pm
Please enter the next number in sequence: 1
Location: Germantown, MD

Post by RonKiley »

You can do exactly what you want in Finale McNotator. Play your whistle into a mic and it writes out the note.

Ron
I've never met a whistle I didn't want.
User avatar
Denny
Posts: 24005
Joined: Mon Nov 17, 2003 11:29 am
antispam: No
Location: N of Seattle

Post by Denny »

ya, but....he'll learn so much by tryin'
User avatar
fearfaoin
Posts: 7975
Joined: Thu Oct 16, 2003 10:31 am
antispam: No
Location: Raleigh, NC
Contact:

Post by fearfaoin »

I've been thinking about this sort of thing as well. I wonder if you can
use a Goertzel Filter, and apply it to a fixed window size (which is a buffer
of samples that is shifted every time a new sample comes in). That way,
whenever the detected frequency drops past your note threshold, that's
the start of a new note.

Here's some inspiration if you need it: this guy's software converts
monophonic WAV files into MIDI:

http://www.akoff.com/music-composer.html

Make sure to check out the samples.

Also, there was a lot of buzz about Melodyne's Direct Note Access, which
lets you make a lot of changes to individual notes in a polyphonic sample:

http://www.youtube.com/watch?v=jFCjv4_jqAY
User avatar
Pyroh
Posts: 371
Joined: Sat Jul 14, 2007 2:10 pm

Post by Pyroh »

RonKiley wrote:You can do exactly what you want in Finale McNotator. Play your whistle into a mic and it writes out the note.

Ron
Indeed, but for $600?
User avatar
Pyroh
Posts: 371
Joined: Sat Jul 14, 2007 2:10 pm

Post by Pyroh »

Hm, I tried those programs, it seems that the biggest problem is understanding of ornaments...because those midi outputs were obviously flawed because of them - on the other hand, if it was played just as "plain" tune, it would be good enough.
User avatar
RonKiley
Posts: 1404
Joined: Sun Mar 16, 2003 12:53 pm
Please enter the next number in sequence: 1
Location: Germantown, MD

Post by RonKiley »

I bought Finale Print Music for 89 USD which includes McNotator.
I've never met a whistle I didn't want.
Trurl
Posts: 20
Joined: Sun Mar 23, 2008 12:48 pm

...

Post by Trurl »

What hoh! A host of new replies that all concern software that's prettier than mine. Well, I did ask for it, so thanks for the info! Finale does look pretty complex and well made, although AKoff seems like it would provide the main feature for much less cost. What follows is rather longer than I intended, so apologies in advance...

Still, I am having fun working on it, and, man hours aside, it's free so far.

Pyroh, it's strange but those mp3 files don't export as waves properly from Audacity. They play fine but the exported .wav has a wave form that most closely resembles the shapes of the Ghostbuster lightning guns. In other words, it goes all over the place. However, if I play the mp3 and record the output back into the mic port, I get a normal signal. Very odd, but thanks for sending them. I can tell you that you are 'more-or-less' in tune. Helpful no?

Fearfaoin: Those look like great resources! I'm a mechanical engineer by training, so I missed out on DSP. I thought I was doing something clever by calculating the optimum frame size and then taking FFTs of each frame. However..."A simplistic way is to take an FFT (Fast Fourier Transform) of the signal and check whether the desired frequency is present." Easy for him/her/it to say. Simplistic my foot.

Still, looks clever and efficient. Right now I work with pre-recorded waves as I figured they would be easier to analyze. My main problem with real-time encoding is that I'm not sure how to do it in Matlab as I don't think I have access to the Data Acquisition Toolbox. Still, by hook or by crook, real-time processing was going to come next after I got the basic algorithm down, but that filter looks promising. I suspect that if I dissected any of the many software tuners available, I'd find something like that which allows them to quickly detect different notes.

I can now clearly detect multiple notes in sequence in an output graph, so now it's a matter of getting the computer to recognize note transitions, for which I am currently using an amplitude threshold for the FFT power-spectrum (i.e. low amplitude frames are considered silence between notes). It's not great, and it doesn't work reliably yet, but it's a start.
Trurl
Posts: 20
Joined: Sun Mar 23, 2008 12:48 pm

...

Post by Trurl »

I envy Melodyne. It's fancy and it looks good. I'm going to have to incorporate some gradient shaded graphics somewhere...

I should probably also make up own filter with a funny name to sound important.
Post Reply