comparison audioio/ClipMixer.cpp @ 349:8d7f39df44ed tony_integration

Quieter clip playback for note layers
author Chris Cannam
date Thu, 08 May 2014 15:04:42 +0100
parents a4b8f0864835
children 0876ea394902
comparison
equal deleted inserted replaced
348:f8e1ca25dd80 349:8d7f39df44ed
38 { 38 {
39 m_channels = channels; 39 m_channels = channels;
40 } 40 }
41 41
42 bool 42 bool
43 ClipMixer::loadClipData(QString path, float f0) 43 ClipMixer::loadClipData(QString path, float f0, float level)
44 { 44 {
45 if (m_clipData) { 45 if (m_clipData) {
46 cerr << "ClipMixer::loadClipData: Already have clip loaded" << endl; 46 cerr << "ClipMixer::loadClipData: Already have clip loaded" << endl;
47 return false; 47 return false;
48 } 48 }
79 79
80 for (i = 0; i < info.frames; ++i) { 80 for (i = 0; i < info.frames; ++i) {
81 int j; 81 int j;
82 m_clipData[i] = 0.0f; 82 m_clipData[i] = 0.0f;
83 for (j = 0; j < info.channels; ++j) { 83 for (j = 0; j < info.channels; ++j) {
84 m_clipData[i] += tmpFrames[i * info.channels + j]; 84 m_clipData[i] += tmpFrames[i * info.channels + j] * level;
85 } 85 }
86 } 86 }
87 87
88 free(tmpFrames); 88 free(tmpFrames);
89 89