Skip to content

Commit

Permalink
Fix minor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gcgbarbosa committed May 14, 2023
1 parent 8ea24e0 commit 23d13fe
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ import * as Tone from 'tone'


export default function Home() {

const [action, setAction] = useState("Welcome :)");

useEffect(() => {
const synth = new Tone.Synth().toDestination();
Tone.Transport.start();

let animation = anime.timeline({
easing: 'linear',
Expand All @@ -25,8 +28,7 @@ export default function Home() {
fill: '#FF0000',
changeBegin: function() {
//play a middle 'C' for the duration of an 8th note
const synth = new Tone.Synth().toDestination();
synth.triggerAttackRelease("C4", "8n");
synth.triggerAttackRelease("C4", '8n', Tone.Transport.now());
setAction("Breathe IN")
},
})
Expand All @@ -38,8 +40,7 @@ export default function Home() {
duration: 12000,
fill: '#33CC33',
changeBegin: function() {
const synth = new Tone.Synth().toDestination();
synth.triggerAttackRelease("E4", "8n");
synth.triggerAttackRelease("E4", '8n', Tone.Transport.now());
setAction("Breathe OUT")
},
});
Expand Down

1 comment on commit 23d13fe

@vercel
Copy link

@vercel vercel bot commented on 23d13fe May 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.