diff --git a/SpiralSound/Plugins/GUI/WaveChooser.C b/SpiralSound/Plugins/GUI/WaveChooser.C index b60213a..31846cf 100644 --- a/SpiralSound/Plugins/GUI/WaveChooser.C +++ b/SpiralSound/Plugins/GUI/WaveChooser.C @@ -21,29 +21,48 @@ #include #include "../../../config.h" +using namespace std; #ifdef USE_LIBSNDFILE #include #endif -char *WaveFileName (void) { - string AvailFmt; +char *WaveFileName (void) +{ + string AvailFmt; + #ifdef USE_LIBSNDFILE - string FmtName; - SF_FORMAT_INFO info; - int major_count, m, p; - sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)); - for (m = 0 ; m < major_count ; m++) { - info.format = m; - sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)); - FmtName = info.name; - while ((p=FmtName.find ('(')) >= 0 ) FmtName.replace (p, 1, '['); - while ((p=FmtName.find (')')) >= 0 ) FmtName.replace (p, 1, ']'); - if (!AvailFmt.empty()) AvailFmt += '\t'; - AvailFmt += (string)FmtName + (string)" (*." + (string)info.extension + ')'; - } + string FmtName; + SF_FORMAT_INFO info; + int major_count, m, p; + + sf_command (NULL, SFC_GET_FORMAT_MAJOR_COUNT, &major_count, sizeof (int)); + + for (m = 0 ; m < major_count ; m++) + { + info.format = m; + sf_command (NULL, SFC_GET_FORMAT_MAJOR, &info, sizeof (info)); + FmtName = info.name; + while ((p=FmtName.find ('(')) >= 0 ) + { + FmtName.replace (p, 1, "["); + } + + while ((p=FmtName.find (')')) >= 0 ) + { + FmtName.replace (p, 1, "]"); + } + + if (!AvailFmt.empty()) + { + AvailFmt += '\t'; + } + + AvailFmt += (string)FmtName + (string)" (*." + (string)info.extension + ')'; + } #else - AvailFmt = "{*.wav,*.WAV}"; + AvailFmt = "{*.wav,*.WAV}"; #endif - char *fn=fl_file_chooser("Load a sample", AvailFmt.c_str(), NULL); - return fn; + + char *fn=fl_file_chooser("Load a sample", AvailFmt.c_str(), NULL); + return fn; } diff --git a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C b/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C index 1044dde..263a257 100644 --- a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C +++ b/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C @@ -157,7 +157,7 @@ SpiralGUIType *MatrixPlugin::CreateGUI() void MatrixPlugin::Reset() { ResetPorts(); - m_Current = 0; + m_Current = GetPatSeq(0); m_GUICurrent = 0; m_Time = 0.0f; m_Step = 0; diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C index 08e6cb1..c65952d 100644 --- a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C +++ b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C @@ -183,7 +183,7 @@ void PoshSamplerPlugin::Reset() for (int s=0; sPitch *= m_SampleDescVec[s]->SampleRate/(float)m_HostInfo->SAMPLERATE; + m_SampleDescVec[s]->Pitch = m_InitialPitch[s] * m_SampleDescVec[s]->SampleRate/(float)m_HostInfo->SAMPLERATE; m_SampleDescVec[s]->LoopEnd=m_SampleVec[s]->GetLength()-1; } } @@ -305,6 +305,7 @@ void PoshSamplerPlugin::Execute() m_SampleDescVec[s]->SampleRate=m_HostInfo->SAMPLERATE; m_SampleDescVec[s]->Stereo=false; m_SampleDescVec[s]->Pitch *= 1.0f; + m_InitialPitch[s] = m_SampleDescVec[s]->Pitch; m_SampleDescVec[s]->LoopEnd=m_SampleVec[s]->GetLength(); } @@ -419,7 +420,8 @@ void PoshSamplerPlugin::LoadSample(int n, const string &Name) InitializeSampleDescription(m_SampleDescVec[n], Name, n); m_SampleDescVec[n]->SampleRate=Wav.GetSamplerate(); m_SampleDescVec[n]->Stereo=Wav.IsStereo(); - m_SampleDescVec[n]->Pitch *= m_SampleDescVec[n]->SampleRate/(float)m_HostInfo->SAMPLERATE; + m_InitialPitch[n] = m_SampleDescVec[n]->Pitch; + m_SampleDescVec[n]->Pitch = m_InitialPitch[n] * m_SampleDescVec[n]->SampleRate/(float)m_HostInfo->SAMPLERATE; m_SampleDescVec[n]->LoopEnd=m_SampleVec[n]->GetLength()-1; } } diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h index f35b890..736e821 100644 --- a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h +++ b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h @@ -128,8 +128,9 @@ private: char m_SampleBuffer[TRANSBUF_SIZE]; long m_SampleSize; - long m_CurrentPlayPos; + + float m_InitialPitch[NUM_SAMPLES]; }; #endif diff --git a/SpiralSynthModular.C b/SpiralSynthModular.C index bffbefe..f6c40a0 100644 --- a/SpiralSynthModular.C +++ b/SpiralSynthModular.C @@ -1096,7 +1096,7 @@ ostream &operator<<(ostream &s, SynthModular &o) // make external files dir bool ExternalDirUsed=false; - string command("mkdir "+o.m_FilePath+"_files"); + string command("mkdir '"+o.m_FilePath+"_files'"); system(command.c_str()); if (FILE_VERSION>2)