Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Shape ¶
type Shape struct {
// contains filtered or unexported fields
}
Shape は、1周期分の波形です。
func MakeShapeTrimmed ¶
MakeShapeTrimmed は、範囲を指定して新しい Shape を作成します。
type ShapeHistory ¶
type ShapeHistory struct {
// contains filtered or unexported fields
}
ShapeHistory は、波形の履歴を一定数保持する領域です。
func (*ShapeHistory) Freq ¶
func (buf *ShapeHistory) Freq() float64
Freq は、現在バッファの中心にある波形のオリジナルの周波数を返します。
func (*ShapeHistory) Get ¶
func (buf *ShapeHistory) Get(srcPhase, dstPhase float64) float64
Get は、現在バッファの中心にある波形の位相 0≦srcPhase<1 における振幅を返します。 返される振幅は、前後各 sigmaWidth 個の波形の同じ位相における振幅を用いて補間された値で、 0≦dstPhase<1 はその係数に用いられます(小さいほど前方、大きいほど後方の波形に比重が置かれます)。
func (*ShapeHistory) Rotate ¶
func (buf *ShapeHistory) Rotate(s Shape)
Rotate は、波形の履歴に一つの Shape を追記し、一定数を超えた古い Shape を履歴から削除します。 TODO: リングバッファ化
type WaveSource ¶
type WaveSource struct {
// contains filtered or unexported fields
}
WaveSource は、ソース波形の供給用バッファです。
func (*WaveSource) DiscardUntil ¶
func (s *WaveSource) DiscardUntil(i int)
DiscardUntil は、指定した位置以前のバッファを破棄します。
Click to show internal directories.
Click to hide internal directories.