Skip to content

Commit 4dfd917

Browse files
committed
Improve code style
1 parent 61604cc commit 4dfd917

10 files changed

Lines changed: 30 additions & 30 deletions

File tree

src/WAGS/Imperative/Create/Allpass.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ allpass
2727
-> GraphBuilder p i o (T.GraphUnit id T.Allpass)
2828
allpass _ initialAllpass attributes = GraphBuilder go
2929
where
30-
initializeAllpass = unwrap $ Parameters.toInitializeAllpass initialAllpass
30+
{ frequency, q } = unwrap $ Parameters.toInitializeAllpass initialAllpass
3131
go i@(Core.AudioInterpret { makeAllpass, setFrequency, setQ }) =
3232
{ event:
3333
let
@@ -37,8 +37,8 @@ allpass _ initialAllpass attributes = GraphBuilder go
3737
{ id
3838
, parent: nothing
3939
, scope: "imperative"
40-
, frequency: initializeAllpass.frequency
41-
, q: initializeAllpass.q
40+
, frequency
41+
, q
4242
}
4343
eventN = keepLatest $ attributes <#> unwrap >>> match
4444
{ frequency: tmpResolveAU "imperative" i (setFrequency <<< { id, frequency: _ })

src/WAGS/Imperative/Create/Bandpass.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bandpass
2727
-> GraphBuilder p i o (T.GraphUnit id T.Bandpass)
2828
bandpass _ initialBandpass attributes = GraphBuilder go
2929
where
30-
initializeBandpass = unwrap $ Parameters.toInitializeBandpass initialBandpass
30+
{ frequency, q } = unwrap $ Parameters.toInitializeBandpass initialBandpass
3131
go i@(Core.AudioInterpret { makeBandpass, setFrequency, setQ }) =
3232
{ event:
3333
let
@@ -36,12 +36,12 @@ bandpass _ initialBandpass attributes = GraphBuilder go
3636
{ id
3737
, parent: nothing
3838
, scope: "imperative"
39-
, frequency: initializeBandpass.frequency
40-
, q: initializeBandpass.q
39+
, frequency
40+
, q
4141
}
4242
eventN = keepLatest $ attributes <#> unwrap >>> match
43-
{ frequency: tmpResolveAU "imperative" i (setFrequency <<< { id, frequency: _ })
44-
, q: tmpResolveAU "imperative" i (setQ <<< { id, q: _ })
43+
{ frequency: tmpResolveAU "imperative" i $ setFrequency <<< { id, frequency: _ }
44+
, q: tmpResolveAU "imperative" i $ setQ <<< { id, q: _ }
4545
}
4646
in
4747
event0 <|> eventN

src/WAGS/Imperative/Create/Constant.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ constant
2727
-> GraphBuilder p i o (T.GraphUnit id T.Constant)
2828
constant _ initialConstant attributes = GraphBuilder go
2929
where
30-
initializeConstant = unwrap $ Parameters.toInitializeConstant initialConstant
30+
{ offset } = unwrap $ Parameters.toInitializeConstant initialConstant
3131
go i@(Core.AudioInterpret { makeConstant, setOffset, setOnOff }) =
3232
{ event:
3333
let
@@ -36,7 +36,7 @@ constant _ initialConstant attributes = GraphBuilder go
3636
{ id
3737
, parent: nothing
3838
, scope: "imperative"
39-
, offset: initializeConstant.offset
39+
, offset
4040
}
4141
eventN = keepLatest $ attributes <#> unwrap >>> match
4242
{ offset: tmpResolveAU "imperative" i $ setOffset <<< { id, offset:_ }

src/WAGS/Imperative/Create/Convolver.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ convolver
2222
-> GraphBuilder p i o (T.GraphUnit id T.Convolver)
2323
convolver _ initialConvolver = GraphBuilder go
2424
where
25-
initializeConvolver = unwrap $ Parameters.toInitializeConvolver initialConvolver
25+
{ buffer } = unwrap $ Parameters.toInitializeConvolver initialConvolver
2626
go (Core.AudioInterpret { makeConvolver }) =
2727
{ event:
2828
let
@@ -31,7 +31,7 @@ convolver _ initialConvolver = GraphBuilder go
3131
{ id
3232
, parent: nothing
3333
, scope: "imperative"
34-
, buffer: initializeConvolver.buffer
34+
, buffer
3535
}
3636
in
3737
event0

src/WAGS/Imperative/Create/Delay.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ delay
2727
-> GraphBuilder p i o (T.GraphUnit id T.Delay)
2828
delay _ initialDelay attributes = GraphBuilder go
2929
where
30-
initializeDelay = unwrap $ Parameters.toInitializeDelay initialDelay
30+
{ delayTime, maxDelayTime } = unwrap $ Parameters.toInitializeDelay initialDelay
3131
go i@(Core.AudioInterpret { makeDelay, setDelay }) =
3232
{ event:
3333
let
@@ -36,8 +36,8 @@ delay _ initialDelay attributes = GraphBuilder go
3636
{ id
3737
, parent: nothing
3838
, scope: "imperative"
39-
, delayTime: initializeDelay.delayTime
40-
, maxDelayTime: initializeDelay.maxDelayTime
39+
, delayTime
40+
, maxDelayTime
4141
}
4242
eventN = keepLatest $ attributes <#> unwrap >>> match
4343
{ delayTime: tmpResolveAU "imperative" i $ setDelay <<< { id, delayTime: _ }

src/WAGS/Imperative/Create/Gain.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ gain
3232
-> GraphBuilder p i o (T.GraphUnit id T.Gain)
3333
gain _ initialGain attributes = GraphBuilder go
3434
where
35-
initializeGain = unwrap $ Parameters.toInitializeGain initialGain
35+
{ gain } = unwrap $ Parameters.toInitializeGain initialGain
3636
go i@(Core.AudioInterpret { makeGain, setGain }) =
3737
{ event:
3838
let
@@ -41,11 +41,11 @@ gain _ initialGain attributes = GraphBuilder go
4141
makeGain
4242
{ id
4343
, parent: nothing
44-
, gain: initializeGain.gain
44+
, gain
4545
, scope: "imperative"
4646
}
4747
eventN = keepLatest $ attributes <#> unwrap >>> match
48-
{ gain: Common.resolveAU i (setGain <<< { id, gain: _ })
48+
{ gain: Common.resolveAU i $ setGain <<< { id, gain: _ }
4949
}
5050
in
5151
event0 <|> eventN

src/WAGS/Imperative/Create/Highpass.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ highpass
2727
-> GraphBuilder p i o (T.GraphUnit id T.Highpass)
2828
highpass _ initialHighpass attributes = GraphBuilder go
2929
where
30-
initializeHighpass = unwrap $ Parameters.toInitializeHighpass initialHighpass
30+
{ frequency, q } = unwrap $ Parameters.toInitializeHighpass initialHighpass
3131
go i@(Core.AudioInterpret { makeHighpass, setFrequency, setQ }) =
3232
{ event:
3333
let
@@ -36,8 +36,8 @@ highpass _ initialHighpass attributes = GraphBuilder go
3636
{ id
3737
, parent: nothing
3838
, scope: "imperative"
39-
, frequency: initializeHighpass.frequency
40-
, q: initializeHighpass.q
39+
, frequency
40+
, q
4141
}
4242
eventN = keepLatest $ attributes <#> unwrap >>> match
4343
{ frequency: tmpResolveAU "imperative" i $ setFrequency <<< { id, frequency: _ }

src/WAGS/Imperative/Create/Highshelf.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ highshelf
2727
-> GraphBuilder p i o (T.GraphUnit id T.Highshelf)
2828
highshelf _ initialHighshelf attributes = GraphBuilder go
2929
where
30-
initializeHighshelf = unwrap $ Parameters.toInitializeHighshelf initialHighshelf
30+
{ frequency, gain } = unwrap $ Parameters.toInitializeHighshelf initialHighshelf
3131
go i@(Core.AudioInterpret { makeHighshelf, setFrequency, setGain }) =
3232
{ event:
3333
let
@@ -36,8 +36,8 @@ highshelf _ initialHighshelf attributes = GraphBuilder go
3636
{ id
3737
, parent: nothing
3838
, scope: "imperative"
39-
, frequency: initializeHighshelf.frequency
40-
, gain: initializeHighshelf.gain
39+
, frequency
40+
, gain
4141
}
4242
eventN = keepLatest $ attributes <#> unwrap >>> match
4343
{ frequency: tmpResolveAU "imperative" i $ setFrequency <<< { id, frequency: _ }

src/WAGS/Imperative/Create/Lowpass.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ lowpass
2727
-> GraphBuilder p i o (T.GraphUnit id T.Lowpass)
2828
lowpass _ initialLowpass attributes = GraphBuilder go
2929
where
30-
initializeLowpass = unwrap $ Parameters.toInitializeLowpass initialLowpass
30+
{ frequency, q } = unwrap $ Parameters.toInitializeLowpass initialLowpass
3131
go i@(Core.AudioInterpret { makeLowpass, setFrequency, setQ }) =
3232
{ event:
3333
let
@@ -36,8 +36,8 @@ lowpass _ initialLowpass attributes = GraphBuilder go
3636
{ id
3737
, parent: nothing
3838
, scope: "imperative"
39-
, frequency: initializeLowpass.frequency
40-
, q: initializeLowpass.q
39+
, frequency
40+
, q
4141
}
4242
eventN = keepLatest $ attributes <#> unwrap >>> match
4343
{ frequency: tmpResolveAU "imperative" i $ setFrequency <<< { id, frequency: _ }

src/WAGS/Imperative/Create/Lowshelf.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ lowshelf
2727
-> GraphBuilder p i o (T.GraphUnit id T.Lowshelf)
2828
lowshelf _ initialLowshelf attributes = GraphBuilder go
2929
where
30-
initializeLowshelf = unwrap $ Parameters.toInitializeLowshelf initialLowshelf
30+
{ frequency, gain } = unwrap $ Parameters.toInitializeLowshelf initialLowshelf
3131
go i@(Core.AudioInterpret { makeLowshelf, setFrequency, setGain }) =
3232
{ event:
3333
let
@@ -36,8 +36,8 @@ lowshelf _ initialLowshelf attributes = GraphBuilder go
3636
{ id
3737
, parent: nothing
3838
, scope: "imperative"
39-
, frequency: initializeLowshelf.frequency
40-
, gain: initializeLowshelf.gain
39+
, frequency
40+
, gain
4141
}
4242
eventN = keepLatest $ attributes <#> unwrap >>> match
4343
{ frequency: tmpResolveAU "imperative" i $ setFrequency <<< { id, frequency: _ }

0 commit comments

Comments
 (0)