Hey all,
In search of some advice regarding keyboard input and Arduino. Basically I want to type code into Supercollider (http://supercollider.sourceforge.net/) and have the Arduino pick up my key presses, importantly - as they happen. Is this feasible?
Alternatively, would I be better off hooking my Arduino up to a PS/2 keyboard and coding Supercollider via Arduino?
Or would I be best off using another piece of software that interfaces between them?
It's for a live performance, so have a concern about latency.
Thanks in advance for your advice!
I don't know anything about Supercollider... I doesn't look like it runs on the Arduino
...and have the Arduino pick up my key presses, importantly - as they happen. Is this feasible?
...Alternatively, would I be better off hooking my Arduino up to a PS/2 keyboard and coding
...Supercollider via Arduino?
What???? Are you talking about a computer keyboard or a musical keyboard? If it's a musical keyboard, are you intending to capture the audio or the MIDI?
Or would I be best off using another piece of software that interfaces between them?
I don't have any idea what you are trying to do.
It's for a live performance, so have a concern about latency.
Due to their multitasking operating systems, "regular" Windows or OS-X systems will always introduce some latency. This can be a big issue if you hit a key and there is noticeable delay before you hear the note. Often, the latency can be minimized to an acceptable amount, but IMO it's just best to avoid sending real-time audio through a computer.
With a dedicated "hardware" processor (such as a guitar effects box or hardware reverb) the latency can be eliminated. The Arduino isn't a particularly powerful processor, so depending on what you want to do it may, or may not, be the best choice.
Latency is NOT an issue if the computer is playing a MIDI file or generating the audio because the musician(s) will just play-along with the sound as it comes out and they wont be aware of any delay.
Hey thanks for your reply,
I don't think I explained myself very clearly, sorry.
I am typing code into Supercollider (a standalone application) to generate sound as part of a live musical performance - known as Live Coding (check http://toplap.org/).
It doesn't run on Arduino, nope!
I basically want every keystroke I type into Supercollider (on my laptop keyboard) to blink an LED that is connected to an Arduino Uno. It doesn't matter what character is typed, just so long as the Arduino knows that a keystroke has happened and the LED turns on/off (quite one dimensional, I know).
For example:
If I type
M I D I C L I E N T . I N I T into supercollider
I want the LEDs to go (*=ON)
In time with the rhythm of my typing.
I have a prototype working using the Serial Monitor 'send' in Arduino. The problem with this is that you need to press Return key after every individual character, and because I am writing and executing code live in another application this obviously can't work.
void setup()
{
Serial.begin(9600);
pinMode(3, OUTPUT);
}
void loop()
{
if (Serial.available() > 0) {
char keyStroke = Serial.read();
Serial.println(keyStroke);
digitalWrite(3, 255);
delay(100);
digitalWrite(3, 0);
delay(50);
}}
I found this piece of software - Clone Keys (Google Code Archive - Long-term storage for Google Code Project Hosting.) that sends what you are typing to multiple applications, however it does not working between Arduino and Supercollider for some reason (however it does work between Arduino and Chrome, but only if you are typing text into Arduino monitor.
It is a solo performance (only my typing), with my Supercollider code being projected on a large screen. I don't want changes in the audio to lag behind changes people can see in the
Thanks again!