Browse Source

fixed creating file paths with spaces/odd chars.

fixed wavechooser compiling,
change matrix to reset internel sequencer on reset instead of too first pattern
fixed posh sampler pitch changing on reset.
master
aj_genius 21 years ago
parent
commit
de09d12600
5 changed files with 45 additions and 23 deletions
  1. +37
    -18
      SpiralSound/Plugins/GUI/WaveChooser.C
  2. +1
    -1
      SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C
  3. +4
    -2
      SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C
  4. +2
    -1
      SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h
  5. +1
    -1
      SpiralSynthModular.C

+ 37
- 18
SpiralSound/Plugins/GUI/WaveChooser.C View File

@@ -21,29 +21,48 @@
#include <FL/fl_file_chooser.h>
#include "../../../config.h"

using namespace std;
#ifdef USE_LIBSNDFILE
#include <sndfile.h>
#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;
}

+ 1
- 1
SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C View File

@@ -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;


+ 4
- 2
SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C View File

@@ -183,7 +183,7 @@ void PoshSamplerPlugin::Reset()

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;
}
}
@@ -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;
}
}


+ 2
- 1
SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h View File

@@ -128,8 +128,9 @@ private:
char m_SampleBuffer[TRANSBUF_SIZE];
long m_SampleSize;
long m_CurrentPlayPos;

float m_InitialPitch[NUM_SAMPLES];
};

#endif

+ 1
- 1
SpiralSynthModular.C View File

@@ -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)


Loading…
Cancel
Save