Browse Source

1 more sfzero file builds

tags/v1.9.11
falkTX FilipeCSnuk 6 years ago
parent
commit
fbae2fe934
4 changed files with 26 additions and 5 deletions
  1. +1
    -1
      source/modules/sfzero/SFZero.cpp
  2. +1
    -3
      source/modules/sfzero/sfzero/SFZRegion.cpp
  3. +10
    -0
      source/modules/sfzero/sfzero/SFZSound.cpp
  4. +14
    -1
      source/utils/CarlaJuceUtils.hpp

+ 1
- 1
source/modules/sfzero/SFZero.cpp View File

@@ -7,6 +7,6 @@
#include "sfzero/SFZReader.cpp"
#include "sfzero/SFZRegion.cpp"
#include "sfzero/SFZSample.cpp"
// #include "sfzero/SFZSound.cpp"
#include "sfzero/SFZSound.cpp"
// #include "sfzero/SFZSynth.cpp"
// #include "sfzero/SFZVoice.cpp"

+ 1
- 3
source/modules/sfzero/sfzero/SFZRegion.cpp View File

@@ -95,9 +95,7 @@ void sfzero::Region::sf2ToSFZ()
{
ampeg.sustain = 0.0f;
}
#if 0
ampeg.sustain = 100.0f * water::Decibels::decibelsToGain(-ampeg.sustain / 10.0f);
#endif
ampeg.sustain = 100.0f * decibelsToGain(-ampeg.sustain / 10.0f);
ampeg.release = timecents2Secs(static_cast<int>(ampeg.release));

// Pin very short EG segments. Timecents don't get to zero, and our EG is


+ 10
- 0
source/modules/sfzero/sfzero/SFZSound.cpp View File

@@ -20,10 +20,12 @@ sfzero::Sound::~Sound()
regions_.set(i, nullptr);
}

#if 0
for (water::HashMap<water::String, sfzero::Sample *>::Iterator i(samples_); i.next();)
{
delete i.getValue();
}
#endif
}

bool sfzero::Sound::appliesToNote(int /*midiNoteNumber*/)
@@ -34,6 +36,7 @@ bool sfzero::Sound::appliesToNote(int /*midiNoteNumber*/)

bool sfzero::Sound::appliesToChannel(int /*midiChannel*/) { return true; }
void sfzero::Sound::addRegion(sfzero::Region *region) { regions_.add(region); }
#if 0
sfzero::Sample *sfzero::Sound::addSample(water::String path, water::String defaultPath)
{
path = path.replaceCharacter('\\', '/');
@@ -57,9 +60,11 @@ sfzero::Sample *sfzero::Sound::addSample(water::String path, water::String defau
}
return sample;
}
#endif

void sfzero::Sound::addError(const water::String &message) { errors_.add(message); }

#if 0
void sfzero::Sound::addUnsupportedOpcode(const water::String &opcode)
{
if (!unsupportedOpcodes_.contains(opcode))
@@ -70,6 +75,7 @@ void sfzero::Sound::addUnsupportedOpcode(const water::String &opcode)
warnings_.add(warning);
}
}
#endif

void sfzero::Sound::loadRegions()
{
@@ -78,6 +84,7 @@ void sfzero::Sound::loadRegions()
reader.read(file_);
}

#if 0
void sfzero::Sound::loadSamples(water::AudioFormatManager *formatManager, double *progressVar, water::Thread *thread)
{
if (progressVar)
@@ -111,6 +118,7 @@ void sfzero::Sound::loadSamples(water::AudioFormatManager *formatManager, double
*progressVar = 1.0;
}
}
#endif

sfzero::Region *sfzero::Sound::getRegionFor(int note, int velocity, sfzero::Region::Trigger trigger)
{
@@ -179,6 +187,7 @@ water::String sfzero::Sound::dump()
info << "no regions.\n";
}

#if 0
if (samples_.size() > 0)
{
info << samples_.size() << " samples: \n";
@@ -188,6 +197,7 @@ water::String sfzero::Sound::dump()
}
}
else
#endif
{
info << "no samples.\n";
}


+ 14
- 1
source/utils/CarlaJuceUtils.hpp View File

@@ -1,7 +1,8 @@
/*
* Carla misc utils based on Juce
* Copyright (C) 2013 Raw Material Software Ltd.
* Copyright (C) 2013-2015 Filipe Coelho <falktx@falktx.com>
* Copyright (c) 2016 ROLI Ltd.
* Copyright (C) 2013-2018 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -26,6 +27,7 @@
#include "CarlaUtils.hpp"

#include <algorithm>
#include <cmath>

/** A good old-fashioned C macro concatenation helper.
This combines two items (which may themselves be macros) into a single string,
@@ -65,6 +67,17 @@
CARLA_DECLARE_NON_COPY_CLASS(ClassName)
#endif

//=====================================================================================================================
/** Converts a dBFS value to its equivalent gain level.

A gain of 1.0 = 0 dB, and lower gains map onto negative decibel values. Any
decibel value lower than minusInfinityDb will return a gain of 0.
*/
static float decibelsToGain (const float decibels, const float minusInfinityDb = -100.0f)
{
return decibels > minusInfinityDb ? std::pow (10.0f, decibels * 0.05f) : 0.0f;
}

//=====================================================================================================================
/**
Embedding an instance of this class inside another class can be used as a low-overhead


Loading…
Cancel
Save