mirror of
https://github.com/dredozubov/polyrhythmix.git
synced 2024-11-22 11:57:43 +00:00
Fix: bass tracks with -B now has correct length
This commit is contained in:
parent
a5f5694a78
commit
352f79a03f
1 changed files with 3 additions and 1 deletions
|
@ -985,6 +985,7 @@ fn create_tracks<'a>(
|
||||||
add_bass: bool
|
add_bass: bool
|
||||||
) -> Vec<Vec<midly::TrackEvent<'a>>> {
|
) -> Vec<Vec<midly::TrackEvent<'a>>> {
|
||||||
let events_iter = merge_into_iterator(&parts_and_groups, time_signature);
|
let events_iter = merge_into_iterator(&parts_and_groups, time_signature);
|
||||||
|
let bars = events_iter.bars.clone();
|
||||||
let events: Vec<Event<Tick>> = events_iter.collect();
|
let events: Vec<Event<Tick>> = events_iter.collect();
|
||||||
|
|
||||||
let track_time = match events.last() {
|
let track_time = match events.last() {
|
||||||
|
@ -1093,7 +1094,8 @@ fn create_tracks<'a>(
|
||||||
delta: 0.into(),
|
delta: 0.into(),
|
||||||
kind: TrackEventKind::Meta(MetaMessage::InstrumentName(b"Bass")),
|
kind: TrackEventKind::Meta(MetaMessage::InstrumentName(b"Bass")),
|
||||||
});
|
});
|
||||||
map_notes(bass.to_delta(), &mut bass_track);
|
let times = bars * time_signature.to_128th() / kick.to_128th();
|
||||||
|
map_notes(concat_grid(bass, Times(times as u16)).to_delta(), &mut bass_track);
|
||||||
vec![drums_track, bass_track]
|
vec![drums_track, bass_track]
|
||||||
} else {
|
} else {
|
||||||
vec![drums_track]
|
vec![drums_track]
|
||||||
|
|
Loading…
Reference in a new issue