/[svn]/linuxsampler/trunk/src/engines/gig/Engine.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Engine.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1039 by persson, Sat Feb 3 20:46:44 2007 UTC revision 1044 by schoenebeck, Wed Feb 7 21:51:19 2007 UTC
# Line 709  namespace LinuxSampler { namespace gig { Line 709  namespace LinuxSampler { namespace gig {
709    
710          if (!pEngineChannel->pInstrument) return; // ignore if no instrument loaded          if (!pEngineChannel->pInstrument) return; // ignore if no instrument loaded
711    
712            //HACK: we should better add the transpose value only to the most mandatory places (like for retrieving the region and calculating the tuning), because otherwise voices will unintendedly survive when changing transpose while playing
713            itNoteOnEvent->Param.Note.Key += pEngineChannel->GlobalTranspose;
714    
715          const int key = itNoteOnEvent->Param.Note.Key;          const int key = itNoteOnEvent->Param.Note.Key;
716          midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[key];          midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[key];
717    
# Line 796  namespace LinuxSampler { namespace gig { Line 799  namespace LinuxSampler { namespace gig {
799          if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted          if (pEngineChannel->GetMute()) return; // skip if sampler channel is muted
800          #endif          #endif
801    
802            //HACK: we should better add the transpose value only to the most mandatory places (like for retrieving the region and calculating the tuning), because otherwise voices will unintendedly survive when changing transpose while playing
803            itNoteOffEvent->Param.Note.Key += pEngineChannel->GlobalTranspose;
804    
805          const int iKey = itNoteOffEvent->Param.Note.Key;          const int iKey = itNoteOffEvent->Param.Note.Key;
806          midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[iKey];          midi_key_info_t* pKey = &pEngineChannel->pMIDIKeyInfo[iKey];
807          pKey->KeyPressed = false; // the MIDI key was now released          pKey->KeyPressed = false; // the MIDI key was now released
# Line 1356  namespace LinuxSampler { namespace gig { Line 1362  namespace LinuxSampler { namespace gig {
1362                  pEngineChannel->PortamentoTime = (float) itControlChangeEvent->Param.CC.Value / 127.0f * (float) CONFIG_PORTAMENTO_TIME_MAX + (float) CONFIG_PORTAMENTO_TIME_MIN;                  pEngineChannel->PortamentoTime = (float) itControlChangeEvent->Param.CC.Value / 127.0f * (float) CONFIG_PORTAMENTO_TIME_MAX + (float) CONFIG_PORTAMENTO_TIME_MIN;
1363                  break;                  break;
1364              }              }
1365                case 6: { // data entry (currently only used for RPN controllers)
1366                    if (pEngineChannel->GetMidiRpnController() == 2) { // coarse tuning in half tones
1367                        int transpose = (int) itControlChangeEvent->Param.CC.Value - 64;
1368                        // limit to +- two octaves for now
1369                        transpose = RTMath::Min(transpose,  24);
1370                        transpose = RTMath::Max(transpose, -24);
1371                        pEngineChannel->GlobalTranspose = transpose;
1372                        // workaround, so we won't have hanging notes
1373                        ReleaseAllVoices(pEngineChannel, itControlChangeEvent);
1374                    }
1375                    // to avoid other MIDI CC #6 messages to be misenterpreted as RPN controller data
1376                    pEngineChannel->ResetMidiRpnController();
1377                    break;
1378                }
1379              case 7: { // volume              case 7: { // volume
1380                  //TODO: not sample accurate yet                  //TODO: not sample accurate yet
1381                  pEngineChannel->MidiVolume = VolumeCurve[itControlChangeEvent->Param.CC.Value];                  pEngineChannel->MidiVolume = VolumeCurve[itControlChangeEvent->Param.CC.Value];
# Line 1460  namespace LinuxSampler { namespace gig { Line 1480  namespace LinuxSampler { namespace gig {
1480                  }                  }
1481                  break;                  break;
1482              }              }
1483                case 100: { // RPN controller LSB
1484                    pEngineChannel->SetMidiRpnControllerLsb(itControlChangeEvent->Param.CC.Value);
1485                    break;
1486                }
1487                case 101: { // RPN controller MSB
1488                    pEngineChannel->SetMidiRpnControllerMsb(itControlChangeEvent->Param.CC.Value);
1489                    break;
1490                }
1491    
1492    
1493              // Channel Mode Messages              // Channel Mode Messages
# Line 1692  namespace LinuxSampler { namespace gig { Line 1720  namespace LinuxSampler { namespace gig {
1720      }      }
1721    
1722      String Engine::Version() {      String Engine::Version() {
1723          String s = "$Revision: 1.72 $";          String s = "$Revision: 1.75 $";
1724          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
1725      }      }
1726    

Legend:
Removed from v.1039  
changed lines
  Added in v.1044

  ViewVC Help
Powered by ViewVC