Skip to content

Commit

Permalink
[quantification] Improve quant algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Nov 3, 2024
1 parent 36ce533 commit 1900cb9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/halp/audio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,11 @@ struct tick_musical

if(start_quant != end_quant)
{
if(end_quant == end_quarter * musical_quant_dur)
{
// We want quantization on start, not on end
return {};
}
// Date to quantify is the next one :
const double musical_tick_duration
= this->end_position_in_quarters - this->start_position_in_quarters;
Expand All @@ -370,8 +375,7 @@ struct tick_musical
}
}
}
else if(
this->start_position_in_quarters == 0. && this->end_position_in_quarters > 0.)
else if(start_quant == start_quarter * musical_quant_dur)
{
// Special first bar case
return {{0, 1}};
Expand Down

0 comments on commit 1900cb9

Please sign in to comment.