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

DMUS_LFOPARAMS

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

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

フィールド

フィールドサイズx64x86説明
pcFrequencyINT4+0+0LFOの周波数(ピッチセント単位)。
tcDelayINT4+4+4LFO開始までの遅延時間(タイムセント単位)。
gcVolumeScaleINT4+8+8LFOによる音量変調量(ゲインセント単位)。
pcPitchScaleINT4+12+12LFOによるピッチ変調量(ピッチセント単位)。
gcMWToVolumeINT4+16+16モジュレーションホイールから音量への変調量。
pcMWToPitchINT4+20+20モジュレーションホイールからピッチへの変調量。

各言語での定義

#include <windows.h>

// DMUS_LFOPARAMS  (x64 24 / x86 24 バイト)
typedef struct DMUS_LFOPARAMS {
    INT pcFrequency;
    INT tcDelay;
    INT gcVolumeScale;
    INT pcPitchScale;
    INT gcMWToVolume;
    INT pcMWToPitch;
} DMUS_LFOPARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DMUS_LFOPARAMS
{
    public int pcFrequency;
    public int tcDelay;
    public int gcVolumeScale;
    public int pcPitchScale;
    public int gcMWToVolume;
    public int pcMWToPitch;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DMUS_LFOPARAMS
    Public pcFrequency As Integer
    Public tcDelay As Integer
    Public gcVolumeScale As Integer
    Public pcPitchScale As Integer
    Public gcMWToVolume As Integer
    Public pcMWToPitch As Integer
End Structure
import ctypes
from ctypes import wintypes

class DMUS_LFOPARAMS(ctypes.Structure):
    _fields_ = [
        ("pcFrequency", ctypes.c_int),
        ("tcDelay", ctypes.c_int),
        ("gcVolumeScale", ctypes.c_int),
        ("pcPitchScale", ctypes.c_int),
        ("gcMWToVolume", ctypes.c_int),
        ("pcMWToPitch", ctypes.c_int),
    ]
#[repr(C)]
pub struct DMUS_LFOPARAMS {
    pub pcFrequency: i32,
    pub tcDelay: i32,
    pub gcVolumeScale: i32,
    pub pcPitchScale: i32,
    pub gcMWToVolume: i32,
    pub pcMWToPitch: i32,
}
import "golang.org/x/sys/windows"

type DMUS_LFOPARAMS struct {
	pcFrequency int32
	tcDelay int32
	gcVolumeScale int32
	pcPitchScale int32
	gcMWToVolume int32
	pcMWToPitch int32
}
type
  DMUS_LFOPARAMS = record
    pcFrequency: Integer;
    tcDelay: Integer;
    gcVolumeScale: Integer;
    pcPitchScale: Integer;
    gcMWToVolume: Integer;
    pcMWToPitch: Integer;
  end;
const DMUS_LFOPARAMS = extern struct {
    pcFrequency: i32,
    tcDelay: i32,
    gcVolumeScale: i32,
    pcPitchScale: i32,
    gcMWToVolume: i32,
    pcMWToPitch: i32,
};
type
  DMUS_LFOPARAMS {.bycopy.} = object
    pcFrequency: int32
    tcDelay: int32
    gcVolumeScale: int32
    pcPitchScale: int32
    gcMWToVolume: int32
    pcMWToPitch: int32
struct DMUS_LFOPARAMS
{
    int pcFrequency;
    int tcDelay;
    int gcVolumeScale;
    int pcPitchScale;
    int gcMWToVolume;
    int pcMWToPitch;
}

HSP用 定義

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

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

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