|
1 | 1 | # TypePiano |
2 | | -Play a piano as you type. |
| 2 | + |
| 3 | +Play a piano as you type. Convert your computer keyboard into a musical keyboard. |
| 4 | + |
| 5 | +## What is it? |
| 6 | + |
| 7 | +An app that runs in the background and generates specific music notes for different keystroke combinations. |
| 8 | + |
| 9 | +## Why is it? |
| 10 | + |
| 11 | +This application is based on Virtual Piano. |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +Most similar music apps generate a sound that have exponential or cosine frequency responce. This is one of the rare ones whos note's follow a time-varying gaussian curve. |
| 16 | + |
| 17 | +In human language; it sounds very close to the real thing. Hence, this application has 3 major purpose, |
| 18 | + |
| 19 | +1. Preserve the original project. |
| 20 | +2. Make it offline. |
| 21 | +3. Plug headphones in your school/college/office and play paino while pretending to work. |
| 22 | + |
| 23 | +## How does it work? |
| 24 | + |
| 25 | +The project uses JNativeHook that leverages platform-dependent native code to create low-level system-wide hooks. These hooks capture your keystrokes no matter what application is currently running and is in focus. |
| 26 | + |
| 27 | +Different key combinations are assigned a note, that is played via one of the implimented Player implimentation. |
| 28 | + |
| 29 | +## Using Locally |
| 30 | + |
| 31 | +If you want to run this project locally, |
| 32 | + |
| 33 | +### Requirements |
| 34 | + |
| 35 | +1. Java 7 or above |
| 36 | +2. Windows 7,8 or 10 |
| 37 | + |
| 38 | +### Build |
| 39 | + |
| 40 | +For the first download/clone of this repo, |
| 41 | + |
| 42 | +1. Import the JPlay3 folder as a Java project using your IDE (Eclipse/Netbeans). |
| 43 | +2. If the IDE does not detect the `lib` folder, then [add its contents as external jars](http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-(Java)). |
| 44 | +3. Add "resources" folder as a Source. In Eclipse: `Project -> Properties -> Java Build Path -> Source -> Add Folder` |
| 45 | + |
| 46 | +### Run |
| 47 | + |
| 48 | +To directly use it. |
| 49 | + |
| 50 | +1. Download the jar from latest release. |
| 51 | +1. Double click the jar. This will start the app in background (You can check this under processes in TaskManager). |
| 52 | +2. Press a key anywhere, to hear a sound. |
| 53 | +3. To stop the app. Press `F9` key. |
| 54 | + |
| 55 | +### Changing Player |
| 56 | + |
| 57 | +The current application has support for 4 different players. The `TinyPlayer` is used by default. |
| 58 | + |
| 59 | +To modify this, |
| 60 | + |
| 61 | +1. Check the currently supported players in _Players.java_ |
| 62 | +```java |
| 63 | +public enum Players { |
| 64 | + CLIP_PLAYER (ClipPlayer.class, Extension.WAV), |
| 65 | + JFX_PLAYER (JfxPlayer.class, Extension.MP3), |
| 66 | + JACO_PLAYER (JaCoPlayer.class, Extension.MP3), |
| 67 | + TINY_PLAYER (TinyPlayer.class, Extension.WAV); |
| 68 | + ... |
| 69 | + } |
| 70 | + ``` |
| 71 | + 2. Open the file _TypePiano.java_. |
| 72 | + 3. Update the player passed to _Conductor_. |
| 73 | + ```java |
| 74 | +Conductor mainConductor = new Conductor(Players.TINY_PLAYER); |
| 75 | + ``` |
| 76 | + 4. Build the project. |
| 77 | + |
| 78 | +### Key Map |
| 79 | + |
| 80 | +The current version has keys `0-9` and `A-Z` mapped to the piano. Additinally, the sharp notes (_the black keys in the piano_) can be played by pressing `Shift+Key`. |
| 81 | + |
| 82 | +The current version covers **3 and a half octaves** as seen below. |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | +## Known Issues |
| 87 | + |
| 88 | +* Using MP3 files has latency but they are very small in size for the same quality. Currently using WAV format instead. |
| 89 | +* The `CLIP_PLAYER` misses notes. |
| 90 | +* The `TINY_PLAYER` gives jitters sometimes. |
| 91 | + |
| 92 | +## Licence |
| 93 | + |
| 94 | +Licenced under GNU GENERAL PUBLIC LICENSE v3.0. It is free to copy and distribute. |
0 commit comments