Win32 API 日本語リファレンス
ホームMedia.Audio.DirectMusic › DMUS_WAVES_REVERB_PARAMS

DMUS_WAVES_REVERB_PARAMS

構造体
サイズx64: 16 バイト / x86: 16 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
fInGainFLOAT4+0+0入力ゲイン(dB)。リバーブ前の信号レベル調整値。
fReverbMixFLOAT4+4+4リバーブ成分の混合比(dB)。原音と残響音のバランス。
fReverbTimeFLOAT4+8+8残響時間(ミリ秒)。音が減衰しきるまでの時間。
fHighFreqRTRatioFLOAT4+12+12高周波数帯の残響時間比率。1.0未満で高域が早く減衰する。

各言語での定義

#include <windows.h>

// DMUS_WAVES_REVERB_PARAMS  (x64 16 / x86 16 バイト)
typedef struct DMUS_WAVES_REVERB_PARAMS {
    FLOAT fInGain;
    FLOAT fReverbMix;
    FLOAT fReverbTime;
    FLOAT fHighFreqRTRatio;
} DMUS_WAVES_REVERB_PARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DMUS_WAVES_REVERB_PARAMS
{
    public float fInGain;
    public float fReverbMix;
    public float fReverbTime;
    public float fHighFreqRTRatio;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DMUS_WAVES_REVERB_PARAMS
    Public fInGain As Single
    Public fReverbMix As Single
    Public fReverbTime As Single
    Public fHighFreqRTRatio As Single
End Structure
import ctypes
from ctypes import wintypes

class DMUS_WAVES_REVERB_PARAMS(ctypes.Structure):
    _fields_ = [
        ("fInGain", ctypes.c_float),
        ("fReverbMix", ctypes.c_float),
        ("fReverbTime", ctypes.c_float),
        ("fHighFreqRTRatio", ctypes.c_float),
    ]
#[repr(C)]
pub struct DMUS_WAVES_REVERB_PARAMS {
    pub fInGain: f32,
    pub fReverbMix: f32,
    pub fReverbTime: f32,
    pub fHighFreqRTRatio: f32,
}
import "golang.org/x/sys/windows"

type DMUS_WAVES_REVERB_PARAMS struct {
	fInGain float32
	fReverbMix float32
	fReverbTime float32
	fHighFreqRTRatio float32
}
type
  DMUS_WAVES_REVERB_PARAMS = record
    fInGain: Single;
    fReverbMix: Single;
    fReverbTime: Single;
    fHighFreqRTRatio: Single;
  end;
const DMUS_WAVES_REVERB_PARAMS = extern struct {
    fInGain: f32,
    fReverbMix: f32,
    fReverbTime: f32,
    fHighFreqRTRatio: f32,
};
type
  DMUS_WAVES_REVERB_PARAMS {.bycopy.} = object
    fInGain: float32
    fReverbMix: float32
    fReverbTime: float32
    fHighFreqRTRatio: float32
struct DMUS_WAVES_REVERB_PARAMS
{
    float fInGain;
    float fReverbMix;
    float fReverbTime;
    float fHighFreqRTRatio;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DMUS_WAVES_REVERB_PARAMS サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; fInGain : FLOAT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; fReverbMix : FLOAT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; fReverbTime : FLOAT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; fHighFreqRTRatio : FLOAT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DMUS_WAVES_REVERB_PARAMS
    #field float fInGain
    #field float fReverbMix
    #field float fReverbTime
    #field float fHighFreqRTRatio
#endstruct

stdim st, DMUS_WAVES_REVERB_PARAMS        ; NSTRUCT 変数を確保
st->fInGain = 100
mes "fInGain=" + st->fInGain