Skip to content

Commit

Permalink
[FIX] Clear note
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarrc committed Nov 26, 2022
1 parent e742ffe commit a74d848
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/controls/SeqInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const SeqInput = ({label, value, options, validation, min, max, onChange, classN
const handleValidation = (val) => {
if(!validation) return;
const regex = new RegExp(validation, 'g');
!regex.test(val) && onChange('---')
!regex.test(val) && onChange()
}

return (
Expand Down
10 changes: 5 additions & 5 deletions src/components/layout/Display.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ const Display = () => {

const playStep = useCallback((step) => {
let duration = step.length * 60000/tempo;


if(!step?.note) return;
if(!isNaN(step?.bank) && step.bank !== bank) {
let b = JSON.stringify(localStorage.getItem(`BANK_${step.bank}`))
let b = JSON.parse(localStorage.getItem(`BANK_${step.bank}`))
if(!b) return;

Object.keys(b).forEach(cc => sendControlChange(parseInt(cc), b[cc]));
Object.keys(b).forEach(cc => sendControlChange(parseInt(cc), b[cc]));
};

playNote(step.note, true, false, duration);
Expand Down Expand Up @@ -99,7 +99,7 @@ const Display = () => {
<div className={`text-right relative before:inline-block before:bg-accent before:rounded-full before:mb-0.5 before:mr-1 before:w-2 before:h-2 ${ bpmIndicator ? 'before:opacity-1': 'before:opacity-0'}`}>{tempo} BPM</div>
</div>
{
!message ?
message ?
<Message message={message} /> :
<Sequencer
step={step}
Expand Down

0 comments on commit a74d848

Please sign in to comment.