ardour.git
4 years agouse reverse-reading of MIDI data in DiskReader
Paul Davis [Mon, 18 Nov 2019 19:01:26 +0000 (12:01 -0700)]
use reverse-reading of MIDI data in DiskReader

4 years agosupport backwards reading of MIDI from RTMidiBuffer
Paul Davis [Mon, 18 Nov 2019 18:40:59 +0000 (11:40 -0700)]
support backwards reading of MIDI from RTMidiBuffer

4 years agofix typo/thinko in logic to decide if MIDI buffers in DiskWriter require the butler...
Paul Davis [Mon, 18 Nov 2019 18:40:06 +0000 (11:40 -0700)]
fix typo/thinko in logic to decide if MIDI buffers in DiskWriter require the butler (to write to disk)

4 years agoFix automation lookup when rolling backwards
Robin Gareus [Mon, 18 Nov 2019 14:10:15 +0000 (15:10 +0100)]
Fix automation lookup when rolling backwards

4 years agoNO-OP: simplify code
Robin Gareus [Mon, 18 Nov 2019 14:09:43 +0000 (15:09 +0100)]
NO-OP: simplify code

find_next_ac_event, needs to find the next event *after* (but not
at) start.

std::upper_bound returns an iterator pointing to the first element
in the range [first, last) that is greater than value.
This is equivalent to using std::lower_bound an iterating until
finding the first element greater than.

4 years agoAutomation event lookup when rolling backwards
Robin Gareus [Mon, 18 Nov 2019 14:06:59 +0000 (15:06 +0100)]
Automation event lookup when rolling backwards

When rolling backwards we need to be able to find
the *next* event before "start".

4 years agoTweak LFO script
Robin Gareus [Sun, 17 Nov 2019 13:51:33 +0000 (14:51 +0100)]
Tweak LFO script

* thin automation to prevent too dense events
* add icon (cosine wave)

4 years agoremove debug output
Paul Davis [Sat, 16 Nov 2019 03:42:15 +0000 (20:42 -0700)]
remove debug output

4 years agofix questionable and not entirely intended change that was a part of dad47e445cb349
Paul Davis [Sat, 16 Nov 2019 03:40:23 +0000 (20:40 -0700)]
fix questionable and not entirely intended change that was a part of dad47e445cb349

4 years agobetter transport master behavior when working with sample-clock-synced transport...
Paul Davis [Fri, 15 Nov 2019 22:58:29 +0000 (15:58 -0700)]
better transport master behavior when working with sample-clock-synced transport masters

4 years agoimprove behavior when synced to JACK transport
Paul Davis [Fri, 15 Nov 2019 22:57:13 +0000 (15:57 -0700)]
improve behavior when synced to JACK transport

Heuristic and actions when a locate is needed are different for
JACK transport than TC

4 years agoimprove initial coordinate with JACK transport state
Paul Davis [Fri, 15 Nov 2019 22:54:41 +0000 (15:54 -0700)]
improve initial coordinate with JACK transport state

4 years agobetter debugging message
Paul Davis [Fri, 15 Nov 2019 22:52:20 +0000 (15:52 -0700)]
better debugging message

4 years agoconsolidate setting of "get roll after locate" in TFSM
Paul Davis [Fri, 15 Nov 2019 22:51:58 +0000 (15:51 -0700)]
consolidate setting of "get roll after locate" in TFSM

4 years agoNO-OP: move brace
Paul Davis [Fri, 15 Nov 2019 22:50:33 +0000 (15:50 -0700)]
NO-OP: move brace

4 years agowhen synced to JACK transport, transport requests go there first.
Paul Davis [Fri, 15 Nov 2019 22:50:05 +0000 (15:50 -0700)]
when synced to JACK transport, transport requests go there first.

4 years agofix behavior of Session::maybe_stop() when synced to JACK Transport
Paul Davis [Fri, 15 Nov 2019 22:49:08 +0000 (15:49 -0700)]
fix behavior of Session::maybe_stop() when synced to JACK Transport

4 years agomake comment more accurate
Paul Davis [Fri, 15 Nov 2019 22:48:29 +0000 (15:48 -0700)]
make comment more accurate

4 years agoconsolidate Session::locate() and Session::do_locate()
Paul Davis [Fri, 15 Nov 2019 22:47:29 +0000 (15:47 -0700)]
consolidate Session::locate() and Session::do_locate()

The first no longer needs to handle requests by passing them to
JACK transport

4 years agono need for MidiClockTransportMaster::starting() method
Paul Davis [Fri, 15 Nov 2019 22:16:50 +0000 (15:16 -0700)]
no need for MidiClockTransportMaster::starting() method

4 years agoimprove behavior of JACK transport sync callback.
Paul Davis [Fri, 15 Nov 2019 22:15:41 +0000 (15:15 -0700)]
improve behavior of JACK transport sync callback.

Do not call transport actions directly, just report back to JACK
on transport status.

4 years agoadd a bit of debugging to JACK transport code
Paul Davis [Fri, 15 Nov 2019 22:14:54 +0000 (15:14 -0700)]
add a bit of debugging to JACK transport code

4 years agofix resampling ratio when stopped (corner case - not typically called)
Paul Davis [Fri, 15 Nov 2019 22:14:09 +0000 (15:14 -0700)]
fix resampling ratio when stopped (corner case - not typically called)

4 years agomove DiskReader::inc_no_disk_output() into .cc to allow for easier debugging
Paul Davis [Fri, 15 Nov 2019 22:12:49 +0000 (15:12 -0700)]
move DiskReader::inc_no_disk_output() into .cc to allow for easier debugging

4 years agofix crash with -D slave caused by too-early use of a transport master's _port member
Paul Davis [Tue, 12 Nov 2019 01:23:22 +0000 (18:23 -0700)]
fix crash with -D slave caused by too-early use of a transport master's _port member

4 years agofix oddly damaged code (vs. 5.x) for EngineSlave core methods (JACK transport)
Paul Davis [Tue, 12 Nov 2019 01:22:45 +0000 (18:22 -0700)]
fix oddly damaged code (vs. 5.x) for EngineSlave core methods (JACK transport)

4 years agoeliminate hacky design for being able to deliver the correct time as JACK timebase...
Paul Davis [Tue, 12 Nov 2019 01:21:47 +0000 (18:21 -0700)]
eliminate hacky design for being able to deliver the correct time as JACK timebase master

4 years agofix up the creation & state restore of the TransportMasterManager
Paul Davis [Tue, 12 Nov 2019 01:02:37 +0000 (18:02 -0700)]
fix up the creation & state restore of the TransportMasterManager

4 years agoput JACK time master option back in the menus
Paul Davis [Tue, 12 Nov 2019 00:52:48 +0000 (17:52 -0700)]
put JACK time master option back in the menus

4 years agoAdd script to create LFO-like plugin automation
Daniel Appelt [Thu, 14 Nov 2019 09:08:13 +0000 (10:08 +0100)]
Add script to create LFO-like plugin automation

4 years agoFix cycle-end position when not rolling
Robin Gareus [Thu, 14 Nov 2019 20:50:00 +0000 (21:50 +0100)]
Fix cycle-end position when not rolling

When stopped start_sample == end_sample.
This fixes accidental automation lookup,
as well as plugin time/position information.

4 years agoRelax LV2 time-info re-transmission condition
Robin Gareus [Thu, 14 Nov 2019 20:37:14 +0000 (21:37 +0100)]
Relax LV2 time-info re-transmission condition

Allow beat (quarter-note count) to drift by 1/100 beat before re-sync.
This prevents excessive re-transmissions

4 years agoLV2 extension for host's time-scale vari-speed
Robin Gareus [Thu, 14 Nov 2019 20:15:30 +0000 (21:15 +0100)]
LV2 extension for host's time-scale vari-speed

Ardour 6 internally always runs at speed 1.0 (or -1.0, or stopped 0.0).
There is no vari-speed that scale "BPM" or "n_sample" time progression
per cycle.

Instead Ardour 6 vari-speed mechanism transparently re-samples I/O.
So process-time is scaled only relative to wall-clock time.

