@@ -4,14 +4,11 @@ use serde::{Deserialize, Serialize};
4
4
5
5
use coupler:: format:: clap:: * ;
6
6
use coupler:: format:: vst3:: * ;
7
- use coupler:: {
8
- buffers:: * , bus:: * , editor:: * , events:: * , params:: smooth:: * , params:: * , plugin:: * , process:: * ,
9
- } ;
7
+ use coupler:: { buffers:: * , bus:: * , editor:: * , events:: * , params:: * , plugin:: * , process:: * } ;
10
8
11
- #[ derive( Params , Smooth , Serialize , Deserialize , Clone ) ]
9
+ #[ derive( Params , Serialize , Deserialize , Clone ) ]
12
10
struct GainParams {
13
11
#[ param( id = 0 , name = "Gain" , range = 0.0 ..1.0 , format = "{:.2}" ) ]
14
- #[ smooth( Exp , ms = 10.0 ) ]
15
12
gain : f32 ,
16
13
}
17
14
@@ -81,7 +78,7 @@ impl Plugin for Gain {
81
78
82
79
fn processor ( & self , config : Config ) -> Self :: Processor {
83
80
GainProcessor {
84
- params : self . params . smoothed ( config . sample_rate ) ,
81
+ params : self . params . clone ( ) ,
85
82
}
86
83
}
87
84
@@ -107,17 +104,15 @@ impl ClapPlugin for Gain {
107
104
}
108
105
109
106
pub struct GainProcessor {
110
- params : Smoothed < GainParams > ,
107
+ params : GainParams ,
111
108
}
112
109
113
110
impl Processor for GainProcessor {
114
111
fn set_param ( & mut self , id : ParamId , value : ParamValue ) {
115
112
self . params . set_param ( id, value) ;
116
113
}
117
114
118
- fn reset ( & mut self ) {
119
- self . params . reset ( ) ;
120
- }
115
+ fn reset ( & mut self ) { }
121
116
122
117
fn process ( & mut self , buffers : Buffers , events : Events ) {
123
118
let buffer: BufferMut = buffers. try_into ( ) . unwrap ( ) ;
@@ -132,9 +127,8 @@ impl Processor for GainProcessor {
132
127
}
133
128
134
129
for sample in buffer. samples ( ) {
135
- let gain = self . params . gain . next ( ) ;
136
130
for channel in sample {
137
- * channel *= gain;
131
+ * channel *= self . params . gain ;
138
132
}
139
133
}
140
134
}
0 commit comments