Keyboard control

328 views
Skip to first unread message

Tel Bonic

unread,
Sep 9, 2009, 8:33:53 PM9/9/09
to Auduino
Hi all,

After bashing my head against the Arduino data sheet for a while as
Peter advised in the previous thread, and getting nowhere fast I
decided to take a break and do something else. I found a series of
articles that describe how synth keyboards work, and have written a
routine to take input from shift registers (74hc165b1) and to process
the following:

Each key has three variables, one to read if it's on/off, one to
create a trigger event and a third to catch key-up events. The
routine also holds data for 6 "voices", and assigns a voice to a key
when it detects a trigger event (if there's one spare) and looks up a
frequency table to get the value for the voice to hold while it
plays. Key up returns the voice to its rest state and returns the
voice to the available voice pool.

Right now, I've got it working lighting six led's to simulate voices,
and I've played with home-made vactrols and have mostly built a 40106
Schmitt trigger voice (although I can't seem to get rid of very low
frequency clicks which my pwm - > vco's make at rest.

I just wondered if the auduino method of synthesis supports any kind
of gating and if it's possible to play six voices at the same time?
If it's possible to do this, I'll carry on and try to work out how to
get my code integrated with Peters and make a nice sounding six-key-
polyphonic synth which I'll contribute to the project. If not, I'll
send the keyboard code to the playground (and post it here if you want
of course) and leave it lighting led's for others to play with, and
carry on attempting to make hardware oscillators. Although I'm
getting somewhere with hardware voices, nothing has sounded as nice as
the output from the auduino.

Cheers,

Tel.

Tel Bonic

unread,
Sep 11, 2009, 4:59:39 AM9/11/09
to Auduino
Never mind, I've been reading again this morning and I've answered my
own question.

Tel Bonic

unread,
Sep 13, 2009, 8:01:57 AM9/13/09
to Auduino
On 11 Sep, 09:59, Tel Bonic <telbo...@googlemail.com> wrote:
> Never mind, I've been reading again this morning and I've answered my
> own question.

Ok it's done, was much easier then I'd thought in the end. Just
needed to make myself an array to hold the notes:

int keyNotes[]={
137, 145, 154, 163, 173, 183, 194, 206, 218, 231, 244, 259, 274};

and later on after the keyboard code update the following:

syncPhaseInc = keyNotes[n];

and make sure it was set to 0 when the keys weren't pressed.

I've just added an led display for a devilish little idea and I'll
post the whole project and code if it works =)
Reply all
Reply to author
Forward
0 new messages