From a plugin's POV this is similar to "freewheeling": The plugin
processes data as if the host plays at speed 1.0. While the host
plays this data at a different rate.

Some plugins may like to be informed about the host's actual
playback rate.

Currently this is mainly for the benefit of github.com/x42/repitch.lv2.git

4 years agoInitialize uninitialized variables
Robin Gareus [Thu, 14 Nov 2019 19:03:22 +0000 (20:03 +0100)]
Initialize uninitialized variables

This also ensures that musical-time information is initially
transmitted to a plugin.

4 years agoAllow vari-speed slowdown down to 2%
Robin Gareus [Thu, 14 Nov 2019 18:39:48 +0000 (19:39 +0100)]
Allow vari-speed slowdown down to 2%

4 years agoFix MIDNAM device list for plugin-provided names
Robin Gareus [Wed, 13 Nov 2019 22:00:12 +0000 (23:00 +0100)]
Fix MIDNAM device list for plugin-provided names

4 years agoAmend previous commit - latch toggles only while rolling
Robin Gareus [Wed, 13 Nov 2019 21:14:19 +0000 (22:14 +0100)]
Amend previous commit - latch toggles only while rolling

4 years agoAutomation watch toggle buttons and enforce latch
Robin Gareus [Wed, 13 Nov 2019 21:02:07 +0000 (22:02 +0100)]
Automation watch toggle buttons and enforce latch

4 years agoRemove boolean automation special case
Robin Gareus [Wed, 13 Nov 2019 16:21:51 +0000 (17:21 +0100)]
Remove boolean automation special case

Previously setting a boolean-control to "write" and roll did not
create an automation-point.

The state was not correctly captured.
The boolean-control needed to be toggled explicitly to create
an automation point.

4 years agoFix automation-write when locating
Robin Gareus [Wed, 13 Nov 2019 15:57:28 +0000 (16:57 +0100)]
Fix automation-write when locating

When locating while writing automation, begin a new write-pass,
and add a guard point at the locate target position.

NB set_in_write_pass takes 3 arguments: (write_enable, add_point, when)
the last two default to false, 0.

4 years agoFix bool-automation anchor
Robin Gareus [Wed, 13 Nov 2019 15:53:46 +0000 (16:53 +0100)]
Fix bool-automation anchor

Typo sneaked in from ff2f93497...cc7de475f2

4 years agoTweak layout of Plugin-Preset dialog
Robin Gareus [Tue, 12 Nov 2019 18:34:12 +0000 (19:34 +0100)]
Tweak layout of Plugin-Preset dialog

4 years agoAllow to override plugin-provided MIDNAM
Robin Gareus [Tue, 12 Nov 2019 16:00:50 +0000 (17:00 +0100)]
Allow to override plugin-provided MIDNAM

4 years agoSkip custom MIDNAM files in generic MTAV list
Robin Gareus [Tue, 12 Nov 2019 05:29:05 +0000 (06:29 +0100)]
Skip custom MIDNAM files in generic MTAV list

4 years agoAdd API to query if a given MIDNAM is plugin-provided
Robin Gareus [Tue, 12 Nov 2019 05:28:02 +0000 (06:28 +0100)]
Add API to query if a given MIDNAM is plugin-provided

4 years agoIndicate the numeric peak-hold is always digital-peak
Robin Gareus [Mon, 11 Nov 2019 23:07:51 +0000 (00:07 +0100)]
Indicate the numeric peak-hold is always digital-peak

4 years agoOnly retain control-port connections
Robin Gareus [Mon, 11 Nov 2019 22:37:11 +0000 (23:37 +0100)]
Only retain control-port connections

When MIDI input follows selection, ports that provide music-data
should be disconnected, even if they *also* provide control-data

4 years agoPrefs > Plugins > Scan should discover new plugins
Robin Gareus [Sun, 10 Nov 2019 21:33:46 +0000 (22:33 +0100)]
Prefs > Plugins > Scan should discover new plugins

First argument is `cache_only`. `false` means to discover news ones.

