summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/instrument.cc4
-rw-r--r--src/sample.h11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/instrument.cc b/src/instrument.cc
index ee778d7..d246c09 100644
--- a/src/instrument.cc
+++ b/src/instrument.cc
@@ -82,7 +82,7 @@ Sample* Instrument::sample(level_t level, size_t pos)
if(enable_velocity_randomiser)
{
- float r = (float)std::rand() / (float)RAND_MAX; // random number: [0;1]
+ float r = (float)rand() / (float)RAND_MAX; // random number: [0;1]
r -= 0.5; // random number [-0.5;0.5]
r *= velocity_randomiser_weight * 2; // ex. random number [-0.1;0.1]
level += r;
@@ -121,7 +121,7 @@ Sample* Instrument::sample(level_t level, size_t pos)
return NULL;
}
- size_t idx = std::rand()%(s.size());
+ size_t idx = rand()%(s.size());
sample = s[idx];
}
diff --git a/src/sample.h b/src/sample.h
index a3400a4..f00db13 100644
--- a/src/sample.h
+++ b/src/sample.h
@@ -32,21 +32,20 @@
#include "channel.h"
#include "audiofile.h"
-typedef std::map<Channel*, AudioFile*> AudioFiles;
+using AudioFiles = std::map<Channel*, AudioFile*>;
-class Sample
-{
+class Sample {
friend class InstrumentParser;
friend class PowerList;
-
public:
Sample(const std::string& name, float power);
~Sample();
- AudioFile* getAudioFile(InstrumentChannel* c);
+ AudioFile* getAudioFile(InstrumentChannel *instrument_channel);
private:
- void addAudioFile(InstrumentChannel* c, AudioFile* a);
+ void addAudioFile(InstrumentChannel* instrument_channel,
+ AudioFile* audio_file);
std::string name;
float power;