[Audio] New! Time-stretching and sample-stretching

MusE is a DAW for Linux with both MIDI and Audio editing. https://muse-sequencer.github.io

Moderators: MattKingUSA, khz, spamatica

Post Reply
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

[Audio] New! Time-stretching and sample-stretching

Post by Tim E. Real »

Happy new year everyone. I've merged my time-stretching branch into git master, after a very long wait.

It automatically installs live sample rate converters when importing audio files at any sample rate.
It automatically works when loading a project with a sample rate different than the system sample rate.
It allows you to further modify the samplerate map, per wave, using special markers.
It allows you to also stretch or squish the audio without changing pitch, using special markers.

There is much more to be done. Pitch. Part stretching. Tempo etc. Ultimately Wave Parts would be allowed to be in
units of BBTs instead of frames. That means the wave parts would stay where they are just like midi parts, when tempo is changed.

I needed to get this out of the eight-year-old branch and into master. Merging from master all the time was a nightmare.
Anyway try 'er out. I'm sure there will be questions and possible angry pitchfork and torch waving mobs. Cheers.

Here you see the two types of 'stretch' markers along with two new tool buttons :
wave ed audio convert 1.jpg
wave ed audio convert 1.jpg (53.06 KiB) Viewed 980 times
Here you see the default global settings. Note that each wave has it's own local override settings,
accessible via right-click context menu in the Wave Editor:
wave ed audio convert settings 1.jpg
wave ed audio convert settings 1.jpg (46.98 KiB) Viewed 980 times
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: [Audio] New! Time-stretching and sample-stretching

Post by Tim E. Real »

Some further info:
Install RubberBand developer packages or build it, of course.

My system uses a custom streaming 'plugin' system.
Each of the SRC, RubberBand, and Zita converters you see in the list above is an actual plugin dynamic .so library.
The ones shown need not be the only ones listed. More can be made.
Plugins are 'discoverable' by MusE at startup.

My goal with that was to be ready to relatively easily support other types of conversion libraries.
Especially high-quality commercial libraries. I have been looking a few for some time.
I made a well-defined framework and API and completely isolated and separate dynamic library system,
rather than directly embedding support for each library right into the core code.
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: [Audio] New! Time-stretching and sample-stretching

Post by Tim E. Real »

Did you know:

Before these fixes, if you run the audio system at a sample rate other than 44100Hz,
the metronome's fixed 44100Hz audio samples are not correct ! Try it, at say 96000Hz and see for yourself.

With these fixes, the metronome samples are automatically converted once at startup, or when changing the sample sounds,
and they sound correct at any system sample rate.
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: [Audio] New! Time-stretching and sample-stretching

Post by Tim E. Real »

How to use the new markers:

The two types of markers are placed and manipulated by selecting one of the two new tool buttons: Time-stretch and samplerate-stretch.
One stretches the audio without changing pitch, and the other alters samplerate which stretches AND changes pitch.
(A separate pitch-shift control which does not stretch is coming...)
Both types of markers are allowed at once on the canvas. To manipulate (select, move, del etc) each marker type,
the corresponding tool button for that marker type must be engaged.

To delete a marker select it and press the Del key.

You can place one marker and move it around, but you'll notice that all the content to the left and right
of the marker squishes or stretches.
So usually, to repair or work with a small portion of the audio for example, you'll want three stretch markers.
First, place a stretch marker to the left and the right of the desired portion, and don't touch them - don't move them,
otherwise content to the left and right of these two markers will change and you don't want that.
Then, place a third stretch marker somewhere between the two left and right markers.
You will manipulate and move this third marker left or right so that only audio between the left and right markers changes.

It offers a way to correct mis-timed passages smoothly instead of cut-and-paste which could cause a 'click' in the sound.
User avatar
oscillator
Established Member
Posts: 1127
Joined: Sat Jan 17, 2015 6:07 pm
Location: SWEDEN
Has thanked: 725 times
Been thanked: 296 times
Contact:

Re: [Audio] New! Time-stretching and sample-stretching

Post by oscillator »

Cool! Thanks a lot Tim!

MusE DAW running on Debian 11 Testing/XFCE4.
https://oscillator.se/musik

Post Reply