Skip to content

Commit 34b3ecc

Browse files
Fixed overlapping notes in simple tuplet block; reused noteBeatValue without introducing new variables
1 parent bb87db1 commit 34b3ecc

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

js/blocks/RhythmBlockPaletteBlocks.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -941,8 +941,8 @@ function setupRhythmBlockPaletteBlocks(activity) {
941941
arg1 = args[1];
942942
}
943943

944-
const totalDuration = (1 / arg1) * activity.turtles.ithTurtle(turtle).singer.beatFactor;
945-
const noteBeatValue = totalDuration / arg0;
944+
const noteBeatValue = (1 / arg1) * activity.turtles.ithTurtle(turtle).singer.beatFactor;
945+
946946
if (logo.inMatrix || logo.tuplet) {
947947
logo.phraseMaker.addColBlock(blk, arg0);
948948
if (logo.tuplet) {
@@ -975,10 +975,9 @@ function setupRhythmBlockPaletteBlocks(activity) {
975975

976976
tur.singer.inNoteBlock.push(blk);
977977

978-
const bpmFactor =
979-
TONEBPM / tur.singer.bpm.length > 0 ? last(tur.singer.bpm) : Singer.masterBPM;
978+
const bpmFactor = TONEBPM / tur.singer.bpm.length > 0 ? last(tur.singer.bpm) : Singer.masterBPM;
980979

981-
const beatValue = noteBeatValue;
980+
const beatValue = (noteBeatValue / arg0) * (TONEBPM / bpmFactor);
982981

983982
const __rhythmPlayNote = (thisBeat, blk, turtle, callback, timeout) => {
984983
setTimeout(
@@ -996,9 +995,7 @@ function setupRhythmBlockPaletteBlocks(activity) {
996995
};
997996
} else {
998997
__callback = null;
999-
}
1000-
1001-
const delay = i * beatValue * 1000;
998+
}
1002999

10031000
__rhythmPlayNote(
10041001
noteBeatValue,

0 commit comments

Comments
 (0)