All 4 steps performed by a java programme
Java was selected since it allows one programme to run independently of the platform, Windows, OSX, Linux.
A
The user can perform a rhythm using up to 5dedicated keys on the keyboard. B, J, K, L, M were selected since they fall easily enough under the fingers of a right handed user. Entries are performed in a way close to playing keys and chords on a piano keyboard.B
keystrokes on the dedicated keys are converted into "chords" and "phrases""Chord" represents the keys that are pressed simultaneously - it is basically an array of 5, with values 1 or 0.
"Phrase" represents a group of chords separated by a variable interval. This is the actual rhythmic pattern.
The length of the interval between chords is recorded using a number. The shortest interval is given the value 1, the other intervals are given a multiple (2 if the interval is twice as long as the shortest in the phrase, ...)
The first prototype of the code actually uses a string to record the chords and phrases
example of chord : _o_o_ : the second and fourth key are pressed
example of phrase :
o____1o____1o____ : first key is pressed 3 times at regular interval.
C
The phrases are then compared to a "dictionary".The dictionary is created by the user and consists in a list of couples (phrase,translation)
If a translation is found in the dictionary for a pattern, the translation is displayed and interpreted
D
Interpreter is a piece of code that takes as input the translation and looks at its structure to try to convert it into action.Current translations at this stage are as follows :
print a string (text)
send a key strike or combination of keystrokes (performs keyboard shortcuts)
open a programme or file (tested with "mail")
Download the programme (v3 - jar file) on this link : jar file
How to use the rhythmic programme
The programme uses the keyboard keys as shown on the illustration below as input for the 5 channels.
This set up works for a right handed user using 5 fingers to enter a rhythm in a similar way to playing 5 notes on a piano.
Type in the succession of inputs fast enough to have them recorded as a single pattern. After a time period without and entry (around 0.5 sec), the programmes considers that the phrase is ended.
The phrase is displayed in the left pane.
The translation is displayed in the right pane.
The mode button toggles from "read" mode to "learn" mode.
alternatively from pressing the button, mode command is available by default with the rhythm : o____1_o___1__o__1___o_1____o
Read mode
This is the default mode, as described above. Rhythm is entered, translated, interpreted.
Learn mode
In this mode, if a rhythm entered is not recognized (ie does not yet have a translation), the user is invited to type in a translation.
To procede without saving a new translation, just press RETURN, and start on a new rhtythm.
To go back to "read" mode, press the button or type in the rhythm combination.
Translations
Any text can be registered as a translationThe text is displayed if found
Interpretations
Some commands are accessed through special words :to date, v3 has the following special commands :
$mode : toggles the mode from read to learn
$beep : plays a sound from the computer
$key_F9 : sends keystroke F9 to the host computer. This type of action ca be developed to send any key combinaison
$mail : open a new email with the default email programme - this type of action can be developed to open any file or programme
Managing the user's rhythms dictionary
The programme stores the dictionary in a text file called "data". On the first opening the file is created with a few default rhythms and translations.The user can either edit the file or develop it using the learn mode describe above.
Comments
Post a Comment