Skip to content

Commit

Permalink
Fixing spacing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rumblesan committed Dec 24, 2019
1 parent a069000 commit acb5d73
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
19 changes: 9 additions & 10 deletions src/coffee/sound/sound-system.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ class SoundSystem
name: name,
pattern: pattern
})


getFFT: () ->
@audioApi.getFFT()
@audioApi.getFFT()

getWaveForm: (value) ->
@audioApi.getWaveForm()
@audioApi.getWaveForm()

setSmoothingTimeConstant: (value) ->
@audioApi.setSmoothingTimeConstant value
@audioApi.setSmoothingTimeConstant value

setNumVars: (value) ->
@audioApi.setNumVars value
@audioApi.setNumVars value

playSounds: (beat) =>
for p in @playPatterns
Expand All @@ -58,4 +58,3 @@ class SoundSystem
@clearPatterns()

module.exports = SoundSystem

20 changes: 10 additions & 10 deletions src/coffee/sound/webAudioApi.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class WebAudioApi


callback: (data) =>
console.log('ESTAMOS YA EN EL CALLBACCKKKKKSS')
console.log('ESTAMOS YA EN EL CALLBACCKKKKKSS')


gotStream: (stream) =>
Expand Down Expand Up @@ -71,17 +71,17 @@ class WebAudioApi
#numbars = 14

for i in [0...@numbars]
multipliers = @analyser.frequencyBinCount / @numbars
multipliers = @analyser.frequencyBinCount / @numbars

magnitude = 0
multipliers = Math.floor ( multipliers )
offset = i * multipliers
#gotta sum/average the block, or we miss narrow-bandwidth spikes
for j in [0...multipliers]
magnitude += freqByteData[offset + j]
magnitude = 0
multipliers = Math.floor ( multipliers )
offset = i * multipliers
#gotta sum/average the block, or we miss narrow-bandwidth spikes
for j in [0...multipliers]
magnitude += freqByteData[offset + j]

magnitude = magnitude / multipliers
@fft[i] = magnitude
magnitude = magnitude / multipliers
@fft[i] = magnitude

@total += @bufferSize
if @total > @bufLength
Expand Down

0 comments on commit acb5d73

Please sign in to comment.