aboutsummaryrefslogtreecommitdiff
path: root/pd/src/s_midi_alsa.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-10-09 16:36:37 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2011-10-09 16:36:37 +0000
commit21c068f1916330e90f814bed461fe0821d1665ec (patch)
tree949b73696fff09a44b8d3eb01b70bae7174cbd14 /pd/src/s_midi_alsa.c
parentbf8ced1efe1a032342e864edc635fa4e2676670d (diff)
checked in pd-0.43-0.src.tar.gz
svn path=/trunk/; revision=15557
Diffstat (limited to 'pd/src/s_midi_alsa.c')
-rw-r--r--pd/src/s_midi_alsa.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/pd/src/s_midi_alsa.c b/pd/src/s_midi_alsa.c
index d0d82f30..d6d1525e 100644
--- a/pd/src/s_midi_alsa.c
+++ b/pd/src/s_midi_alsa.c
@@ -28,16 +28,6 @@ static snd_seq_t *midi_handle;
static snd_midi_event_t *midiev;
-
-static unsigned short CombineBytes(unsigned char First, unsigned char Second)
-{
- unsigned short _14bit;
- _14bit = (unsigned short)Second;
- _14bit <<= 7;
- _14bit |= (unsigned short)First;
- return(_14bit);
-}
-
void sys_alsa_do_open_midi(int nmidiin, int *midiinvec,
int nmidiout, int *midioutvec)
{
@@ -193,7 +183,7 @@ void sys_alsa_putmidimess(int portno, int a, int b, int c)
if (a >= 224) // pitchbend
{
channel = a-224;
- snd_seq_ev_set_pitchbend(&ev,channel,CombineBytes(b,c));
+ snd_seq_ev_set_pitchbend(&ev, channel, (((c<<7)|b)-8192)); /* b and c are already correct but alsa needs to recalculate them */
}
else if (a >= 208) // touch
{