Sign in

what to do with Instruments Sample/Loop-Start/End

Category: Help
  • 15 0
    Message from siebenhirter on
    Hello,
    what is the advantage of individually setting the start and end of a loop in an instrument if these loop points have already been set correctly in the sample.

    Example:
    Instrument Rhodes Layer1 uses the following samples with the following parameters:
    Rhodes F#01 mit Sample-/Loop-Offset: / / -1 / 61761 / -31
    Rhodes C11 mit Sample-/Loop-Offset: / / / 673 / 2
    Rhodes F#11 mit Sample-/Loop-Offset: / / / 40062 / -33392

    Data of Samples (loops already set satisfactorly):
    Rhodes F#01 Size: 62752, Loop: 8 / 62744
    Rhodes C11 Size: 59783, Loop: 58436 / 5977
    Rhodes F#11 Size: 73946, Loop: 8 / 73938

    I am particularly surprised by the negative values (-1) of Sample end Offset and (-31, -33392) of End loop offset.

    What can I do additionally with that instruments sample points what can not be done with the parameters of samples directly?
    What does it mean to set an instruments loop end to -31 or to -33392?
    Can someone help me to understand these parameters in order to apply them in practice?
    Instrument.jpg
  • The loop offset is meant to be used when you want to override the default loop configuration in a sample. For instance, I needed once to use the Harpsichord samples to create a new instrument, because the sounding of this instrument is similar in many points, but with different effects and onset. So instead of duplicating the samples ant setting them individually, I just duplicated the harpsichord entry and set it to sound as I needed, changing the sample starting point and its looping point.

    As for the negative values, as well as any value out of the sample bounds, the synthesizer just calculate the position of the loop by shifting the point to somewhere inside the sample bounds, e.g. imagine a sample of size 5000 (valid values are between 0 and 4999), then you set the loop starting point to -500 and ending point at 9800. The real loop will be between 4500 and 4800.

    Hope that helps

    EDIT: I'm not sure, but I think the OFFSET is a value discounted from or added to the default configuration of the sample, e.g. if the loop starts at 10 by default and you set in the instrument a loop start offset of -6, it should start the loop now at 4. But as I stated I could be wrong, so just to be sure, run some tests to make it clear.
  • 15 0
    Message from siebenhirter on
    Thanks for your descriptions - you helped me a lot.
  • JJ 8 0
    Message from John J Speth on 1
    I'd like to clarify Filipe's explanation of sample offset specifications. I might be saying the same thing as Filipe but it wasn't clear to me. I believe this diagram accurately describes how sample start and end offsets shall be specified: A sample file contains N samples. We want to specify that the sample file shall heard from sample A to sample B, a subset of all samples in the sample file. < - - - - - - - - A sample file - - - - - - - - - > +--------------------------------------------------+ | |<- - - What we want to hear - - - ->| | +--------------------------------------------------+ ^ ^ ^ ^ 0 A B N-1 The start offset zero index is 0 so A will be greater than or equal to 0 and less than N. It is the number of samples after start (hence positive) at which the sound will start to be heard. The end offset zero index is N-1 so B will be less than or equal to 0 and greater than or equal to -N. It is the number of samples before the end (hence negative) at which the sound will cease to be heard. Polyphone will impose the limits on sample start and end offset data entries so samples outside the bounds of the sample file cannot be specified. If anyone can correct my understanding or add anything useful, please do so. The Polyphone Documentation is not very clear for these parameters.
  • Where did you obtain this diagram and explanation? I didn't test this in Polyphone, but seems pretty reliable. If this is right, then my explanation is partially incorrect... Following your diagram, an accurate example would be as follows: Suppose you have a sample file of size 1000. The samples contained in the file are "labeled" from 0 to 999. The start offset can only be positive integers from 0 to 999, and the end offset can only be negative integers from -1000 to 0. In practice, having e.g. 5 for start offset and -10 for end offset would mean that your sample file will start playing at 5th sample and end at the 989th one (you sum 5 with the minimum possible sample value and subtract 10 from the maximum possible value of sample)
  • JJ 8 0
    Message from John J Speth on
    Filipe Barros Rodrigues on -
    Where did you obtain this diagram and explanation? I didn't test this in Polyphone, but seems pretty reliable. If this is right, then my explanation is partially incorrect... Following your diagram, an accurate example would be as follows: Suppose you have a sample file of size 1000. The samples contained in the file are "labeled" from 0 to 999. The start offset can only be positive integers from 0 to 999, and the end offset can only be negative integers from -1000 to 0. In practice, having e.g. 5 for start offset and -10 for end offset would mean that your sample file will start playing at 5th sample and end at the 989th one (you sum 5 with the minimum possible sample value and subtract 10 from the maximum possible value of sample)
    Thanks for the review, Filipe. I wrote that diagram and explanation today after some experimentation. The concept of negative offset for a defined range of samples invites the possibility of involving samples that don't exist. I couldn't wrap my head around that. It's not the way I would have designed it so I needed to understand it. I'm sure there were external considerations that led to the choice of using negative offset.

    Your example analysis of a 1000 sample sound file matches my understanding. At the risk of sounding nit-picky, I think your use of "value" is a little off. I think a better term would be "sample index" or just "index".

    Thanks - JJS
  • John J Speth on -
    Thanks for the review, Filipe. I wrote that diagram and explanation today after some experimentation. The concept of negative offset for a defined range of samples invites the possibility of involving samples that don't exist. I couldn't wrap my head around that. It's not the way I would have designed it so I needed to understand it. I'm sure there were external considerations that led to the choice of using negative offset.

    Your example analysis of a 1000 sample sound file matches my understanding. At the risk of sounding nit-picky, I think your use of "value" is a little off. I think a better term would be "sample index" or just "index".

    Thanks - JJS
    No, you're right. I'm too used to work with numerical values that sometimes I end up disregarding their context...

    I also agree with your point, I think that working directly with the sample index would save more time (you just look up where you want to start/end and write it down) and it reduces the chance of playing out of bounds. But I think that the offset approximation maybe has something to do with the sound synthesizing process, maybe it's easier and safer for the computer doing simple offset calculations than having to manipulate hard values...

    One possible way to make this process more user-friendly: instead of just leaving the table for free editing like it is, an optional slider could be added to the interface at user's preferences, where you can interactively set your bounds without worrying to step outside the valid indexes. This feature, of course, would have to be expanded for many other controls, so it's interesting, but complicated at the same time.

    Thanks for the feedback.
  • JJ 8 0
    Message from John J Speth on
    To wrap this up, this reference document  is the source of the start and end offsets definitions. It's the Soundfont file format specification. The definitions that govern how start and end offsets are specified are on page 30. The definitions we are talking about are startAddrsOffset and endAddrsOffset. They include handy examples too.

Sign in or register to take part in discussions.

Polyphone needs you!

Polyphone is free but there are costs associated with its website and development. A small donation will help a lot.

Donate
Learn the basics Try a tutorial
Scroll to
top