nothing important

This commit is contained in:
Clément Le Bihan
2024-01-04 15:30:05 +01:00
parent 4923fc72b2
commit 0db8d49618

View File

@@ -104,7 +104,7 @@ const PartitionMagic = ({
} }
}, [ }, [
() => { () => {
pianoSounds.current?.forEach((sound) => { pianoSounds?.current?.forEach((sound) => {
sound.release(); sound.release();
}); });
}, },
@@ -144,7 +144,6 @@ const PartitionMagic = ({
cursor.notes.forEach(({ note, duration }) => { cursor.notes.forEach(({ note, duration }) => {
try { try {
const sound = pianoSounds.current![note]!; const sound = pianoSounds.current![note]!;
// sound.playAsync().catch(console.error);
sound.play((success) => { sound.play((success) => {
if (!success) { if (!success) {
console.log('Sound did not play'); console.log('Sound did not play');
@@ -152,19 +151,19 @@ const PartitionMagic = ({
}); });
setTimeout(() => { setTimeout(() => {
sound.stop(); sound.stop();
}, duration); }, duration - 10);
} catch (e) { } catch (e) {
console.log('Error key: ', note, e); console.log('Error key: ', note, e);
} }
}); });
} }
// partitionOffset.value = withTiming( partitionOffset.value = withTiming(
// -(cursor.x - data!.cursors[0]!.x) / partitionDims[0], -(cursor.x - data!.cursors[0]!.x) / partitionDims[0],
// { {
// duration: transitionDuration, duration: transitionDuration,
// easing: Easing.inOut(Easing.ease), easing: Easing.inOut(Easing.ease),
// } }
// ); );
} }
); );