Commit graph

809 commits

Author SHA1 Message Date
Robin Gareus
1c3cc95b3b
Fix optimized bilds 2025-11-18 18:30:09 +01:00
Paul Davis
65332e603b libsmf: speed up ridiculous design of smf_save()
This would realloc a buffer for every event, making it absurdly slow for
large MIDI files (say, 10k events). Use the somewhat standard heuristic
of doubling the requested allocation every time we need to increase the size.

This results in a speedup of 40-100x when saving SMF to disk
2025-11-17 16:05:03 -07:00
Paul Davis
662d1b9e46 NO-OP: fix commented printf of MIDI data 2025-11-17 16:05:03 -07:00
Paul Davis
2c7841777b Evoral: more useful output if there's an illega MIDI event sent to SMF or Sequence 2025-11-17 16:05:03 -07:00
Paul Davis
637f22508b Evoral::Sequence: tweak DEBUG_TRACE messages during note removal 2025-10-31 13:24:35 -06:00
Robin Gareus
78677b672c
Copy more mingw branches for MSVC 2025-10-22 18:48:40 +02:00
Paul Davis
bea740e634 Evoral testing requires Temporal::reset()
We might roll superclock initialization into Temporal::init()
2025-10-09 10:58:57 -06:00
Paul Davis
05210fc7e2 Evoral: add ControlList::has_event_at (timepos_t) 2025-08-21 18:56:00 -06:00
Paul Davis
c49f607ce6 slightly refine SMF::is_meta() to differentiate realtime system reset 2025-08-18 16:35:41 -06:00
Paul Davis
73065f814a modify API of Evoral::SMF::append_event_beats() to add meta-event legality
If the (new) final argument is true, we allow writing SMF meta events to the
underlying libsmf object (which doesn't care one way or another).
2025-08-18 16:35:41 -06:00
Paul Davis
b60702e014 add Evoral::SMF::end_track()
This changes the assumption that an SMF object only refers to
a single track when being written.

::end_track() is used within begin::write()/end_write() pairs to mark the start
of a new SMF track.
2025-08-18 16:35:41 -06:00
Paul Davis
785047bf47 add Evoral::SMF::is_meta() to test for SMF meta events
These are not legal in "live" MIDI but are allowed in SMF files.
2025-08-18 16:35:41 -06:00
Paul Davis
e703cf2d73 use nullptr instead of zero in initializer 2025-08-18 16:35:41 -06:00
Paul Davis
a22a84cbee SMF: return meta events, with size set to event size, but return value of zero 2025-08-18 12:47:26 -06:00
Paul Davis
b5f1c5b0dd Fix potential infinite loop when iterating over ControlLists
If you have the "wrong" kind of MIDI CC, the interpolation for the list is set
to Linear, which causes interpolation to return audio time stamps instead of
beat time.  Because of the asymmetrical transforms, this causes iterators over
the Sequence to go haywire and create an infinite loop.

This fix changes ControlList behavior to always return times in the time domain
of the list.
2025-08-07 12:49:18 -06:00
Paul Davis
60d8e1b817 SMF: use new TempoMap::smf_*() API to build tempo map from smf info 2025-08-05 11:37:35 -06:00
Paul Davis
59f58946a9 correct math for setting SMF-imported tempo/meter positions 2025-07-30 22:17:33 -06:00
Paul Davis
4ee709af7b libardour APIs for Sequence::shift (timepos_t const &)
A way to move all MIDI data in a Sequence later in time.

This is likely not finished, and may need a new signal for
notifications
2025-04-05 17:25:03 -06:00
Paul Davis
fd890b4891 evoral: add Sequence::channels_present() 2025-03-08 17:56:44 -07:00
Paul Davis
cee0b498e9 NO-OP: braces, please 2025-03-08 17:30:29 -07:00
Paul Davis
3ce789dc4c add ::duration_is_explicit() to SMF 2025-02-28 16:49:48 -07:00
Paul Davis
efcb26d7c1 add smf_length_is_explicit() to libsmf 2025-02-28 16:49:15 -07:00
Alejandro Domínguez
fa57d5ed86
Disambiguate std and boost placeholder 2024-11-17 20:20:23 +01:00
Paul Davis
c0c9d79325 remove Evoral::Sequence::overlaps{_unlocked} (). Not used anywhere 2024-10-31 12:22:35 -06:00
Paul Davis
883ec6aa68 NO-OP: misc whitespace adjustments 2024-10-31 12:22:35 -06:00
Paul Davis
39661732c3 modify how Evoral::SMF (maybe) writes an EOT event into an SMF
every write pass deletes existing tracks, which means it also deletes any existing
EOT event. Rather than try to replicate the _length value() that is kept in a
Source object in the SMF object, add a virtual method to SMF that returns
the _length value (or std::numeric_limits<Beats>::max() if not set).

If the _length value is not the max, we will add EOT events to each track
(usually just one) right before writing to disk.
2024-10-31 12:22:35 -06:00
Paul Davis
ebcc6b8250 add the concept of a length that is data-independent to MIDI files (libs) 2024-10-31 12:22:35 -06:00
Paul Davis
9ed9567b43 Evoral: add new is_xxxx() methods for various MIDI events, including is_realtime() 2024-10-31 12:22:35 -06:00
Paul Davis
aa2fb8c1d4 SMF: add a set_length() method which will place TrkEnd meta-events 2024-10-22 14:49:50 -06:00
Mads Kiilerich
b4ff4f356c Make header files more self-contained - add missing Ardour and lib includes 2024-10-20 03:30:46 +02:00
Mads Kiilerich
955e634371 Make header files more self-contained - add missing std includes 2024-10-20 03:11:53 +02:00
Mads Kiilerich
8a5f21d8e3 Drop some unused files - avoid trying to maintain stuff that can't be tested 2024-10-20 03:11:53 +02:00
Robin Gareus
74c4ca3e52
Reduce reliance on boost - the hard part
the rest from `tools/convert_boost.sh`.

* replace boost::function, boost::bind with std::function and std::bind.

This required some manual fixes, notably std::placeholders,
some static_casts<>, and boost::function::clear -> = {}.
2024-10-19 03:47:21 +02:00
Alejandro Domínguez
2436b4df06
Replace boost::noncopyable with C++11 deleted copy constructors 2024-10-19 01:04:15 +02:00
Robin Gareus
2d7cce44f1
Replace PBD::Signals (1/2) 2024-10-18 20:41:08 +02:00
Paul Davis
75f56cd3e1 the great onceification (libs)
Replace use of #ifndef header guards with #pragma once

Modern C++, baby!
2024-10-17 07:44:31 -06:00
Paul Davis
5da8de05ca NO-OP: internal whitespace and newline cleanup 2024-10-17 07:44:30 -06:00
Paul Davis
b35b30c230 factor out code to extract a TempoMap from an SMF 2024-10-17 07:44:29 -06:00
Alejandro Domínguez
1752f30a66
Remove #include <boost/utility.hpp> 2024-08-29 23:08:42 +02:00
Robin Gareus
5a647cd84a Fix guard point logic for editor_add_ordered API.
Previously the code was too simple and potentially added points out of
order, leading to automation jumping back in time.
2024-07-12 00:45:37 +02:00
Robin Gareus
1cd78c94d3
Improve doxygen's main page, add references 2024-05-28 01:00:42 +02:00
Robin Gareus
ab62177bdf
Fix incomplete doxygen doc (libardour) 2024-05-27 22:21:57 +02:00
Paul Davis
15eae21c37 fix failure to record MIDI notes that are already on when capture starts 2024-02-18 19:31:19 -07:00
Robin Gareus
1306a698a7
Sanitize MIDI track names, remove unprintable chars #9553 2023-11-28 00:29:19 +01:00
Robin Gareus
3ce2cf937e
Revert "wscript: drop unnecessary str() on configure variables"
This reverts commit 615326be9b because it
breaks windows builds.

```
File "/home/ardour/ardour-w64/wscript", line 1462, in configure
  set_compiler_flags (conf, Options.options)
File "/home/ardour/ardour-w64/wscript", line 522, in set_compiler_flags
  if re.search ('x86_64-w64', conf.env['CC']) is not None:
File "/usr/lib/python2.7/re.py", line 146, in search
  return _compile(pattern, flags).search(string)
TypeError: expected string or buffer
```
2023-10-16 21:15:25 +02:00
Mads Kiilerich
615326be9b wscript: drop unnecessary str() on configure variables
CC is already set to a string. (And if it ever should be None, we want
to handle that explicitly.)

(And #autowaf.display_msg handle Booleans just fine.)
2023-10-15 10:47:16 -06:00
Mads Kiilerich
8fea606b32 wscript: drop APPNAME assignment in libs
https://waf.io/book/ says
  By default, the project name and version are set to noname and 1.0. To
  change them, it is necessary to provide two additional variables in
  the top-level project file

- and waf code inspection confirms that waf itself only will use the top
level APPNAME.
2023-10-15 10:47:16 -06:00
Mads Kiilerich
88cecdfaef wscript: drop repeated autowaf.set_options - it is enough to set at top level 2023-10-15 10:47:16 -06:00
Mads Kiilerich
1c686f4d63 wscript: drop additional configure statements already present in the top level wscript
Missed in 8bb91099c5.
2023-10-15 10:47:16 -06:00
Mads Kiilerich
d220f477ed wscript: drop unused "mandatory variables" 'top' and 'out' in libs
Variables by these names are only used from the local wscript and when
running "waf configure", which already for other reasons only can run at
the top-level.

These variables are thus not mandatory and not used.
2023-09-17 07:34:55 -06:00