4 years agoLog warning if host does not support midnam/bankpatch extensions
Christopher Arndt [Sat, 9 Nov 2019 23:49:18 +0000 (00:49 +0100)]
Log warning if host does not support midnam/bankpatch extensions

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
4 years agoFix segfault: don't try to use midnam:update extension if host doesn't support it
Christopher Arndt [Sat, 9 Nov 2019 23:47:57 +0000 (00:47 +0100)]
Fix segfault: don't try to use midnam:update extension if host doesn't support it

Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
4 years agoAsk xjadeo to use ArdourMono font for OSD
Robin Gareus [Sat, 9 Nov 2019 05:34:31 +0000 (06:34 +0100)]
Ask xjadeo to use ArdourMono font for OSD

4 years agoRemove invalid error message
Robin Gareus [Sat, 9 Nov 2019 05:30:46 +0000 (06:30 +0100)]
Remove invalid error message

This clause is in NO_VFORK, vfork_exec_wrapper is irrelevant there

4 years agoFix child-process communication (video monitor in particular)
Robin Gareus [Sat, 9 Nov 2019 05:28:55 +0000 (06:28 +0100)]
Fix child-process communication (video monitor in particular)

103ef2ba08e5 introduced an API to write raw data (const void*)
to a child process, along with the previous API to
write (std::string const&)

VideoMonitor uses write_to_stdin("fixed text"), and g++
interprets this to use the (const void*) API instead
of the std::string, which breaks communication.

4 years agoFix endless loop when drag/copy locked region
Robin Gareus [Sat, 9 Nov 2019 04:09:21 +0000 (05:09 +0100)]
Fix endless loop when drag/copy locked region

4 years agoPreview video frame when dragging
Robin Gareus [Sat, 9 Nov 2019 04:03:38 +0000 (05:03 +0100)]
Preview video frame when dragging

4 years agoAdd convenience methods to test for active drags
Robin Gareus [Sat, 9 Nov 2019 00:35:55 +0000 (01:35 +0100)]
Add convenience methods to test for active drags

4 years agofix crash if Splash::pop_back_for() is called without splash on-screen
Paul Davis [Fri, 8 Nov 2019 23:56:59 +0000 (16:56 -0700)]
fix crash if Splash::pop_back_for() is called without splash on-screen

4 years agoFix Metronome: use loop-range only when looping
Robin Gareus [Fri, 8 Nov 2019 21:49:46 +0000 (22:49 +0100)]
Fix Metronome: use loop-range only when looping

4 years agoFix tempo-grid calculation: prevent duplicate events, enforce range
Robin Gareus [Fri, 8 Nov 2019 21:49:23 +0000 (22:49 +0100)]
Fix tempo-grid calculation: prevent duplicate events, enforce range

4 years agoFix uninitialized value
Robin Gareus [Fri, 8 Nov 2019 20:01:28 +0000 (21:01 +0100)]
Fix uninitialized value

ARDOUR::LV2Plugin::init -> lilv_state_restore () -> set_port_value ()
compares new against current value

4 years agofix crash caused by storing clock modes while loading a session
Paul Davis [Fri, 8 Nov 2019 19:39:58 +0000 (12:39 -0700)]
fix crash caused by storing clock modes while loading a session

The store would delete any existing node of the same name,
which was the node being used to set the mode in the first
place.

4 years agoIgnore latency of inactive routes
Robin Gareus [Fri, 8 Nov 2019 16:49:37 +0000 (17:49 +0100)]
Ignore latency of inactive routes

4 years agoRemove unused signal
Robin Gareus [Fri, 8 Nov 2019 16:36:52 +0000 (17:36 +0100)]
Remove unused signal

4 years agoClick: pre-allocate memory for grid-point lookup
Robin Gareus [Fri, 8 Nov 2019 16:28:51 +0000 (17:28 +0100)]
Click: pre-allocate memory for grid-point lookup

4 years agoFix metronome when looping
Robin Gareus [Fri, 8 Nov 2019 16:16:04 +0000 (17:16 +0100)]
Fix metronome when looping

4 years agoFix loop/pre-roll
Robin Gareus [Fri, 8 Nov 2019 16:08:47 +0000 (17:08 +0100)]
Fix loop/pre-roll

Pre-roll to fill buffers only needs to be done once when starting
to play or when locating.

Seamless looping just continues. Every processor takes the loop
position into account locally.

4 years agoremove stacktrace
Paul Davis [Thu, 7 Nov 2019 06:55:46 +0000 (23:55 -0700)]
remove stacktrace

4 years agoremove debug output
Paul Davis [Thu, 7 Nov 2019 06:54:47 +0000 (23:54 -0700)]
remove debug output

4 years agodo not transition "back" to Rolling by calling start_transport() if a locate was...
Paul Davis [Thu, 7 Nov 2019 06:54:34 +0000 (23:54 -0700)]
do not transition "back" to Rolling by calling start_transport() if a locate was for loop-end

We never stopped the transport, so there's no reason to start it again. Doing so causes alignment problems
because all tracks have their ::run() ranges reinitialized

4 years agofix unconditional note resolution during DiskReader::realtime_locate()
Paul Davis [Thu, 7 Nov 2019 05:12:40 +0000 (22:12 -0700)]
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

4 years agomove all responsibility for autostart into StartupFSM and out of engine dialog
Paul Davis [Thu, 7 Nov 2019 00:35:30 +0000 (17:35 -0700)]
move all responsibility for autostart into StartupFSM and out of engine dialog

4 years agoremove unused API
Paul Davis [Thu, 7 Nov 2019 00:05:07 +0000 (17:05 -0700)]
remove unused API

4 years agoimplement intended auto-start logic for startupFSM
Paul Davis [Wed, 6 Nov 2019 23:51:03 +0000 (16:51 -0700)]
implement intended auto-start logic for startupFSM

4 years agoif user uses Ctrl/Cmd-w to close a dialog during startup, treat that as a request...
Paul Davis [Wed, 6 Nov 2019 23:32:46 +0000 (16:32 -0700)]
if user uses Ctrl/Cmd-w to close a dialog during startup, treat that as a request to exit

4 years agoadd a signal to Gtkmm2ext::Keyboard to allow (possible) handling of close-current...
Paul Davis [Wed, 6 Nov 2019 23:25:30 +0000 (16:25 -0700)]
add a signal to Gtkmm2ext::Keyboard to allow (possible) handling of close-current-dialog

4 years agofix unconditional note resolution during DiskReader::realtime_locate()
Paul Davis [Wed, 6 Nov 2019 23:00:00 +0000 (16:00 -0700)]
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

4 years agoUse strict-i/o on master-bus by default
Robin Gareus [Wed, 6 Nov 2019 19:05:50 +0000 (20:05 +0100)]
Use strict-i/o on master-bus by default

This precludes issues with multi-out-plugins adding an excessive
number of ports and changing master-panning.

4 years agoSession should not be accessed when not there.
Len Ovens [Wed, 6 Nov 2019 16:27:21 +0000 (08:27 -0800)]
Session should not be accessed when not there.

4 years agoremove debug message
Paul Davis [Wed, 6 Nov 2019 16:28:23 +0000 (09:28 -0700)]
remove debug message

4 years agomove at-exit messages about pool utilization to DEBUG_TRACE
Paul Davis [Wed, 6 Nov 2019 16:27:49 +0000 (09:27 -0700)]
move at-exit messages about pool utilization to DEBUG_TRACE

4 years agoresolved notes need to use cycle-relative time
Paul Davis [Wed, 6 Nov 2019 16:07:12 +0000 (09:07 -0700)]
resolved notes need to use cycle-relative time

4 years agobe sure to move effective_start while loop-reading MIDI
Paul Davis [Wed, 6 Nov 2019 16:03:55 +0000 (09:03 -0700)]
be sure to move effective_start while loop-reading MIDI

4 years agofix DiskReader::get_midi_playback() when looping
Paul Davis [Wed, 6 Nov 2019 15:58:09 +0000 (08:58 -0700)]
fix DiskReader::get_midi_playback() when looping

Although at the Session level we never run "through" the loop end,
latency compensation means that that start/end sample values passed to
Processor::run() may cross the loop end. Fix how we handle this so
that we do not read data from after the end of the loop

4 years agoimprove comment about warning message
Paul Davis [Wed, 6 Nov 2019 15:56:50 +0000 (08:56 -0700)]
improve comment about warning message

4 years agofix a bad transition in the transportFSM.
Paul Davis [Mon, 4 Nov 2019 21:35:18 +0000 (14:35 -0700)]
fix a bad transition in the transportFSM.

4 years agoavoid use of Port::port_offset() everywhere except Port::flush_buffers() and Port...
Paul Davis [Mon, 4 Nov 2019 19:57:19 +0000 (12:57 -0700)]
avoid use of Port::port_offset() everywhere except Port::flush_buffers() and Port::get_buffer()

Split cycles are run as if they are an entire self-contained cycle, starting at zero and running for "nframes".

We adjust the timing and position of data only when retrieving and writing it to Port buffers.

4 years agorename method argument to better reflect its intended role
Paul Davis [Mon, 4 Nov 2019 19:52:34 +0000 (12:52 -0700)]
rename method argument to better reflect its intended role

4 years agowhen resolving notes for a locate, use zero as the timestamp, not the current Port...
Paul Davis [Sun, 3 Nov 2019 17:55:47 +0000 (10:55 -0700)]
when resolving notes for a locate, use zero as the timestamp, not the current Port::port_offset()

All _immediate_events data gets written to the output buffer at the end of the current (split) cycle anyway, so the
timestamp is irrelevant (as long as it is zero, and will therefore be read by ::snapshot_out_of_band_data()

4 years agoVirtual-keyboard: momentary pedal (no toggle)
Robin Gareus [Sun, 3 Nov 2019 16:48:36 +0000 (17:48 +0100)]
Virtual-keyboard: momentary pedal (no toggle)

4 years agoanother notable cleanup/simplification of DiskReader's MIDI handling
Paul Davis [Sun, 3 Nov 2019 16:20:50 +0000 (09:20 -0700)]
another notable cleanup/simplification of DiskReader's MIDI handling

Note that we resolve notes from the tracker directly into the output buffer. This happens
after an edit causes a buffer overwrite

4 years agocomment fix
Paul Davis [Sun, 3 Nov 2019 16:20:00 +0000 (09:20 -0700)]
comment fix

4 years agoimmediate events time reference for zero is the start of the run() cycle, not absolut...
Paul Davis [Sun, 3 Nov 2019 14:58:28 +0000 (07:58 -0700)]
immediate events time reference for zero is the start of the run() cycle, not absolute sample time

4 years agoCorrectly flush MIDI buffers on cycle-split
Robin Gareus [Sun, 3 Nov 2019 14:18:04 +0000 (15:18 +0100)]
Correctly flush MIDI buffers on cycle-split

4 years agoClarify MIDI-port event-timestamp debug-message
Robin Gareus [Sun, 3 Nov 2019 14:02:00 +0000 (15:02 +0100)]
Clarify MIDI-port event-timestamp debug-message

4 years agoFix timecode generation after split-cycles
Robin Gareus [Sun, 3 Nov 2019 13:42:10 +0000 (14:42 +0100)]
Fix timecode generation after split-cycles

4 years agoAdd/remove source(s) in our MSVC project (libardour)
John Emmas [Sun, 3 Nov 2019 13:45:24 +0000 (13:45 +0000)]
Add/remove source(s) in our MSVC project (libardour)

4 years agoAccommodate some recently moved/renamed folders and source files (libevoral)
John Emmas [Sun, 3 Nov 2019 13:42:21 +0000 (13:42 +0000)]
Accommodate some recently moved/renamed folders and source files (libevoral)

4 years agoFix build -- 'printf' was not declared in this scope
Robin Gareus [Sun, 3 Nov 2019 13:15:11 +0000 (14:15 +0100)]
Fix build -- 'printf' was not declared in this scope

4 years agoFix compiler warning
Robin Gareus [Sun, 3 Nov 2019 03:11:43 +0000 (04:11 +0100)]
Fix compiler warning

4 years agofor now, show how long MIDI rendering takes
Paul Davis [Sun, 3 Nov 2019 01:35:35 +0000 (19:35 -0600)]
for now, show how long MIDI rendering takes