Skip to content

Commit

Permalink
Kartong: Tweaked engine sound.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed Apr 16, 2024
1 parent a35c83d commit 09c75c9
Show file tree
Hide file tree
Showing 13 changed files with 154 additions and 62 deletions.
Binary file added data/Assets/Audio/Engine/Engine Mid.wav
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions data/Source/Audio/Engine/Banks/Engine Mid - Bank.xdi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<object type="traktor.sound.BankAsset" version="3">
<category>{469BC5AF-787F-6B45-84CE-C563BB1F935F}</category>
<presence>0</presence>
<presenceRate>0.25</presenceRate>
<grains>
<item type="traktor.sound.RepeatGrainData">
<count>0</count>
<grain type="traktor.sound.PlayGrainData" version="2">
<sound>{1AAA9B0F-4CEE-3B4B-A98E-4C89E83C5176}</sound>
<filters/>
<gain>
<min>0</min>
<max>0</max>
</gain>
<pitch>
<min>1</min>
<max>1</max>
</pitch>
<repeat>false</repeat>
</grain>
</item>
</grains>
</object>
6 changes: 6 additions & 0 deletions data/Source/Audio/Engine/Banks/Engine Mid - Bank.xdm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<object type="traktor.db.LocalInstanceMeta" version="2">
<guid>{69B5C02A-7DDD-8A44-B230-E10B63B3F012}</guid>
<primaryType>traktor.sound.BankAsset</primaryType>
<blobs/>
</object>
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,25 @@
<comment/>
<position>
<first>-1</first>
<second>215</second>
<second>560</second>
</position>
<sound>{E03F7233-0806-B14B-810C-9901610CAF80}</sound>
</item>
<item type="traktor.sound.Output">
<comment/>
<position>
<first>610</first>
<second>227</second>
<first>808</first>
<second>277</second>
</position>
</item>
<item type="traktor.sound.Filter">
<comment/>
<position>
<first>413</first>
<second>235</second>
<first>391</first>
<second>203</second>
</position>
<filter type="traktor.sound.ReverbFilter">
<delay>
<item>17</item>
<item>37</item>
<item>61</item>
<item>97</item>
</delay>
<decay>0.3</decay>
<feedback>0.2</feedback>
<filter type="traktor.sound.LowPassFilter">
<cutOff>1000</cutOff>
</filter>
</item>
<item type="traktor.sound.Pitch">
Expand All @@ -49,124 +42,182 @@
<item type="traktor.sound.Parameter" version="1">
<comment/>
<position>
<first>-400</first>
<second>352</second>
<first>-443</first>
<second>274</second>
</position>
<name>A</name>
<defaultValue>0</defaultValue>
</item>
<item type="traktor.sound.Multiply">
<comment/>
<position>
<first>-218</first>
<second>372</second>
<first>-261</first>
<second>294</second>
</position>
</item>
<item type="traktor.sound.Scalar">
<comment/>
<position>
<first>-395</first>
<second>436</second>
<first>-438</first>
<second>358</second>
</position>
<value>3</value>
<value>1.3</value>
</item>
<item type="traktor.sound.Add">
<comment/>
<position>
<first>-25</first>
<second>401</second>
<first>-68</first>
<second>323</second>
</position>
</item>
<item type="traktor.sound.Scalar">
<comment/>
<position>
<first>-189</first>
<second>469</second>
<first>-232</first>
<second>391</second>
</position>
<value>1</value>
</item>
<item type="traktor.sound.Source">
<comment>
<![CDATA[
Mid
]]>
</comment>
<position>
<first>-12</first>
<second>220</second>
</position>
<sound>{69B5C02A-7DDD-8A44-B230-E10B63B3F012}</sound>
</item>
<item type="traktor.sound.Blend">
<comment/>
<position>
<first>596</first>
<second>282</second>
</position>
</item>
<item type="traktor.sound.Parameter" version="1">
<comment/>
<position>
<first>367</first>
<second>380</second>
</position>
<name>B</name>
<defaultValue>0</defaultValue>
</item>
</nodes>
<edges>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[2]"/>
<node ref="/object/graph/nodes/item[4]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[1]"/>
<name>Input</name>
<node ref="/object/graph/nodes/item[5]"/>
<name>Input1</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item"/>
<node ref="/object/graph/nodes/item[6]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[3]"/>
<name>Input</name>
<node ref="/object/graph/nodes/item[5]"/>
<name>Input2</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[3]"/>
<node ref="/object/graph/nodes/item[5]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[2]"/>
<name>Input</name>
<node ref="/object/graph/nodes/item[7]"/>
<name>Input1</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[4]"/>
<node ref="/object/graph/nodes/item[7]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[5]"/>
<name>Input1</name>
<node ref="/object/graph/nodes/item[3]"/>
<name>Adjust</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[6]"/>
<node ref="/object/graph/nodes/item[8]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[5]"/>
<node ref="/object/graph/nodes/item[7]"/>
<name>Input2</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[5]"/>
<node ref="/object/graph/nodes/item[9]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[7]"/>
<name>Input1</name>
<node ref="/object/graph/nodes/item[3]"/>
<name>Input</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[7]"/>
<node ref="/object/graph/nodes/item[11]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[10]"/>
<name>Weight</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[3]"/>
<name>Adjust</name>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[2]"/>
<name>Input</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[8]"/>
<node ref="/object/graph/nodes/item[3]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[7]"/>
<node ref="/object/graph/nodes/item[10]"/>
<name>Input1</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[2]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[10]"/>
<name>Input2</name>
</destination>
</item>
<item type="traktor.sound.Edge">
<source>
<node ref="/object/graph/nodes/item[10]"/>
<name>Output</name>
</source>
<destination>
<node ref="/object/graph/nodes/item[1]"/>
<name>Input</name>
</destination>
</item>
</edges>
</graph>
</object>
File renamed without changes.
9 changes: 9 additions & 0 deletions data/Source/Audio/Engine/Sources/Engine Mid.xdi
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<object type="traktor.sound.SoundAsset" version="8">
<fileName>Audio/Engine/Engine Mid.wav</fileName>
<category>{00000000-0000-0000-0000-000000000000}</category>
<stream>false</stream>
<preload>true</preload>
<compressed>false</compressed>
<gain>-10</gain>
</object>
6 changes: 6 additions & 0 deletions data/Source/Audio/Engine/Sources/Engine Mid.xdm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<object type="traktor.db.LocalInstanceMeta" version="2">
<guid>{1AAA9B0F-4CEE-3B4B-A98E-4C89E83C5176}</guid>
<primaryType>traktor.sound.SoundAsset</primaryType>
<blobs/>
</object>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<object type="traktor.sound.SoundAsset" version="8">
<fileName>Audio/Engine.wav</fileName>
<fileName>Audio/Engine/Engine.wav</fileName>
<category>{469BC5AF-787F-6B45-84CE-C563BB1F935F}</category>
<stream>false</stream>
<preload>true</preload>
<compressed>false</compressed>
<gain>-15.9</gain>
<gain>-10</gain>
</object>
File renamed without changes.
24 changes: 10 additions & 14 deletions data/Source/Scripts/Kart.xdi
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ function Kart:update(contextObject, totalTime, deltaTime)
true
)
local wa < const > = wheel.angle
skeletonComponent:concatenatePoseTransform(
wheelJoints[i] .. "_Rot",
Transform(Vector4.zero, Quaternion.fromEulerAngles(0, 0, wheel.angle * rotationMul[i])),
Transform(Vector4.zero, Quaternion.fromEulerAngles(0, 0, wa * rotationMul[i])),
false
)
Expand Down Expand Up @@ -78,24 +79,18 @@ function Kart:update(contextObject, totalTime, deltaTime)
if rigidBodyComponent.body.active then
local mps < const > = rigidBodyComponent.body.linearVelocity.length
local kph < const > = mps * (60 * 60) / 1000
local torque < const > = vehicleComponent.engineTorque
local gd = self._gear * 30 - 5
local gu = self._gear * 30 + 30 + 5
if kph < gd then
if self._gear > 0 then
self._gear = self._gear - 1
end
elseif kph > gu then
if self._gear < 2 then
self._gear = self._gear + 1
end
end
local pitch = (kph - self._gear * 30) / 40
local pitch = kph / 150
if pitch < 0.1 then pitch = 0.1 end
if pitch > 1 then pitch = 1 end
local lp = torque / 30 - 0.1
if lp < 0 then lp = 0 end
if lp > 1 then lp = 1 end
soundComponent:setParameter("A", pitch)
soundComponent:setParameter("B", lp)
soundComponent:play()
else
soundComponent:stop()
Expand All @@ -114,6 +109,7 @@ function Kart:teleport(T)
local eventSetComponent < const > = self.owner:getComponent(world.EventSetComponent)
eventSetComponent:raise("TELEPORT")
end
]]>
</text>
</object>

0 comments on commit 09c75c9

Please sign in to comment.