|
lmms
Cross-platform music production software
|
#include <VibratingString.h>
Classes | |
| struct | DelayLine |
Public Member Functions | |
| VibratingString ()=default | |
| VibratingString (float pitch, float pick, float pickup, const float *impulse, int len, sample_rate_t sampleRate, int oversample, float randomize, float stringLoss, float detune, bool state) | |
| ~VibratingString ()=default | |
| VibratingString (const VibratingString &)=delete | |
| VibratingString & | operator= (const VibratingString &)=delete |
| VibratingString (VibratingString &&) noexcept=delete | |
| VibratingString & | operator= (VibratingString &&) noexcept=default |
| sample_t | nextSample () |
Private Member Functions | |
| std::unique_ptr< DelayLine > | initDelayLine (int len) |
| void | resample (const float *src, f_cnt_t srcFrames, f_cnt_t dstFrames) |
| void | setDelayLine (DelayLine *dl, int pick, const float *values, int len, float scale, bool state) |
| void | toBridgeUpdate (DelayLine *dl, sample_t insamp) |
| void | fromBridgeUpdate (DelayLine *dl, sample_t insamp) |
| sample_t | bridgeReflection (sample_t insamp) |
Static Private Member Functions | |
| static sample_t | dlAccess (DelayLine *dl, int position) |
| static sample_t | fromBridgeAccess (DelayLine *dl, int position) |
| static sample_t | toBridgeAccess (DelayLine *dl, int position) |
Private Attributes | |
| std::unique_ptr< DelayLine > | m_fromBridge |
| std::unique_ptr< DelayLine > | m_toBridge |
| int | m_pickupLoc |
| int | m_oversample |
| float | m_randomize |
| float | m_stringLoss |
| std::unique_ptr< float[]> | m_impulse |
| int | m_choice |
| float | m_state |
| std::unique_ptr< sample_t[]> | m_outsamp |
|
default |
| lmms::VibratingString::VibratingString | ( | float | pitch, |
| float | pick, | ||
| float | pickup, | ||
| const float * | impulse, | ||
| int | len, | ||
| sample_rate_t | sampleRate, | ||
| int | oversample, | ||
| float | randomize, | ||
| float | stringLoss, | ||
| float | detune, | ||
| bool | state ) |
|
default |
|
delete |
|
deletenoexcept |
dlAccess(dl, position); Returns sample "position" samples into delay-line's past. Position "0" points to the most recently inserted sample.
|
inlinestaticprivate |
fromBridgeAccess(dl, position); Returns spatial sample at position "position", where position zero is equal to the current upper delay-line pointer position (x = 0). In a right-going delay-line, position increases to the right, and delay increases to the right => left = past and right = future.
fromBridgeUpdate(dl, insamp); Decrements current upper delay-line pointer position (i.e. the wave travels one sample to the right), moving it to the "effective" x = 0 position for the next iteration. The "bridge-reflected" sample from lower delay-line is then placed into this position.
|
private |
|
inline |
|
delete |
|
defaultnoexcept |
|
private |
|
inlineprivate |
setDelayLine initializes the string with an impulse at the pick position unless the impulse is longer than the string, in which case the impulse gets truncated.
toBridgeAccess(dl, position); Returns spatial sample at position "position", where position zero is equal to the current lower delay-line pointer position (x = 0). In a left-going delay-line, position increases to the right, and delay DEcreases to the right => left = future and right = past.
toBridgeUpdate(dl, insamp); Places "nut-reflected" sample from upper delay-line into current lower delay-line pointer position (which represents x = 0 position). The pointer is then incremented (i.e. the wave travels one sample to the left), turning the previous position into an "effective" x = L position for the next iteration.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |