Fix incorrect hat logic; add support for first barline omission

This commit is contained in:
Dean Herbert 2019-12-16 18:57:11 +09:00
parent 0f9ff32cdc
commit 210fecc951
1 changed files with 16 additions and 8 deletions

View File

@ -84,17 +84,25 @@ protected override void OnNewBeat(int beatIndex, TimingControlPoint timingPoint,
if (!firstBeat.HasValue || beatIndex < firstBeat)
firstBeat = Math.Max(0, (beatIndex / 16 + 1) * 16);
if (beatIndex > firstBeat)
if (beatIndex >= firstBeat)
{
if (beatIndex % 16 == 0)
if (beatIndex % 16 == 0 && (beatIndex > firstBeat || !effectPoint.OmitFirstBarLine))
finishSample?.Play();
if (beatIndex % 2 == 0)
kickSample?.Play();
else if (beatIndex % 2 == 1)
clapSample?.Play();
else
hatSample?.Play();
switch (beatIndex % (int)timingPoint.TimeSignature)
{
case 0:
kickSample?.Play();
break;
case 2:
clapSample?.Play();
break;
default:
hatSample?.Play();
break;
}
}
}
}