fixed wavechooser compiling, change matrix to reset internel sequencer on reset instead of too first pattern fixed posh sampler pitch changing on reset.master
| @@ -21,29 +21,48 @@ | |||||
| #include <FL/fl_file_chooser.h> | #include <FL/fl_file_chooser.h> | ||||
| #include "../../../config.h" | #include "../../../config.h" | ||||
| using namespace std; | |||||
| #ifdef USE_LIBSNDFILE | #ifdef USE_LIBSNDFILE | ||||
| #include <sndfile.h> | #include <sndfile.h> | ||||
| #endif | #endif | ||||
| char *WaveFileName (void) { | |||||
| string AvailFmt; | |||||
| char *WaveFileName (void) | |||||
| { | |||||
| string AvailFmt; | |||||
| #ifdef USE_LIBSNDFILE | #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 | #else | ||||
| AvailFmt = "{*.wav,*.WAV}"; | |||||
| AvailFmt = "{*.wav,*.WAV}"; | |||||
| #endif | #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; | |||||
| } | } | ||||
| @@ -157,7 +157,7 @@ SpiralGUIType *MatrixPlugin::CreateGUI() | |||||
| void MatrixPlugin::Reset() | void MatrixPlugin::Reset() | ||||
| { | { | ||||
| ResetPorts(); | ResetPorts(); | ||||
| m_Current = 0; | |||||
| m_Current = GetPatSeq(0); | |||||
| m_GUICurrent = 0; | m_GUICurrent = 0; | ||||
| m_Time = 0.0f; | m_Time = 0.0f; | ||||
| m_Step = 0; | m_Step = 0; | ||||
| @@ -183,7 +183,7 @@ void PoshSamplerPlugin::Reset() | |||||
| for (int s=0; s<NUM_SAMPLES; s++) | for (int s=0; s<NUM_SAMPLES; s++) | ||||
| { | { | ||||
| m_SampleDescVec[s]->Pitch *= 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; | 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]->SampleRate=m_HostInfo->SAMPLERATE; | ||||
| m_SampleDescVec[s]->Stereo=false; | m_SampleDescVec[s]->Stereo=false; | ||||
| m_SampleDescVec[s]->Pitch *= 1.0f; | m_SampleDescVec[s]->Pitch *= 1.0f; | ||||
| m_InitialPitch[s] = m_SampleDescVec[s]->Pitch; | |||||
| m_SampleDescVec[s]->LoopEnd=m_SampleVec[s]->GetLength(); | 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); | InitializeSampleDescription(m_SampleDescVec[n], Name, n); | ||||
| m_SampleDescVec[n]->SampleRate=Wav.GetSamplerate(); | m_SampleDescVec[n]->SampleRate=Wav.GetSamplerate(); | ||||
| m_SampleDescVec[n]->Stereo=Wav.IsStereo(); | 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; | m_SampleDescVec[n]->LoopEnd=m_SampleVec[n]->GetLength()-1; | ||||
| } | } | ||||
| } | } | ||||
| @@ -128,8 +128,9 @@ private: | |||||
| char m_SampleBuffer[TRANSBUF_SIZE]; | char m_SampleBuffer[TRANSBUF_SIZE]; | ||||
| long m_SampleSize; | long m_SampleSize; | ||||
| long m_CurrentPlayPos; | long m_CurrentPlayPos; | ||||
| float m_InitialPitch[NUM_SAMPLES]; | |||||
| }; | }; | ||||
| #endif | #endif | ||||
| @@ -1096,7 +1096,7 @@ ostream &operator<<(ostream &s, SynthModular &o) | |||||
| // make external files dir | // make external files dir | ||||
| bool ExternalDirUsed=false; | bool ExternalDirUsed=false; | ||||
| string command("mkdir "+o.m_FilePath+"_files"); | |||||
| string command("mkdir '"+o.m_FilePath+"_files'"); | |||||
| system(command.c_str()); | system(command.c_str()); | ||||
| if (FILE_VERSION>2) | if (FILE_VERSION>2) | ||||