* additionally provide frequency without pitch-wheel

* added instrumentTrack::midiPitch()



git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1292 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-07-07 08:34:02 +00:00
parent 1458cb3e2c
commit 98a984b94d
4 changed files with 23 additions and 10 deletions

View File

@@ -434,12 +434,13 @@ void notePlayHandle::updateFrequency( void )
KeysPerOctave;
const int base_octave = m_instrumentTrack->baseNoteModel()->value() /
KeysPerOctave;
const float pitch = (float)( key() % KeysPerOctave - base_tone +
const float pitch = ( key() % KeysPerOctave - base_tone +
engine::getSong()->masterPitch() ) / 12.0f +
(float)( key() / KeysPerOctave - base_octave ) +
m_baseDetuning->value() / 12.0f +
m_instrumentTrack->m_pitchModel.value() / ( 100 * 12.0 );
m_frequency = BaseFreq * powf( 2.0f, pitch );
( key() / KeysPerOctave - base_octave ) +
m_baseDetuning->value() / 12.0f;
m_frequency = BaseFreq * powf( 2.0f, pitch +
m_instrumentTrack->m_pitchModel.value() / ( 100 * 12.0 ) );
m_unpitchedFrequency = BaseFreq * powf( 2.0f, pitch );
for( notePlayHandleVector::iterator it = m_subNotes.begin();
it != m_subNotes.end(); ++it )

View File

@@ -279,12 +279,10 @@ void instrumentTrack::processInEvent( const midiEvent & _me,
break;
case MidiPitchBend:
if( !m_instrument->handleMidiEvent( _me, _time ) )
{
m_pitchModel.setValue( m_pitchModel.minValue() +
m_instrument->handleMidiEvent( _me, _time );
m_pitchModel.setValue( m_pitchModel.minValue() +
_me.m_data.m_param[0] *
m_pitchModel.range() / 16384 );
}
break;
case MidiControlChange:
@@ -367,7 +365,7 @@ QString instrumentTrack::instrumentName( void ) const
{
return( m_instrument->publicName() );
}
return( "" );
return( QString::null );
}