a440hz Posted May 16, 2010 Share Posted May 16, 2010 (edited) Hi all, I love this forum! I've looked all over it and at the AutoIt help file but I just can't get the syntax right. Here's the C code I'm trying to convert. Can anyone tell me what I'm doing wrong. float matrix[1][2]={ {0.5, -0.5}, // mono out = left - right in }; Here's My Function: Global $left, $right SetMatrix(0.5,-0.5) Func SetMatrix($left, $right) Local $matrix[2][3] $matrix[1][1] = $left $matrix[1][2] = $right local $mstruct = DllStructCreate("float[2]") DllStructSetData($mstruct, 1, $matrix[1][1],1) DllStructSetData($mstruct, 1, $matrix[1][2],2) $StreamMatrix1 = _BASS_Mixer_ChannelSetMatrix($source, DllStructGetPtr($mstruct)) EndFunc ;==>SetMatrix I've also tried: Global $left, $right SetMatrix(0.5,-0.5) Func SetMatrix($left, $right) Local $matrix[2][3] $matrix[1][1] = $left $matrix[1][2] = $right local $mstruct = DllStructCreate("float;float") DllStructSetData($mstruct, 1, $matrix[1][1]) DllStructSetData($mstruct, 2, $matrix[1][2]) $StreamMatrix1 = _BASS_Mixer_ChannelSetMatrix($source, DllStructGetPtr($mstruct)) EndFunc ;==>SetMatrix Thanks, Joe Edited May 16, 2010 by a440hz Are you experienced? Link to comment Share on other sites More sharing options...
UEZ Posted May 17, 2010 Share Posted May 17, 2010 Try this: Global $left, $right SetMatrix(0.5,-0.5) Func SetMatrix($left, $right) local $mstruct = DllStructCreate("float;float") DllStructSetData($mstruct, 1, $left) DllStructSetData($mstruct, 2, $right) MsgBox(0,"DllStruct","Struct Size: " & DllStructGetSize($mstruct) & @CRLF & _ ;for debugging only "Struct pointer: " & DllStructGetPtr($mstruct) & @CRLF & _ "Data:" & @CRLF & _ DllStructGetData($mstruct,1) & @CRLF & _ DllStructGetData($mstruct,2)) $StreamMatrix1 = _BASS_Mixer_ChannelSetMatrix($source, DllStructGetPtr($mstruct)) EndFunc ;==>SetMatrix BR, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
a440hz Posted May 17, 2010 Author Share Posted May 17, 2010 Thanks UEZ, That didn't work but this does. Thanks, Joe Func SetMatrix($left, $right) Local $mstruct = DllStructCreate("float[2]") DllStructSetData($mstruct, 1, $left,1) DllStructSetData($mstruct, 1, $right,2) _BASS_Mixer_ChannelSetMatrix($source, DllStructGetPtr($mstruct)) EndFunc ;==>SetMatrix Are you experienced? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now