Drum Loop in a Pattern - keep tempo and pitch unchanged (newbie question)

Started by Abrimaal, January 26, 2025, 22:57:46

Previous topic - Next topic

Abrimaal

Hello,

I have just started to compose the first song with Open MPT, after a few attempts of remixing sample songs.

I imported a drum Loop as a sample.
in the sample editor it is playing correctly, at the same speed and pitch as the original.
Playing time (total length) matches the original audio file.

01 imported drum Loop as a sample - it is playing at correct speed and pitch.png

Added the whole sample as the first note in the first pattern.
The sample is playing at different speed and pitch
also
The sample length is longer than the pattern.

I added one more pattern, but the sample is silenced when the new pattern begins.

02 added as first note to first pattern - playing at different tempo and pitch.png

Exported to .wav and compared the original Loop and the exported file in an Audio Mixer.
Different speed, different pitch, trimmed (cropped)

04 exported different speed and pitch.png

My question:
(How) can I setup the pattern editor to
- adjust playing time of a single pattern to the sample playing time?
- keep pitch and speed unchanged?


When I change note value, eg. from F4 to F7, the sample is played at a quite different speed and pitch.

Is a drum Loop usable as a sample? Or can I use only single instrument samples (they work perfectly).


n0cturn

I've come across similar issues with loaded samples playing at an unexpected pitch, for me it was usually the transpose setting on the sample page (bottom left on sample page) and from your pictures its set at F7 which seems high, try lowering it to F4 or lower.

Just a guess I'm the expert at nothing! (but I do that quite well)

Abrimaal

I wanted to
1. import the original (low quality) drum loop,
2. insert it to a pattern, adjust tempo, to play the whole loop in a single pattern.
3. add high quality drum samples to other channels, in the same note positions.
4. mute the original drums
5. save to .wav at the same speed and total duration.
6. replace the drums in the original song, in an audio mixer.

I think, the most important is the point 2, adjusting speed, pitch and pattern length to the original sample.
I can do it manually, by ear and stopwatch, balancing between higher and lower error levels.
but isn't there really a mathematical way? such as "adjust pattern playing time to the sample length"?


herodotas

No any fancy ways, all with your hands and head. This is oldschool.
life is darker than it seems

Saga Musix

It's not built into OpenMPT, but this calculator is really handy for all sorts of BPM and sample length related calculations:

https://mp3.deepsound.net/eng/samples_calculs.php

In particular, you are probably looking for the "To find the bpm of a loop when its length in milliseconds is known" section.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Abrimaal

Oh, that calculator is too difficult for me, just a human.
I am always afraid, when using any computer program, what a computer could calculate in milliseconds, will leave the hardest, numeric work to a human :(

BTW: recently I have built a car model to a game - everything was calculated by the game engine, but the steering wheel axis and rotation angle, left to a human to calculate. A few months of trying and still not good.

I have read in the newest release notes:

"pressing CTRL while moving sample loop... moves the loop, keeping the loop length constant"

If this is what I'm looking for, holding CTRL, I can move a loop, to a different position in the pattern,
this is half of the work done.

The other half, is to stretch the loop to match the tempo, without changing its pitch. Could the other release note say that?
"time stretching didn't update sample cue points" ?

Saga Musix

One thing that hasn't been addressed yet from the original post: The drum loop plays at a different speed in your pattern because you probably play it at a different note than what you previewed in the sample editor. If you hit the preview button in the sample editor, that will always play a C-5, also referred to as middle-C. That is the root note at which the sample will sound "natural". That applies to melodic instruments just like ot applies to drum loops, so if you play the loop at C-5 in the pattern instead of F-4, it will play at the same speed as the pattern editor.

To solve the issue of matching pattern speed and sample speed, you first have to ask yourself: Do you want to change the tempo of the pattern to match that of the sample, or do you want to change the playback speed of the sample to match the pattern tempo?

If you want to change the pattern speed, the easiest way is to place the sample in a pattern at the desired playback speed (so C-5 in your case), play the pattern and then hit the Tempo Tap button in the General Tab on every beat. OpenMPT will then guess the correct BPM. The other possibility would be using the aforementioned calculator, and it's really not that hard to use. As said, just go to the section "To find the bpm of a loop when its length in samples is known". You can ignore all the dozens of other input fields around it. Now you load the drum loop into OpenMPT and draw a selection in the sample editor to roughly match a portion of the sample that is one bar long. In the status bar, OpenMPT will tell you the length of that selection in samples. Enter that length into the website. Also copy the sample rate over (it's 44100 in your screenshot above). Now the calculator will give you the BPM that you can enter into the Tempo field in the general tab. If it's not quite right, try going up and down by a few BPM until it matches perfectly.


QuoteIf this is what I'm looking for, holding CTRL, I can move a loop, to a different position in the pattern,
this is half of the work done.
It probably won't help you: What this change does is if you already have a sample loop in a sample and you want to move it to a different position, you can do that now without calculating the start and end points manually.

QuoteThe other half, is to stretch the loop to match the tempo, without changing its pitch. Could the other release note say that?
"time stretching didn't update sample cue points" ?
This change is also not related to your issue, since you are not using any cue points. If you were using the time-stretching feature in the sample editor, it previously stretched the sample but didn't update cue points accordingly.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.