fillmaster / fillMaster

FillMaster: A drum idea generator / improvisation trainer! - Open Source, always looking for more contributors :)
https://fillmaster.app/
GNU General Public License v3.0
31 stars 7 forks source link

Bug: No error handling for setCustomSettingsForPattern #10

Open dcallus opened 2 years ago

dcallus commented 2 years ago

setCustomSettingsForPattern in the patternMaker.ts file needs error handling.

  1. When you have a beat higher than the beatsPerBar
  2. When you have a subBeat higher than the current subdivision -1. The -1 is necessary because [0, 1, 2, 3] would be your options for ['1', 'e', '&', 'a'] with a subdivision of 4.

Add some tests to make sure an error is being thrown.

dcallus commented 2 years ago

done

dcallus commented 2 years ago

Re-opened as I've had to comment this error checking out at the class level.

There is no way to select a fill start beat too high (compared with beats per bar) on the UI, so it is currently safe. But this should be checked on the class level too.

Unfortunately there seems to be some sort of race condition where the error will throw even before the correct beat start is updated.