Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume increases when transport.loopStart and player.start are set to same time #1175

Open
EagleSplash opened this issue Mar 16, 2023 · 2 comments

Comments

@EagleSplash
Copy link

The code below will consistently trigger a large, unexpected volume increase. Everything starts out fine, but when the transport loops for the first time the volume goes up significantly.

The issue only happens when the player.start and transport.loopStart are set to the same value or values that are < 0.002 seconds apart. It only happens when certain values are used - other values do NOT cause this problem. Test values are listed in code below. The problem is repeatable in Chrome and MS Edge.

Tested 3/16/2023 (Windows 11 desktop)

  • Chrome Version 111.0.5563.65 (Official Build) (64-bit)
  • Microsoft Edge Version 111.0.1661.41 (Official build) (64-bit)
<head>	
    <script src="http://unpkg.com/tone"></script>
    <script>

    async function test() {
        await Tone.start();
        console.log("Audio context started");

        player_Melody = new Tone.Player({onload: () => console.log("player_Melody loaded")}).toDestination();
        player_Melody.sync();
        await player_Melody.load("https://tonejs.github.io/audio/loop/FWDL.mp3");

        // Start_Time values that cause error...
        // 1.8333
        // 1.84

        // Start_Time values that DO NOT cause error...
        // 0
        // 1.8
        // 1.8334

        let Start_Time = 1.8333;

        player_Melody.start(Start_Time, 0, 5);
        Tone.Transport.setLoopPoints(Start_Time, 5);

        Tone.Transport.loop = true;

        Tone.Transport.start("+0.1", 0);
        console.log("Audio playing - first 2 seconds are silence")
    }
    
    </script>
</head>

<body>
    <button onclick="test()">Click to Play MP3 Loop</button>
</body>
@EagleSplash
Copy link
Author

I'm also getting the same problem when using the "0:0:0" time format...
Tone.Transport.bpm.value = 180;
Tone.Transport.timeSignature = [6, 8];
Start_Time = "0:0:22";

@EagleSplash
Copy link
Author

I'm wondering if this issue is the same as/related to other reported issues:

#999
#944
#1098
#1080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant