# Block size does not match after tempo adjustment

**URL:** <https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328>\
**Category:** Tracktion Engine\
**Created:** [February 23, 2025, 10:06am UTC](https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328 "2025-02-23T10:06:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [February 23, 2025, 10:06am UTC](https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328/1 "2025-02-23T10:06:16Z")

</div>

Hey,

I thought i’d open a new thread that was more descriptive of the issue i’m having to help others who may be searching for a similar topic.

Following on from my _[previous thread](https://forum.juce.com/t/creating-a-basic-rack-and-adding-to-master-track/65035)_:

When I make a tempo adjustment using ‘setTempoAdjustment’ on the playback context, the number of samples not longer matches the block size of my destination audio.

e.g. if I set the tempo adjustment to 80%, the number of samples is 80% of the block size.

Using setSpeedCompensation works (but can not stretch the time enough for my needs) I assume because it’s resampling.

How can i adjust the tempo? I don’t want to maintain the original pitch, I want it to sound slowed down/sped up.

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [February 24, 2025, 5:18pm UTC](https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328/2 "2025-02-24T17:18:11Z")

</div>

Also for those interested, this is the repository for my application:

> **[GitHub - botoxparty/chopshop: A workstation for chopped & screwed music. Create...](https://github.com/botoxparty/chopshop)**
>
> A workstation for chopped & screwed music. Create your own chopped & screwed edits.

This time stretch issue is the last thing I need to fix before I can start testing it with some beta users I have. If anyone else likes Chopped & Screwed and wants a copy of the binaries when theyr’e released then contact me or write in this thread 🙂

---

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [February 24, 2025, 9:28pm UTC](https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328/3 "2025-02-24T21:28:18Z")

</div>

Sorry, I haven’t forgotten this, I’m just a bit swamped with work and the C++Online conference coming up this week.

Both of these settings aren’t meant for large adjustments, they’re just for chasing a MIDI clock so only speed up/down a few samples per block to keep things in time.

Are you doing this dynamically or just setting it once and pressing play? Is there any reason you’re not directly setting the clip properties to do this?

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [February 24, 2025, 10:17pm UTC](https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328/4 "2025-02-24T22:17:24Z")

</div>

No problem, sorry if you feel pressured, i’m just actively working on this and sharing my progress on the issue publicly.

The speed is controlled dynamically. It can be set at any time during playback, and there is a Vinyl Brake effect that modifies the playback speed as you apply the effect.

I am not directly setting the clip properties for the following reasons:

- My application is basically 2 tracks with the same clip, 1 beat apart.
- The distance is maintained between the clips automatically if i adjust the tempo of the transport rather than the clips.
- The playhead is automatically synced to the clip in the thumbnail if the tempo is adjusted.
- I will eventually be adding automation recording for the effects. All the timing issues will be managed automatically if the master tempo is adjusted vs. clip is stretched.

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [February 25, 2025, 9:21pm UTC](https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328/5 "2025-02-25T21:21:34Z")

</div>

By changing the limit for the setSpeedCompensation function from 10% to 100% I have been able to achieve the sound i’m looking for.

---

<div class="post-metadata">

**Author:** ![dave96](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/dave96/32/8487_2.png) [@dave96](https://forum.juce.com/u/dave96)\
**Post date:** [February 26, 2025, 11:28am UTC](https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328/6 "2025-02-26T11:28:09Z")

</div>

Ok, glad that works for you.

---

<div class="post-metadata">

**Author:** ![botoxparty](https://avatars.discourse-cdn.com/v4/letter/b/e274bd/32.png) [@botoxparty](https://forum.juce.com/u/botoxparty)\
**Post date:** [March 1, 2025, 6:27pm UTC](https://forum.juce.com/t/block-size-does-not-match-after-tempo-adjustment/65328/7 "2025-03-01T18:27:22Z")

</div>

So pushing on further with other features that use time manipulation (like DJ scratching) in my application I just hit other walls.

I investigated further into your suggestion to use the time stretching on clips and discovered the TempoSequence class!

This has solved all of my previous timing issues! A lot of work left to do but just sharing my progress and solution.
