Commit Graph

145 Commits

Author SHA1 Message Date
Paul Davis 9f4bf02980 change type of MidiTrack's key enforcement to new enum type 2021-11-18 11:16:50 -07:00
Paul Davis 1793c9a61a add new properties for musical mode & root 2021-11-18 08:30:46 -07:00
Paul Davis 9f76d688fd provide missing implementations for MidiTrack key API 2021-11-18 08:30:46 -07:00
Paul Davis fb7dd71c45 add default key and boolean to define whether or not to enforce it 2021-11-18 08:30:45 -07:00
Robin Gareus de3291d10b
Allow to skip setting MIDI patch on session-load #8743
Ardour MIDI tracks unconditionally remember any
MIDI CC/Patch changes that are received.

Patch changes are re-played after the session is loaded,
so that they can reach external synths after ports are
re-connected.

This can lead to issues with synth plugins. Their state
is set first. Receiving a patch-change may alter the synth's
state.
2021-07-13 03:29:28 +02:00
Robin Gareus 2f68656679
Update API to send immediate events
This is to allow passing the EventType to the Buffer, using a
consistent {[Time], Type, size, data} API, that is equivalent
for all classes.

This is particularly useful for Lua scripts and plugin UIs
than can call `write_immediate_event()` while being ignorant
where the data is routed to (MIDI tracks, plugins, processors).
2020-09-20 19:16:43 +02:00
Robin Gareus b49656213d
Prefer const reference (amend f564c92493) 2020-07-26 17:15:15 +02:00
Ben Loftis f564c92493 Prompt user for name of Range and Region bounces (libardour part) 2020-07-26 09:53:47 -05:00
Robin Gareus fbe8075117
Update monitoring
This partially reverts 208c781248
in order to fix monitoring when using punch-in/out.

This also allows to revert to Ardour 5 style MIDI exclusive
Input or Disk monitoring when not using layered-recording.
2020-06-17 23:51:13 +02:00
Paul Davis 9b070eefb1 fix note-tracking in Editor::write_one_track()
We need a MidiStateTracker to determine notes whose end is not reached
during the call to ::write_one_track(), so that we can resolve them
in the output (SMF) source. This required some changes to the ::export_stuff()
API for tracks.

In addition, we now take the source "lock" just once during ::write_one_track()
rather than every time we write. This isn't an integral part of the
note tracking, but fell out along the way.

Finally, note that although we use a vector to handle MIDI "sources" here,
it is expected that there is only 1 MIDI source at present. Leave vectors in
place since it is possible that ::write_one_track() could be modified
in the future to change that.
2020-05-04 18:48:17 -06:00
Robin Gareus f941b3fadd
Add/use default argument for track creation 2020-03-15 14:03:24 +01:00
Paul Davis febaa1ff2d fix unconditional note resolution during DiskReader::realtime_locate()
When looping, we do not want to resolve notes at the end of the loop via ::realtime_locate() -
::get_midi_playback() has already taken care of this. But when not looping, we need this. So,
add an argument to tell all interested parties whether the locate is for a loop end or not
2019-11-06 16:00:31 -07:00
Paul Davis 5d40ab22fd remove a mistakenly left-in declaration 2019-11-02 16:32:18 -06:00
Paul Davis b83ef09947 various adjustments so that a MidiPlaylist gets re-rendered whenever it changes.
This may still be missing a few changes (i.e. they do not cause re-rendering)
2019-11-02 16:32:18 -06:00
Paul Davis 0573e7cdf0 alter where note resolution happens when a re-rendering is scheduled for a MIDI track 2019-11-02 16:32:18 -06:00
Paul Davis 2cf9ad8f8c refactor SessionEvent and DiskIO so that we pass around boost::shared_ptr<Track> rather than Route
(this the raw pointers used inside SessionEvent)
2019-11-02 16:32:18 -06:00
Paul Davis e87e0ec028 add a MidiStateTracker to DiskReader and use to handle transport stop note resolving 2019-11-02 16:32:18 -06:00
Robin Gareus a22f918d9d
Update libardour GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Robin Gareus 84272b4e27
NO-OP: whitespace
Fix space-alignment, mostly due to "frame" -> "sample" changes.
2019-04-08 05:16:33 +02:00
Ben Loftis 208c781248 Auto-monitor == Cue for MIDI tracks. 2018-02-14 18:04:57 -06:00
Robin Gareus e31f5d9998 Clean up State API:
* Processor implement get_state(), classes derived from Processor
  implement protected ::state() -- as documented in processor.h
* likewise for Route, Track: make ::state() a protected interface
* removal of "full_state", use explicit "template_save"
* use RAII/Unwind to skip saving automation-state
2017-10-04 00:54:55 +02:00
Robin Gareus 05ab7a46b5 Fix recording MIDI
- Fix API call to add region(midi_region) -- set count to "1"
- Forward DataRecorded() signal
- remove botched merge/rebase"
  a4a87f56 accidentally brought back code from old-destructive API
  which was removed in af103cf3 and 08c13007
  There is no per track NonLayered record mode anymore, it's session global.
- set can_record correctly to not accidentally clear last capture sources
  for cont'd recording (toggle track's rec-arm)
2017-10-01 03:03:44 +02:00
Robin Gareus eb0dded095 Immediate-event/out-of-band injection update & tweak clearing buffers
Immediate events are used for MIDI-Panic and to inject GUI generated
events e.g. patch-changes, note-events from the track-header
(scroomer-keyboard) and patch-change audition.

Current behavior:

- snapshot copy immediate events from ringbuffer into a buffer at
  the beginning of each the cycle.
- Inject immediate events into input-buffer directly after reading the input
- process "normally"
- pass immediate event-buffer to disk-writer, so it can skip them
  (don't write immediate events to disk)
- if the Route is not monitoring input: clear buffer before disk-reader
  and re-inject (original) immediate events after the disk-reader
- immediate events process normally and are also sent to outputs.
2017-09-30 23:16:04 +02:00
Robin Gareus 5fa9f8b399 Towards fixing no_roll()
Currently ::roll() may actually be a ::no_roll() under some circumstances.

This can also happen during count-in:
  transport_stopped () == transport_rolling()

and during latency-preroll:
   Global session-transport speed != 0, some tracks already roll,
   read data from disk and feed latent plugins.
   but other non-latent tracks or busses don't roll and still have to
   behave like the switch from no_roll() to roll() has not yet happened.

This changes the game WRT to monitoring as well, previously, Route:roll()
called Route::no_roll_unlocked () for conditions outlined above.
Now Track::no_roll_unlocked is called and in some cases wrongly clears
the buffers before the signal hits the disk-writer. (more work is needed
related to 61f8e53b)

On the upside this also fixes an issue with MidiTrack::no_roll not keeping
a lock while pushing data into the step-edit-ringbuffer.

This is also a step towards consolidating all entry points:
::roll(), ::no_roll(), ::silent_roll() in the Route class.
2017-09-30 16:45:45 +02:00
Robin Gareus 27b02b672a remove cruft 2017-09-29 06:32:10 +02:00
Paul Davis 40aebce699 consolidate roll methods into Route::roll()
We want Track to shrink, and logic consolidation is always good. Route already knew about
disk_reader and disk_writer, now it knows about _monitoring_control too
2017-09-18 21:28:02 -04:00
Paul Davis 30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Paul Davis 2a1dccabc9 get diskreader working, and remove per-track varispeed API and mechanism 2017-09-18 11:40:53 -04:00
Paul Davis 35c7274cc9 remove Diskstream from Track and derivatives; get ardour to actually startup 2017-09-18 11:40:53 -04:00
Paul Davis a4a87f56e9 mega-commit to save state of first "it compilesand links" state for separated disk i/o changes.
THIS WILL NOT RUN. THIS REQUIRES MANY CHANGES
2017-09-18 11:40:52 -04:00
Robin Gareus 295562dd52 Save/Restore MIDI Automation Controls (current CC, PGM) 2016-12-07 19:47:04 +01:00
Paul Davis 92f1eb6be9 Revert "change return type of AutomationControl::actually_set_value() from void to bool, to indicate if value was changed."
This reverts commit c104c9d472.
2016-10-14 11:42:41 -04:00
Paul Davis c104c9d472 change return type of AutomationControl::actually_set_value() from void to bool, to indicate if value was changed.
Don't call Session::set_dirty() when no change occurs
2016-10-12 17:26:46 -04:00
Paul Davis e0ff70cf86 first vaguely working version using PresentationInfo
remote control ID and "order keys" have been removed.
2016-05-31 15:30:42 -04:00
Paul Davis 653ae4acd6 universal change in the design of the way Route/Track controls are designed and used. The controls now own their own state, rather than proxy for state in their owners.
Massive changes all over the code to accomodate this. Many things are not finished. Consider this a backup safety commit
2016-05-31 15:30:40 -04:00
Paul Davis 5ea5e513a4 make Track::set_monitoring() use a GroupControlDisposition; expose an AutomationControl for track monitoring choice 2016-01-31 21:47:19 -05:00
Paul Davis 9e5b7db89f first compiling, mostly working version of group controls changes 2016-01-22 11:58:31 -05:00
Paul Davis 9e3299f97d change Controllable::set_value() API to include grouped control consideration.
This also removes Route::group_gain_control() and associated machinery.
Not yet tested with Mackie or other surfaces. More work to done to
start using the group capabilities, and also potentially to add
or derive more controls as RouteAutomationControls
2016-01-02 04:58:30 -05:00
Paul Davis 8d3a8ca913 Add AutomationControl::set_value_unchecked() and AutomationControl::writable() and use them.
Classes derived from AutomationControl now check ::writable() in their ::set_value() methods to ensure that they
do not attempt to overwrite data sent to them while automation playback is underway.
2015-10-21 22:31:35 -04:00
Robin Gareus 22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis 90220998af add Record-Safe feature to libardour (from Nikolay Polyanovskii) 2015-06-16 08:44:03 -04:00
David Robillard c9023ae73d Fix mute of MIDI tracks with channel forcing.
This moves MIDI channel filtering into a reusable class and moves filtering to
the source, rather than modifying the buffer afterwards.  This is necessary so
that the playlist trackers reflect the emitted notes (and thus are able to stop
them in situations like mute).

As a perk, this is also faster because events are just dropped on read, rather
than pushed into a buffer then later removed (which is very slow).

Really hammering on mute or solo still seems to produce stuck notes
occasionally (perhaps related to multiple-on warnings).  I am not yet sure why,
but occasional beats always.
2015-03-29 00:51:56 -04:00
David Robillard 7e2c8ace4b Follow MIDI control values with automation faders.
Fixes bug #6166 (except record).

This attempts to follow the "current" control value somewhat aggressively:

* On locate, slider is set to the value from the top region at the new
  transport position.

* Playback or MIDI input is followed "live".

* Whenever the slider is moved (including automatically), that value is emitted
  as an immediate event to keep external gear in sync.

General idea is that the Ardour slider should act as a mirror of an external
hardware knob, and both should be synced to whatever the control is at the
current transport position.  Since we lack real playback/touch/etc modes for
these for now, we must choose one behaviour, and this seems like the most
reasonable one.

Follow is handled in the audio thread, which is probably not ideal, but since
these controls have no lists and do not record, should be fine.  Probably.
2015-03-26 00:47:34 -04:00
David Robillard c35e94a3c8 Fix some mangled whitespace (noop). 2014-12-30 14:41:22 -05:00
David Robillard cf537b97f5 Add missing namespace qualifiers. 2014-11-30 23:56:19 -05:00
David Robillard 8a128b33d3 Automation of LV2 plugin properties.
Work towards ParameterDescriptor being used more universally to describe control characteristics.
2014-11-02 02:10:24 -05:00
David Robillard 34c1465cf9 Fix crash when changing automation mode for MIDI track control automation.
Also some work towards tolerating automation controls with no automation list,
towards actually doing something for these cases, though not required just to
fix this crash (MidiTrack::set_parameter_automation_state() avoids those
paths).
2014-08-31 18:57:22 -04:00
Robin Gareus 06b4cf92db re-work bounce/freeze. Freezer stops at first active delivery.
amend to 8f52bf7d9f
2014-06-04 02:19:46 +02:00
John Emmas b855e5f322 Merge remote-tracking branch 'remotes/origin/exportvis' into windows+cc
Conflicts (hopefully resolved):
	gtk2_ardour/wscript
	libs/ardour/ardour/audioregion.h
	libs/ardour/ardour/debug.h
	libs/ardour/ardour/directory_names.h
	libs/ardour/ardour/filesystem_paths.h
	libs/ardour/ardour/session_event.h
	libs/gtkmm2ext/gtkmm2ext/utils.h
	libs/panners/1in2out/wscript
	libs/panners/2in2out/wscript
	libs/panners/vbap/wscript
	libs/pbd/pbd/debug.h
	libs/pbd/pbd/file_utils.h
	libs/pbd/pbd/pathexpand.h
	libs/pbd/pbd/ringbuffer.h
	libs/pbd/pbd/ringbufferNPT.h
	libs/pbd/pbd/search_path.h
	libs/pbd/pbd/stacktrace.h
	libs/pbd/pbd/uuid.h
	libs/pbd/pbd/uuid_boost.h
	libs/surfaces/control_protocol/control_protocol/basic_ui.h
	libs/surfaces/control_protocol/control_protocol/control_protocol.h
2013-10-18 10:03:22 +01:00
Paul Davis 24d2b5ec92 add export visibility macros across libardour 2013-10-17 10:02:11 -04:00