improved MIDI-support
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@429 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -192,10 +192,11 @@ void midiALSASeq::processOutEvent( const midiEvent & _me,
|
||||
_me.velocity() );
|
||||
break;
|
||||
|
||||
case PITCH_BEND:
|
||||
snd_seq_ev_set_pitchbend( &ev,
|
||||
case CONTROL_CHANGE:
|
||||
snd_seq_ev_set_controller( &ev,
|
||||
_port->outputChannel(),
|
||||
_me.m_data.m_param[0] - 8192 );
|
||||
_me.m_data.m_param[0],
|
||||
_me.m_data.m_param[1] );
|
||||
break;
|
||||
|
||||
case PROGRAM_CHANGE:
|
||||
@@ -210,6 +211,12 @@ void midiALSASeq::processOutEvent( const midiEvent & _me,
|
||||
_me.m_data.m_param[0] );
|
||||
break;
|
||||
|
||||
case PITCH_BEND:
|
||||
snd_seq_ev_set_pitchbend( &ev,
|
||||
_port->outputChannel(),
|
||||
_me.m_data.m_param[0] - 8192 );
|
||||
break;
|
||||
|
||||
default:
|
||||
printf( "ALSA-sequencer: unhandled output event %d\n",
|
||||
(int) _me.m_type );
|
||||
@@ -519,6 +526,38 @@ void midiALSASeq::run( void )
|
||||
), midiTime() );
|
||||
break;
|
||||
|
||||
case SND_SEQ_EVENT_CONTROLLER:
|
||||
dest->processInEvent( midiEvent( CONTROL_CHANGE,
|
||||
ev->data.control.channel,
|
||||
ev->data.control.param,
|
||||
ev->data.control.value ),
|
||||
midiTime() );
|
||||
break;
|
||||
|
||||
case SND_SEQ_EVENT_PGMCHANGE:
|
||||
dest->processInEvent( midiEvent( PROGRAM_CHANGE,
|
||||
ev->data.control.channel,
|
||||
ev->data.control.param,
|
||||
ev->data.control.value ),
|
||||
midiTime() );
|
||||
break;
|
||||
|
||||
case SND_SEQ_EVENT_CHANPRESS:
|
||||
dest->processInEvent( midiEvent(
|
||||
CHANNEL_PRESSURE,
|
||||
ev->data.control.channel,
|
||||
ev->data.control.param,
|
||||
ev->data.control.value ),
|
||||
midiTime() );
|
||||
break;
|
||||
|
||||
case SND_SEQ_EVENT_PITCHBEND:
|
||||
dest->processInEvent( midiEvent( PITCH_BEND,
|
||||
ev->data.control.channel,
|
||||
ev->data.control.value + 8192,
|
||||
0 ), midiTime() );
|
||||
break;
|
||||
|
||||
case SND_SEQ_EVENT_SENSING:
|
||||
case SND_SEQ_EVENT_CLOCK:
|
||||
break;
|
||||
|
||||
@@ -683,13 +683,18 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
break;
|
||||
|
||||
case KEY_PRESSURE:
|
||||
if( m_notes[_me.key()] != NULL )
|
||||
if( !m_instrument->handleMidiEvent( _me, _time ) &&
|
||||
m_notes[_me.key()] != NULL )
|
||||
{
|
||||
m_notes[_me.key()]->setVolume( _me.velocity() *
|
||||
100 / 128 );
|
||||
}
|
||||
break;
|
||||
|
||||
case PITCH_BEND:
|
||||
m_instrument->handleMidiEvent( _me, _time );
|
||||
break;
|
||||
|
||||
/* case PITCH_BEND:
|
||||
if( m_pitchBendKnob != NULL )
|
||||
{
|
||||
@@ -704,7 +709,7 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
|
||||
break;*/
|
||||
|
||||
default:
|
||||
printf( "channel-track: unhandled MIDI-event %d\n",
|
||||
printf( "instrument-track: unhandled MIDI-event %d\n",
|
||||
_me.m_type );
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user