Use of Midi Keyboard Entry

Engineer Chris's Avatar

Engineer Chris

03 Mar, 2019 09:59 AM

I would very much like to enable midi keyboard entry of answers to Anki in parallel with a normal keyboard. This would extend the use of ANKI to learning piano chords. For example it could challenge a user to play a Cmajor chord and would read the midi keyboard and accept any combination of C, E and G. Then as usual if correct (quickly) it would be marked as easy, else hard or if incorrect then show the correct answer and increase the frequency of that particular challenge.

I have written something pretty close in Python and Pygame. But if it could be implemented relatively easily in Anki it would be much better. If anyone can point me to relevant sections of the source code I can give it a go. But I would guess someone must have already tried this?

Does anyone know whether this has already been done and whether it worked properly?
Thanks
Chris

  1. 1 Posted by Engineer Chris on 03 Mar, 2019 10:04 AM

    Engineer Chris's Avatar

    Forgot to add that it is not really necessary to produce any sounds here. Simply display a challenge chord as text and wait the correct key presses from a midi keyboard in any order.

    Examples
    C -> C,E,G
    C7 -> C, E, G, B

  2. Support Staff 2 Posted by Damien Elmes on 04 Mar, 2019 04:45 AM

    Damien Elmes's Avatar
  3. 3 Posted by tyni on 16 Oct, 2019 05:41 PM

    tyni's Avatar

    Chris did you ever figure this out? I am interested in the same thing. Perhaps we can work together on a solution?

  4. 4 Posted by warpfactorthree on 16 Oct, 2019 06:53 PM

    warpfactorthree's Avatar

    Sorry, I cannot remember the details about this. I think I ran out of
    time to research it....

    BUT...
    I wrote my own PYTHON application to teach/learn chords.
    It uses PYGAME and should work cross platform. It accepts midi keyboard
    entries. Basically it generates a challenge such as C-Maj and you have
    to play any inversion of C-Maj anywhere on the keyboard in order to
    score the point. I implemented most of the common chord types (Maj, Min,
    Aug, Dim, 7th, 9th etc).

    I eventually found other software called JALMUS which is very similar
    but for normal notation.

    Fortunately for me just writing this app so vastly improved my sight
    reading that I no longer need it.

    Let me know if you need the source code and I'll send it to you.
    Usual disclaimers and of course Free for any use forever for anyone to
    modify and improve.

    I'd love to see it improved and made available for all.

    Chris
    Exeter, UK

  5. 5 Posted by tyni on 16 Oct, 2019 08:02 PM

    tyni's Avatar

    100% yes please send me the source so I can get to the same point of not needing it :)

  6. 6 Posted by warpfactorthree on 18 Oct, 2019 05:10 PM

    warpfactorthree's Avatar

    OK Here is the application.

    It consists of a main python application and a folder containing
    essential resources.
    Extract it to a suitable location and extract the files.
    I developed it using Linux (Ubuntu Mate 16.04 LTS).
    I have tested it on three other Linux PCs but not on Windows.

    It was tested using
    Python version 2.7.12
    Pygame version 1.9.1
    Keyboard: Keystation Mini32 (USB keyboard only)
    Piano : Yamaha Clavinova (Proper full sized digital piano)

    RUNNING THE PROGRAM:
    First connect your USB MIDI keyboard.
    Open a terminal window
    Navigate to the target directory containing the files like this:
    office@office-O-E-M:~$ cd /home/office/Desktop/CHORD_GAME

    Then start the python program like this:
    office@office-O-E-M:~/Desktop/CHORD_GAME$ python chordgame.py

    In the terminal window you should see if there are any problems running
    the program on your machine. It should display a list of connected MIDI
    devices. Almost certainly your devices will differ from mine....

    office@office-O-E-M:~/Desktop/CHORD_GAME$ python chordgame.py ('ALSA',
    'Midi Through Port-0', 0, 1, 0)
    ('ALSA', 'Midi Through Port-0', 1, 0, 0)
    ('ALSA', 'Keystation Mini 32 MIDI 1', 0, 1, 0)
    ('ALSA', 'Keystation Mini 32 MIDI 1', 1, 0, 0)

    Chord Learning Game by Chris Leaver
    Difficulty Level 1
    This version does 2 chord types
    General Chord Challenge

    ---------------------------------------------
    G Maj
    Pattern [0, 4, 7]

    Notes are therefore
    G B D
    ---------------------------------------------

    Start off by looking at the terminal window if you have any problems.
    The code is relatively simple so you should be able to figure it out.

    PLease feel free to improve it and post it to anyone else who wants a copy.

    Chris

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac