- This topic has 0 replies, 1 voice, and was last updated 6 years, 8 months ago by Scottacus.
Viewing 1 post (of 1 total)
-
AuthorPosts
-
April 6, 2018 at 11:20 am #80939
My brother is building a cab and plans on putting quad speakers under the playfield to reproduce quadrophonic sounds for the various table elements and ball rolling. We were messing around with setting this up and it seemed like the sounds never really panned/faded fully so I took a look at the boiler plate script that we all use and I’m wondering if it needs to be modified?
The guts of the functions look like this
tmp = tableobj.y * 2 / table1.height-1If tmp > 0 ThenAudioFade = Csng(tmp ^10)ElseAudioFade = Csng(-((- tmp) ^10) )End IfThe first part “tmp = tableobj.y * 2 / table1.height-1” is perfect because it takes the x or y location of the object, multiplies it by 2, divides it by the table height/width and subtracts one. Here are some examples of outputs for a table with a width of 1000:Object location = 0 (far left) ((0*2)/1000) – 1 = -1Object location = 500 (middle) ((500*2)/1000) -1 = 0Object location = 1000 (far right) ((1000*2)/1000) -1 = 1This is perfect because far left or right get the full panNow take a look at the rest of the code. The -1 to +1 is raised to the 10th power and then subjected to a cosine function and then if/then’ed to make it positive or negative. Cosines are not linear so what you get is exactly what you hear when you listed to the table output from the speakers. The sound comes from dead center until the object is most of the way to the edge of the table and then it quickly moves toward +/- 1. Also raising the -tmp to an even power does nothing because even powers always yield positive outputs.I think the way this should work is to get rid of the cosine part and just set Pan/Fade to equal tmp and leave it there. Am I missing something here or is this feature not working as intended?You need to login in order to like this post: click here
-
AuthorPosts
Viewing 1 post (of 1 total)
Forums are currently locked.