Skip to content
Snippets Groups Projects
Commit 7b7513a6 authored by Micah Elizabeth Scott's avatar Micah Elizabeth Scott
Browse files

Fix spin rate (pitch bend) control

parent e6d4bed7
No related branches found
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ particleNotes = {} ...@@ -39,7 +39,7 @@ particleNotes = {}
# Adjustable parameters # Adjustable parameters
particleLifetime = 1.0 particleLifetime = 1.0
brightness = 1.0 brightness = 1.0
spinRate = 1.0 spinRate = 0
noteSustain = 1.6 noteSustain = 1.6
wobbleAmount = 24.0 wobbleAmount = 24.0
origin = [0, 0, 0] origin = [0, 0, 0]
...@@ -95,7 +95,7 @@ input.on 'message', (deltaTime, message) -> ...@@ -95,7 +95,7 @@ input.on 'message', (deltaTime, message) ->
when 0xe0 # Voice 0, Pitch Bend when 0xe0 # Voice 0, Pitch Bend
# Default spin 1.0, but allow forward/backward # Default spin 1.0, but allow forward/backward
spinRate = 1.0 + (message[2] - 64) * 20.0 / 64 spinRate = (message[2] - 64) * 10.0 / 64
draw = () -> draw = () ->
...@@ -119,7 +119,7 @@ draw = () -> ...@@ -119,7 +119,7 @@ draw = () ->
for p in particles for p in particles
# Angle: Global spin, thne positional mapping to key # Angle: Global spin, thne positional mapping to key
theta = midiToAngle p.note.key theta = spinAngle + midiToAngle p.note.key
# Radius: Particles spawn in center, fly outward # Radius: Particles spawn in center, fly outward
radius = 3.0 * (1 - p.life) radius = 3.0 * (1 - p.life)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment