give MIDI tracks a (n automatable) velocity control
This commit is contained in:
parent
25f5b275f4
commit
1d117aa372
|
@ -34,6 +34,7 @@ class MidiPlaylist;
|
|||
class RouteGroup;
|
||||
class SMFSource;
|
||||
class Session;
|
||||
class VelocityControl;
|
||||
|
||||
class LIBARDOUR_API MidiTrack : public Track
|
||||
{
|
||||
|
@ -75,6 +76,8 @@ public:
|
|||
void midi_panic(void);
|
||||
bool write_immediate_event (Evoral::EventType event_type, size_t size, const uint8_t* buf);
|
||||
|
||||
boost::shared_ptr<VelocityControl> velocity_control() const;
|
||||
|
||||
/** A control that will send "immediate" events to a MIDI track when twiddled */
|
||||
struct MidiControl : public AutomationControl {
|
||||
MidiControl(MidiTrack* route, const Evoral::Parameter& param,
|
||||
|
@ -166,6 +169,8 @@ private:
|
|||
MidiChannelFilter _playback_filter;
|
||||
MidiChannelFilter _capture_filter;
|
||||
|
||||
boost::shared_ptr<VelocityControl> _velocity_control;
|
||||
|
||||
void set_state_part_two ();
|
||||
void set_state_part_three ();
|
||||
|
||||
|
|
|
@ -175,6 +175,7 @@ enum AutomationType {
|
|||
BusSendEnable,
|
||||
InsertReturnLevel,
|
||||
MainOutVolume,
|
||||
MidiVelocityAutomation,
|
||||
|
||||
/* used only by Controllable Descriptor to access send parameters */
|
||||
|
||||
|
|
44
libs/ardour/ardour/velocity_control.h
Normal file
44
libs/ardour/ardour/velocity_control.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Paul Davis <paul@linuxaudiosystems.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __ardour_velocity_control_h__
|
||||
#define __ardour_velocity_control_h__
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "pbd/controllable.h"
|
||||
|
||||
#include "evoral/Parameter.h"
|
||||
|
||||
#include "ardour/slavable_automation_control.h"
|
||||
#include "ardour/libardour_visibility.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
|
||||
class Session;
|
||||
|
||||
class LIBARDOUR_API VelocityControl : public SlavableAutomationControl {
|
||||
public:
|
||||
VelocityControl (Session& session);
|
||||
};
|
||||
|
||||
} /* namespace */
|
||||
|
||||
#endif /* __ardour_velocity_control_h__ */
|
|
@ -166,6 +166,7 @@ AutomationList::create_curve_if_necessary()
|
|||
case FadeInAutomation:
|
||||
case FadeOutAutomation:
|
||||
case EnvelopeAutomation:
|
||||
case MidiVelocityAutomation:
|
||||
create_curve();
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -208,6 +208,7 @@ setup_enum_writer ()
|
|||
REGISTER_ENUM (BusSendEnable);
|
||||
REGISTER_ENUM (InsertReturnLevel);
|
||||
REGISTER_ENUM (MainOutVolume);
|
||||
REGISTER_ENUM (MidiVelocityAutomation);
|
||||
REGISTER (_AutomationType);
|
||||
|
||||
REGISTER_ENUM (Off);
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
#include "ardour/session_playlists.h"
|
||||
#include "ardour/types_convert.h"
|
||||
#include "ardour/utils.h"
|
||||
#include "ardour/velocity_control.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
|
@ -108,6 +109,9 @@ MidiTrack::init ()
|
|||
return -1;
|
||||
}
|
||||
|
||||
_velocity_control.reset (new VelocityControl (_session));
|
||||
add_control (_velocity_control);
|
||||
|
||||
_input->changed.connect_same_thread (*this, boost::bind (&MidiTrack::track_input_active, this, _1, _2));
|
||||
|
||||
_disk_writer->set_note_mode (_note_mode);
|
||||
|
|
38
libs/ardour/velocity_control.cc
Normal file
38
libs/ardour/velocity_control.cc
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Paul Davis <paul@linuxaudiosystems.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "pbd/convert.h"
|
||||
#include "pbd/strsplit.h"
|
||||
|
||||
#include "ardour/velocity_control.h"
|
||||
#include "ardour/session.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
using namespace std;
|
||||
|
||||
|
||||
VelocityControl::VelocityControl (Session& session)
|
||||
: SlavableAutomationControl (session, Evoral::Parameter (MidiVelocityAutomation), ParameterDescriptor (Evoral::Parameter (MidiVelocityAutomation)),
|
||||
boost::shared_ptr<AutomationList> (new AutomationList (Evoral::Parameter (MidiVelocityAutomation), Temporal::BeatTime)),
|
||||
_("Velocity"))
|
||||
{
|
||||
}
|
|
@ -278,6 +278,7 @@ libardour_sources = [
|
|||
'utils.cc',
|
||||
'vca.cc',
|
||||
'vca_manager.cc',
|
||||
'velocity_control.cc',
|
||||
'video_tools_paths.cc',
|
||||
'vumeterdsp.cc',
|
||||
'worker.cc',
|
||||
|
|
Loading…
Reference in New Issue
Block a user