Flashnotes, a musical flashcards program

Planet Compiz Fusion RSS readers: Sorry for the spam of the feed! My wordpress upgrade apparently did bad things 🙁
Grab flashnotes’s source here: flashnotes.tar.gz

So in an effort to spend more of my time doing real-life things (as opposed to computer things) I decided to pick up playing piano. I’ve been able to play piano one note at a time for a while, but playing the piano one note at a time is not really playing the piano. 😀 So in an effort to learn the instrument better, I borrowed my dad’s electronic keyboard, and sat down to try to learn it.

As I sat there, I quickly figured out that I need to get my eye-hand coordination to the point where I can just see a complex arrangement of notes, and my fingers will fly to the keys. With a computer keyboard, when I want to type a word, I don’t have to spend a second thinking where the ‘a’ key is, and I’d like to develop that same proficiency with a piano. Naturally, this led me to think that some sort of flash card training would help. So like any good hacker, I whipped up a flashcards program that afternoon to help me learn piano! 😀

I decided to learn the chords first, so my program goes through cords composed of 1, 2, 3, or 4 notes. Here’s a screenshot:

The notes are rendered in a Cairo drawing area, at an interval specified in milliseconds by the sliding bar at the bottom. You can specify one, two, three, or four notes to be displayed at once. You click the go button to toggle running and pausing the program, and the quit button exits. I’ll probably improve upon it more once I start using it seriously to learn the piano. One thought I had was to hook up a microphone to my computer and run a Fourier transform on the recorded data so that the program would be able to tell if I got the note right. All in good time, I suppose. 😀

Grab the source code here. Its a simple make command to get it running, but you’ll need the cairo and gtk/glade development headers installed on your system to get it running. I just put a simple makefile in, it doesn’t check for the headers it needs, so you’re on your own for that. 😛

Check it out, let me know if its helpful!

This entry was posted in Coding, Open Source, Ubuntu. Bookmark the permalink.

9 Responses to Flashnotes, a musical flashcards program

  1. madsrh says:

    I would love to test your work (I’m a musician myself), but I get an error message from the tar.gz file:

    gzip: stdin: not in gzip format
    tar: Child returned status 1
    tar: Error exit delayed from previous errors

  2. Kevin says:

    try `tar xvf flashnotes.tar.gz`
    you’ll probably need the debian packages libglade0-dev, libcairo2-dev, and libgtk2.0-dev to compile.

  3. Michael says:

    Hey, great program! However, the notes look really odd all stacked together like that.

    Here’s a diff that will make them look a bit more like quarter notes:

    — main.c 2009-02-12 15:52:38.000000000 -0700
    +++ mine.c 2009-02-13 14:56:55.000000000 -0700
    @@ -52,12 +52,17 @@
    int r = 10.0 * rand()/RAND_MAX;
    for (i=0; i < num_notes; i++)
    {
    – /* draw a circle */
    – cairo_set_line_width (cr, 0.05);
    – cairo_arc (cr, 0.5, (float)(r+2*i)*0.5/6 , 0.05, 0, 2 * M_PI);
    + // draw a circle
    + cairo_arc (cr, 0.5, (float)(r+2*i)*0.5/6 , inv_lines/2, 0, 2 * M_PI);
    + cairo_fill(cr);
    }
    + // Draw the line
    + cairo_set_line_width (cr, 0.025);
    + cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
    + cairo_move_to(cr, 0.5 + inv_lines/2 – 0.0125, (float)(r+2*(num_notes-1))*0.5/6);
    + cairo_line_to(cr, 0.5 + inv_lines/2 – 0.0125, (float)(r-4)*0.5/6);
    + cairo_stroke(cr);

    – cairo_stroke(cr);

    return FALSE;
    }

    It’s still not very realistic because quarter notes actually aren’t exactly round; they’re more elliptical. Unfortunately, my cairo-fu is not strong to do that.

    Great work!

  4. Michael says:

    Oh bother, that didn’t work. The formatting got all messed up. Here: http://dl.getdropbox.com/u/219506/Flashnotes.diff

  5. Justace Clutter says:

    You should set it up to handle midi. With the FFT would would have to account for mis tunnings. Although I guess that would be easy to compensate for

  6. gianpa says:

    you should combine your program wiht this:

    http://www.synthesiagame.com/

    Because the Idea of that game is good, but why not using real sheets… That would be the best learning instrument for reading in the history of piano.. Do that, you’ll be famous 😀

  7. Pingback: fsdaily.com

  8. Thanks for your blog post. The things i would like to contribute is that laptop or computer memory must be purchased if your computer can no longer cope with anything you do with it. One can set up two good old ram boards having 1GB each, for example, but not one of 1GB and one having 2GB. One should always check the manufacturer’s documentation for one’s PC to be certain what type of ram is necessary.

Leave a Reply

Your email address will not be published. Required fields are marked *