Crop Patternlength(S) To Length In Time Of Selected Sample

I think you have misunderstood the purpose of the tool a little bit.

The tool does not make any attempt to analyse the content of the sample in order to calculate its tempo or number of beats, etc. The first two functions ‘Set Pattern Length’ and ‘Set Pattern Length & BPM’ simply take the duration of the sample in seconds, and then try to make the pattern length fit that duration as closely as possible. Your song’s BPM and LPB is important here because it will be used as the basis for calculating the number of patterns lines required for the sample to fit into a whole pattern.

For example… let’s say I have a sample that is 1 second in duration.

  • 1 second == 4 pattern lines @ 60 BPM / 4 LPB
  • 1 second == 5 pattern lines @ 75 BPM / 4 LPB
  • 1 second == 8 pattern lines @ 120 BPM / 4 LPB
  • 1 second == 16 pattern lines @ 240 BPM / 4 LPB

Etc.

If your sample is a weird length like 1.173 seconds, then it probably won’t fit exactly into a whole number of pattern lines, so this is why the tool will also take your starting BPM and then try to adjust it slightly to make everything fit.

The last function ‘Set BPM’ sort of works in reverse. If you manually set your pattern length to 16 lines and you have a sample with a duration of 1 second, then the tool will calculate whatever BPM is necessary to make 1 second fit exactly into 16 lines.

Does this make sense?

Going back to your example of using a sample that is 180 BPM… if you actually set the song to 180 BPM before using my tool, then it should calculate a more sensible pattern length for you. It really just depends what you start off with.

Updated for Renoise 2.7: