sf2 understands panning midi meta events now

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1942 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Andrew Kelley
2008-12-16 11:46:41 +00:00
parent 7fe4f1e60c
commit 87a9be583f
5 changed files with 29 additions and 0 deletions

View File

@@ -600,6 +600,17 @@ void sf2Instrument::playNote( notePlayHandle * _n, sampleFrame * )
}
void sf2Instrument::updatePanning( notePlayHandle * _n )
{
short ctrl = 0x0A; // PAN_MSB
int pan = 0 +
( (float)( _n->getPanning() - PanningLeft ) ) /
( (float)( PanningRight - PanningLeft ) ) *
( (float)( 127 - 0 ) );
fluid_synth_cc( m_synth, _n->channel(), ctrl, pan );
}
// Could we get iph-based instruments support sample-exact models by using a
// frame-length of 1 while rendering?
void sf2Instrument::play( sampleFrame * _working_buffer )

View File

@@ -59,6 +59,8 @@ public:
virtual void playNote( notePlayHandle * _n,
sampleFrame * _working_buffer );
virtual void deleteNotePluginData( notePlayHandle * _n );
virtual void updatePanning( notePlayHandle * );
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );