13
0
Commit Graph

12 Commits

Author SHA1 Message Date
0457646387
Allow to scan midi file during file read
This partially reverts eced764480. In many places Ardour uses
SMF directly, without loading the MIDI model in a libardour SMFSource.

In this case no information (track, channel-count) was available,
after eced764480, and worse various members were not initialized
and showed random numbers.

This fixes various import options.
2022-09-25 02:46:09 +02:00
0d70be3a05 miscellaneous fixes for warnings from -Wconversion 2022-07-04 22:01:48 -06:00
eced764480 smf_source: implement SMF::UsedChannels as a bitset; move midi screening into load_model()
we screen midi files for some aggregate info:
 used channels, used patches, and note-count

you can't do this from open() because there are cases (after importing)
 when the source exists but it is not yet written to disk
2022-03-01 10:11:14 -06:00
207ad2d369
Add API to query SMF note-count and pgm-changes
This information is useful for trigger-clips, in particular
if the file can change synth-settings via patch-changes.
2022-02-05 17:33:21 +01:00
12e8235193
Add API to query set of used MIDI channels in a SMF 2022-02-05 00:13:27 +01:00
0733b2d9e2 SMF: Often files don't have Track+Instr names. Make something up to avoid file collisions. 2021-11-13 15:54:11 -06:00
35312dc85c SMF: API change: report format (0,1 or2) and total channels used 2021-11-13 15:54:11 -06:00
c45be2266e support SMF markers without labels 2021-05-09 17:52:29 -06:00
f689e9ecab Evoral: add methods to SMF to load and access markers/cues in SMF files 2021-05-07 14:58:16 -06:00
c6b87972b1
Remove unused libsmf seconds/time API
This significantly speeds up parsing MIDI files with complex
tempo-maps. e.g. "Black MIDI Trilogy_2.mid" has 24134 Tempo
changes. Prior to this commit parsing that file took over 5 minutes.
now it loads in under one seconds (libsmf only; libardour still
add overhead, and now needs about 30-40 seconds, previously
it took about 10 mins).

The problem was that every call to `smf_track_add_event_pulses()`
calls `seconds_from_pulses()` which calls `smf_get_tempo_by_seconds()`
which iterates over the tempo-map:

  for every midi-event { for ever tempo until that midi-event {..} }

This does not scale to 3.5M events and 24k tempo-changes.
2020-07-16 18:38:03 +02:00
44bca6cc8f
Fix memory leak when reading MIDI files 2020-05-22 01:29:25 +02:00
eaae38ba84 move evoral/src/* to evoral/ 2019-11-02 16:32:18 -06:00