ホーム › Media.Audio.DirectSound › DSFXFlanger
DSFXFlanger
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| fWetDryMix | FLOAT | 4 | +0 | +0 | 原音とエフェクト音の混合比率(0〜100パーセント)。 |
| fDepth | FLOAT | 4 | +4 | +4 | 変調の深さ(0〜100パーセント)。 |
| fFeedback | FLOAT | 4 | +8 | +8 | フィードバック比率(-99〜99パーセント)。 |
| fFrequency | FLOAT | 4 | +12 | +12 | LFOの変調周波数(0〜10Hz)。 |
| lWaveform | INT | 4 | +16 | +16 | 変調波形(0=三角波、1=正弦波)。 |
| fDelay | FLOAT | 4 | +20 | +20 | 遅延時間(0〜4ミリ秒)。 |
| lPhase | INT | 4 | +24 | +24 | 左右チャンネル間の位相差を示す値(0〜4)。 |
各言語での定義
#include <windows.h>
// DSFXFlanger (x64 28 / x86 28 バイト)
typedef struct DSFXFlanger {
FLOAT fWetDryMix;
FLOAT fDepth;
FLOAT fFeedback;
FLOAT fFrequency;
INT lWaveform;
FLOAT fDelay;
INT lPhase;
} DSFXFlanger;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DSFXFlanger
{
public float fWetDryMix;
public float fDepth;
public float fFeedback;
public float fFrequency;
public int lWaveform;
public float fDelay;
public int lPhase;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DSFXFlanger
Public fWetDryMix As Single
Public fDepth As Single
Public fFeedback As Single
Public fFrequency As Single
Public lWaveform As Integer
Public fDelay As Single
Public lPhase As Integer
End Structureimport ctypes
from ctypes import wintypes
class DSFXFlanger(ctypes.Structure):
_fields_ = [
("fWetDryMix", ctypes.c_float),
("fDepth", ctypes.c_float),
("fFeedback", ctypes.c_float),
("fFrequency", ctypes.c_float),
("lWaveform", ctypes.c_int),
("fDelay", ctypes.c_float),
("lPhase", ctypes.c_int),
]#[repr(C)]
pub struct DSFXFlanger {
pub fWetDryMix: f32,
pub fDepth: f32,
pub fFeedback: f32,
pub fFrequency: f32,
pub lWaveform: i32,
pub fDelay: f32,
pub lPhase: i32,
}import "golang.org/x/sys/windows"
type DSFXFlanger struct {
fWetDryMix float32
fDepth float32
fFeedback float32
fFrequency float32
lWaveform int32
fDelay float32
lPhase int32
}type
DSFXFlanger = record
fWetDryMix: Single;
fDepth: Single;
fFeedback: Single;
fFrequency: Single;
lWaveform: Integer;
fDelay: Single;
lPhase: Integer;
end;const DSFXFlanger = extern struct {
fWetDryMix: f32,
fDepth: f32,
fFeedback: f32,
fFrequency: f32,
lWaveform: i32,
fDelay: f32,
lPhase: i32,
};type
DSFXFlanger {.bycopy.} = object
fWetDryMix: float32
fDepth: float32
fFeedback: float32
fFrequency: float32
lWaveform: int32
fDelay: float32
lPhase: int32struct DSFXFlanger
{
float fWetDryMix;
float fDepth;
float fFeedback;
float fFrequency;
int lWaveform;
float fDelay;
int lPhase;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DSFXFlanger サイズ: 28 バイト(x64)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; fWetDryMix : FLOAT (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fDepth : FLOAT (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fFeedback : FLOAT (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fFrequency : FLOAT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lWaveform : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; fDelay : FLOAT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; lPhase : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DSFXFlanger
#field float fWetDryMix
#field float fDepth
#field float fFeedback
#field float fFrequency
#field int lWaveform
#field float fDelay
#field int lPhase
#endstruct
stdim st, DSFXFlanger ; NSTRUCT 変数を確保
st->fWetDryMix = 100
mes "fWetDryMix=" + st->fWetDryMix