@@ -297,6 +297,66 @@ public static ProjectInfo Deserialize(Stream stream)
297
297
newClearness . DefaultValue = 0.0 ;
298
298
midiPartInfo . Automations . Add ( "Clearness" , newClearness ) ;
299
299
300
+ var newExciter = new AutomationInfo ( ) ;
301
+ var exciter = controllers . Cast < JObject > ( ) . FirstOrDefault ( c => ( string ? ) c [ "name" ] == "exciter" ) ? [ "events" ] ?? new JArray ( ) ;
302
+
303
+ if ( exciter . Count ( ) > 0 && ( int ) exciter [ 0 ] [ "pos" ] != 0 )
304
+ {
305
+ newExciter . Points . Add ( new Point ( 0 , 0 ) ) ;
306
+ newExciter . Points . Add ( new Point ( ( int ) exciter [ 0 ] [ "pos" ] - 1 , 0 ) ) ;
307
+ }
308
+
309
+ for ( int i = 0 ; exciter . Count ( ) > 0 && i < exciter . Count ( ) ; i ++ )
310
+ {
311
+ if ( i != 0 && ( int ) exciter [ i ] [ "pos" ] - 1 != ( int ) exciter [ i - 1 ] [ "pos" ] )
312
+ {
313
+ newExciter . Points . Add ( new Point ( ( int ) exciter [ i ] [ "pos" ] - 1 , RangeMapper ( ( int ) exciter [ i - 1 ] [ "value" ] , - 64 , 63 , - 1.0 , 1.0 ) ) ) ;
314
+ }
315
+ newExciter . Points . Add ( new Point ( ( int ) exciter [ i ] [ "pos" ] , RangeMapper ( ( int ) exciter [ i ] [ "value" ] , - 64 , 63 , - 1.0 , 1.0 ) ) ) ;
316
+ }
317
+ newExciter . DefaultValue = 0.0 ;
318
+ midiPartInfo . Automations . Add ( "Exciter" , newExciter ) ;
319
+
320
+ var newBreathiness = new AutomationInfo ( ) ;
321
+ var breathiness = controllers . Cast < JObject > ( ) . FirstOrDefault ( c => ( string ? ) c [ "name" ] == "breathiness" ) ? [ "events" ] ?? new JArray ( ) ;
322
+
323
+ if ( breathiness . Count ( ) > 0 && ( int ) breathiness [ 0 ] [ "pos" ] != 0 )
324
+ {
325
+ newBreathiness . Points . Add ( new Point ( 0 , 0 ) ) ;
326
+ newBreathiness . Points . Add ( new Point ( ( int ) breathiness [ 0 ] [ "pos" ] - 1 , 0 ) ) ;
327
+ }
328
+
329
+ for ( int i = 0 ; breathiness . Count ( ) > 0 && i < breathiness . Count ( ) ; i ++ )
330
+ {
331
+ if ( i != 0 && ( int ) breathiness [ i ] [ "pos" ] - 1 != ( int ) breathiness [ i - 1 ] [ "pos" ] )
332
+ {
333
+ newBreathiness . Points . Add ( new Point ( ( int ) breathiness [ i ] [ "pos" ] - 1 , RangeMapper ( ( int ) breathiness [ i - 1 ] [ "value" ] , 0 , 127 , 0 , 1.0 ) ) ) ;
334
+ }
335
+ newBreathiness . Points . Add ( new Point ( ( int ) breathiness [ i ] [ "pos" ] , RangeMapper ( ( int ) breathiness [ i ] [ "value" ] , 0 , 127 , 0 , 1.0 ) ) ) ;
336
+ }
337
+ newBreathiness . DefaultValue = 0.0 ;
338
+ midiPartInfo . Automations . Add ( "Breathiness" , newBreathiness ) ;
339
+
340
+ var newAir = new AutomationInfo ( ) ;
341
+ var air = controllers . Cast < JObject > ( ) . FirstOrDefault ( c => ( string ? ) c [ "name" ] == "air" ) ? [ "events" ] ?? new JArray ( ) ;
342
+
343
+ if ( air . Count ( ) > 0 && ( int ) air [ 0 ] [ "pos" ] != 0 )
344
+ {
345
+ newAir . Points . Add ( new Point ( 0 , 0 ) ) ;
346
+ newAir . Points . Add ( new Point ( ( int ) air [ 0 ] [ "pos" ] - 1 , 0 ) ) ;
347
+ }
348
+
349
+ for ( int i = 0 ; air . Count ( ) > 0 && i < air . Count ( ) ; i ++ )
350
+ {
351
+ if ( i != 0 && ( int ) air [ i ] [ "pos" ] - 1 != ( int ) air [ i - 1 ] [ "pos" ] )
352
+ {
353
+ newAir . Points . Add ( new Point ( ( int ) air [ i ] [ "pos" ] - 1 , RangeMapper ( ( int ) air [ i - 1 ] [ "value" ] , 0 , 127 , 0 , 1.0 ) ) ) ;
354
+ }
355
+ newAir . Points . Add ( new Point ( ( int ) air [ i ] [ "pos" ] , RangeMapper ( ( int ) air [ i ] [ "value" ] , 0 , 127 , 0 , 1.0 ) ) ) ;
356
+ }
357
+ newAir . DefaultValue = 0.0 ;
358
+ midiPartInfo . Automations . Add ( "Air" , newAir ) ;
359
+
300
360
partInfo = midiPartInfo ;
301
361
302
362
if ( partInfo != null )
0 commit comments