Skip to content

Commit

Permalink
remove midi
Browse files Browse the repository at this point in the history
  • Loading branch information
lyrra committed Jan 4, 2025
1 parent ee702e0 commit d83f86e
Show file tree
Hide file tree
Showing 26 changed files with 9 additions and 749 deletions.
6 changes: 0 additions & 6 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,6 @@ if (CC_IS_EMSCRIPTEN)
list(APPEND MSCORE_APPEND_SRC $<TARGET_OBJECTS:fluidsynth>)
endif()

# if any above modules are using dynamic-library loading (musesampler)
# then if mingw, use dl-lib which emulates unix-dl
if (MINGW)
list(APPEND LINK_LIB "-ldl -fstack-protector")
endif (MINGW)

###########################################
# Resources
###########################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ void CommonAudioApiConfigurationModel::load()
});

audioDriver()->outputDeviceChanged().onNotify(this, [this]() {
LOGE("---- emit currentDeviceIdChanged ----");
emit currentDeviceIdChanged();
emit sampleRateChanged();
emit bufferSizeListChanged();
Expand Down Expand Up @@ -126,6 +125,5 @@ QList<unsigned int> CommonAudioApiConfigurationModel::sampleRateList() const

void CommonAudioApiConfigurationModel::sampleRateSelected(const QString& sampleRateStr)
{
LOGE("------- selected samplerate: %s ------", qPrintable(sampleRateStr));
audioConfiguration()->setSampleRate(sampleRateStr.toInt());
}
6 changes: 3 additions & 3 deletions src/engraving/dom/note.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,9 +854,9 @@ String Note::tpcUserName(const bool explicitAccidental, bool full) const

String pitchOffset;
if (tuning() != 0) {
static constexpr size_t maxLen = 50;
char buffer[maxLen];
snprintf(buffer, maxLen, "%+.3f", tuning());
static constexpr size_t bufferSize = 50;
char buffer[bufferSize];
snprintf(buffer, bufferSize, "%+.3f", tuning());
pitchOffset = String::fromAscii(buffer);
}

Expand Down
7 changes: 0 additions & 7 deletions src/framework/audio/iaudiodriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

#include "audiotypes.h"
#include "framework/midi/miditypes.h"
#include "framework/audio/midiqueue.h"

namespace muse::audio {
class AudioDriverState;
Expand Down Expand Up @@ -97,9 +96,6 @@ class IAudioDriver : MODULE_EXPORT_INTERFACE
virtual int audioDelayCompensate() const = 0;
virtual void setAudioDelayCompensate(const int frames) = 0;

virtual bool pushMidiEvent(muse::midi::Event&) = 0;
virtual std::vector<muse::midi::MidiDevice> availableMidiDevices(muse::midi::MidiPortDirection dir) const = 0;

virtual void resume() = 0;
virtual void suspend() = 0;
};
Expand All @@ -112,9 +108,6 @@ class AudioDriverState
virtual void close() = 0;
virtual bool isOpened() const = 0;
virtual void setAudioDelayCompensate(const int frames) = 0;
virtual bool pushMidiEvent(muse::midi::Event&) = 0;
virtual void registerMidiInputQueue(async::Channel<muse::midi::tick_t, muse::midi::Event >) = 0;
virtual std::vector<muse::midi::MidiDevice> availableMidiDevices(muse::midi::MidiPortDirection dir) const = 0;

virtual void changedPlaying() const = 0;
virtual void changedPosition(muse::audio::secs_t secs, muse::midi::tick_t tick) const = 0;
Expand Down
29 changes: 0 additions & 29 deletions src/framework/audio/internal/audiomidimanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "framework/audio/midiqueue.h"
#include "audiomidimanager.h"

#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
Expand Down Expand Up @@ -76,16 +75,6 @@ std::string AudioMidiManager::name() const

bool AudioMidiManager::open(const Spec& spec, Spec* activeSpec)
{
/**************************************************************************/
// a bit lazy registering the midi-input-queue here, but midimodule isn't
// available at audiomodule init, because midimodule starts after audiomodule
// not sure we got the identity of eventQueue (ie, passed by reference)
#if defined(JACK_AUDIO)
muse::async::Channel<muse::midi::tick_t, muse::midi::Event> queue = midiInPort()->eventReceived();
m_current_audioDriverState->registerMidiInputQueue(queue);
#endif
/**************************************************************************/

// re-initialize devide
m_current_audioDriverState->setAudioDelayCompensate(m_audioDelayCompensate);

Expand Down Expand Up @@ -364,24 +353,6 @@ std::vector<unsigned int> AudioMidiManager::availableOutputDeviceSampleRates() c
};
}

bool AudioMidiManager::pushMidiEvent(muse::midi::Event& e)
{
if (m_current_audioDriverState) {
m_current_audioDriverState->pushMidiEvent(e);
return true;
}
return false;
}

std::vector<muse::midi::MidiDevice> AudioMidiManager::availableMidiDevices(muse::midi::MidiPortDirection direction) const
{
if (m_current_audioDriverState) {
return m_current_audioDriverState->availableMidiDevices(direction);
}
std::vector<muse::midi::MidiDevice> x;
return x;
}

void AudioMidiManager::resume()
{
}
Expand Down
6 changes: 0 additions & 6 deletions src/framework/audio/internal/audiomidimanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#include "async/asyncable.h"

#include "framework/midi/imidiinport.h"
#include "framework/midi/midimodule.h"
#include "iaudiodriver.h"

#include "platform/lin/audiodeviceslistener.h"
Expand All @@ -39,7 +37,6 @@ class AudioMidiManager : public IAudioDriver, public async::Asyncable
Inject<mu::playback::IPlaybackConfiguration> playbackConfiguration;
Inject<mu::playback::IPlaybackController> playbackController;

Inject<muse::midi::IMidiInPort> midiInPort;
public:
AudioMidiManager();
~AudioMidiManager();
Expand Down Expand Up @@ -70,9 +67,6 @@ class AudioMidiManager : public IAudioDriver, public async::Asyncable
int audioDelayCompensate() const override;
void setAudioDelayCompensate(const int frames) override;

bool pushMidiEvent(muse::midi::Event& e) override;
std::vector<muse::midi::MidiDevice> availableMidiDevices(muse::midi::MidiPortDirection direction) const override;

unsigned int outputDeviceSampleRate() const override;
bool setOutputDeviceSampleRate(unsigned int sampleRate) override;
muse::async::Notification outputDeviceSampleRateChanged() const override;
Expand Down
6 changes: 3 additions & 3 deletions src/framework/audio/internal/fx/reverb/reverbprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ ReverbProcessor::ReverbProcessor(const AudioFxParams& params, audioch_t audioCha
setParameter(Params::PreDelayMs, getParameter(Params::PreDelayMs));
setParameter(Params::FeedbackTop, getParameter(Params::FeedbackTop));

setFormat(audioChannelsCount, audioConfiguration()->sampleRate(), 512 /*maximumBlockSize*/);
setFormat(audioChannelsCount, 44100.0 /*sampleRate*/, 512 /*maximumBlockSize*/);
}

ReverbProcessor::~ReverbProcessor()
Expand Down Expand Up @@ -380,7 +380,7 @@ float ReverbProcessor::getParameter(int32_t index)
void ReverbProcessor::calculateTailParams()
{
const int* delayTimes = _delayTimesForN(m_delays);
float scale = float(getParameter(LateRoomScale) * m_processor._sampleRate / static_cast<float>(audioConfiguration()->sampleRate()));
float scale = float(getParameter(LateRoomScale) * m_processor._sampleRate / 44100.);

const float log_db60 = std::log(fromDecibel(-60.f));

Expand Down Expand Up @@ -438,7 +438,7 @@ void ReverbProcessor::calculateModParams()

float modDepthSmp = float(depthMs * 0.001f * m_processor._sampleRate);
d->sinLfo.setup(m_delays, freqHz * d->modStep, modDepthSmp, m_processor._sampleRate);
float scale = float(getParameter(LateRoomScale) * m_processor._sampleRate / static_cast<float>(audioConfiguration()->sampleRate()));
float scale = float(getParameter(LateRoomScale) * m_processor._sampleRate / 44100.);
for (int i = 0; i < m_delays; ++i) {
d->modDelay[i].setBaseDelay(delayTimes[i] * scale, modDepthSmp * 2.f);
}
Expand Down
3 changes: 0 additions & 3 deletions src/framework/audio/internal/fx/reverb/reverbprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@
#include <utility>
#include <vector>

#include "modularity/ioc.h"
#include "iaudioconfiguration.h"
#include "ifxprocessor.h"

namespace muse::audio::fx {
class ReverbProcessor : public IFxProcessor
{
Inject<muse::audio::IAudioConfiguration> audioConfiguration;
public:
ReverbProcessor(const audio::AudioFxParams& params, audioch_t audioChannelsCount = 2);
~ReverbProcessor() override;
Expand Down
16 changes: 0 additions & 16 deletions src/framework/audio/internal/platform/alsa/alsaaudiodriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,3 @@ void AlsaDriverState::changedPlaying() const
void AlsaDriverState::changedPosition(muse::audio::secs_t secs, muse::midi::tick_t tick) const
{
}

bool AlsaDriverState::pushMidiEvent(muse::midi::Event&)
{
return true; // dummy
}

void AlsaDriverState::registerMidiInputQueue(async::Channel<muse::midi::tick_t, muse::midi::Event > midiInputQueue)
{
m_eventReceived = midiInputQueue;
}

std::vector<muse::midi::MidiDevice> AlsaDriverState::availableMidiDevices([[maybe_unused]] muse::midi::MidiPortDirection direction) const
{
std::vector<muse::midi::MidiDevice> x;
return x; // dummy
}
3 changes: 0 additions & 3 deletions src/framework/audio/internal/platform/alsa/alsaaudiodriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ class AlsaDriverState : public AudioDriverState
void close() override;
bool isOpened() const override;
void setAudioDelayCompensate(const int frames) override;
bool pushMidiEvent(muse::midi::Event& e) override;
void registerMidiInputQueue(async::Channel<muse::midi::tick_t, muse::midi::Event >) override;
std::vector<muse::midi::MidiDevice> availableMidiDevices(muse::midi::MidiPortDirection direction) const override;
std::string deviceName() const;
void deviceName(const std::string newDeviceName);
void changedPlaying() const override;
Expand Down
Loading

0 comments on commit d83f86e

Please sign in to comment.