SoundFontInfoLib  2.21.6
Library for parsing and rendering SF2 files
SF2::Render::Sample::Bounds Struct Reference

Represents the sample index bounds and loop start/end indices using values from the SF2 'shdr' entity as well as state values from generators that can change in real-time. More...

#include <Bounds.hpp>

Public Types

using Index = Entity::Generator::Index
 

Public Member Functions

 Bounds (const Entity::SampleHeader &header, const Voice::State &state)
 Construct new instance using information from 'shdr' and current voice state values from generators related to sample indices. More...
 
size_t startIndex () const
 
size_t startLoopIndex () const
 
size_t endLoopIndex () const
 
size_t endIndex () const
 

Detailed Description

Represents the sample index bounds and loop start/end indices using values from the SF2 'shdr' entity as well as state values from generators that can change in real-time.

Note that unlike the "absolute" values in the 'shdr' and the state offsets which are all based on the entire sample block of the file, these values are offsets from the first sample value from the 'shdr'.

Member Typedef Documentation

◆ Index

Constructor & Destructor Documentation

◆ Bounds()

SF2::Render::Sample::Bounds::Bounds ( const Entity::SampleHeader header,
const Voice::State state 
)
inline

Construct new instance using information from 'shdr' and current voice state values from generators related to sample indices.

Parameters
headerthe 'shdr' header to use
statethe generator values to use

References SF2::Entity::SampleHeader::endIndex(), SF2::Entity::SampleHeader::endLoopIndex(), header, SF2::Entity::SampleHeader::startIndex(), SF2::Entity::SampleHeader::startLoopIndex(), and SF2::Render::Voice::State::unmodulated().

Member Function Documentation

◆ endIndex()

size_t SF2::Render::Sample::Bounds::endIndex ( ) const
inline
Returns
the index after the last valid sample to use for rendering

Referenced by SF2::Render::Sample::Generator::generate().

◆ endLoopIndex()

size_t SF2::Render::Sample::Bounds::endLoopIndex ( ) const
inline
Returns
the index of the first sample AFTER a loop

◆ startIndex()

size_t SF2::Render::Sample::Bounds::startIndex ( ) const
inline
Returns
the index of the first sample to use for rendering

◆ startLoopIndex()

size_t SF2::Render::Sample::Bounds::startLoopIndex ( ) const
inline
Returns
the index of the first sample of a loop

The documentation for this struct was generated from the following file: