From 76f26d50482ae902a5231a1fd6f5896ba4dc6b18 Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Fri, 14 Jul 2006 20:10:01 +0000 Subject: [PATCH] - send a signal when handling automation - use note detuning to calculate frequency git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@229 0778d3d1-df1d-0410-868b-ea421aaaa00d --- src/tracks/instrument_track.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index 85fbd2194..a50107344 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -508,9 +508,14 @@ void instrumentTrack::midiConfigChanged( bool ) float instrumentTrack::frequency( notePlayHandle * _n ) const { - return( BASE_FREQ * powf( 2.0f, (float)( _n->tone() - m_baseTone + + float pitch = (float)( _n->tone() - m_baseTone + eng()->getSongEditor()->masterPitch() ) / 12.0f + - (float)( _n->octave() - m_baseOctave ) ) ); + (float)( _n->octave() - m_baseOctave ); + if( _n->detuning() ) + { + pitch += _n->detuning()->value() / 12.0f; + } + return( BASE_FREQ * powf( 2.0f, pitch ) ); } @@ -868,6 +873,7 @@ bool FASTCALL instrumentTrack::play( const midiTime & _start, Sint16 _tco_num ) { sendMidiTime( _start ); + emit sentMidiTime( _start ); // calculate samples per tact; need that later when calculating // sample-pos of a note